View | Details | Raw Unified | Return to bug 12675
Collapse All | Expand All

(-)a/C4/Koha.pm (-8 / +63 lines)
Lines 46-51 BEGIN { Link Here
46
		&GetSupportName &GetSupportList
46
		&GetSupportName &GetSupportList
47
		&get_itemtypeinfos_of
47
		&get_itemtypeinfos_of
48
		&getframeworks &getframeworkinfo
48
		&getframeworks &getframeworkinfo
49
        &GetFrameworksLoop
49
		&getauthtypes &getauthtype
50
		&getauthtypes &getauthtype
50
		&getallthemes
51
		&getallthemes
51
		&getFacets
52
		&getFacets
Lines 363-374 build a HTML select with the following code : Link Here
363
364
364
=head3 in PERL SCRIPT
365
=head3 in PERL SCRIPT
365
366
366
  my $frameworks = frameworks();
367
  my $frameworks = getframeworks();
367
  my @frameworkloop;
368
  my @frameworkloop;
368
  foreach my $thisframework (keys %$frameworks) {
369
  foreach my $thisframework (keys %$frameworks) {
369
    my $selected = 1 if $thisframework eq $frameworkcode;
370
    my $selected = 1 if $thisframework eq $frameworkcode;
370
    my %row =(value => $thisframework,
371
    my %row =(
371
                selected => $selected,
372
                value       => $thisframework,
373
                selected    => $selected,
372
                description => $frameworks->{$thisframework}->{'frameworktext'},
374
                description => $frameworks->{$thisframework}->{'frameworktext'},
373
            );
375
            );
374
    push @frameworksloop, \%row;
376
    push @frameworksloop, \%row;
Lines 377-390 build a HTML select with the following code : Link Here
377
379
378
=head3 in TEMPLATE
380
=head3 in TEMPLATE
379
381
380
  <form action='<!-- TMPL_VAR name="script_name" -->' method=post>
382
  <form action="[% script_name %] method=post>
381
    <select name="frameworkcode">
383
    <select name="frameworkcode">
382
        <option value="">Default</option>
384
        <option value="">Default</option>
383
    <!-- TMPL_LOOP name="frameworkloop" -->
385
        [% FOREACH framework IN frameworkloop %]
384
        <option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="frameworktext" --></option>
386
        [% IF ( framework.selected ) %]
385
    <!-- /TMPL_LOOP -->
387
        <option value="[% framework.value %]" selected>[% framework.description %]</option>
388
        [% ELSE %]
389
        <option value="[% framework.value %]">[% framework.description %]</option>
390
        [% END %]
391
        [% END %]
386
    </select>
392
    </select>
387
    <input type=text name=searchfield value="<!-- TMPL_VAR name="searchfield" -->">
393
    <input type=text name=searchfield value="[% searchfield %]">
388
    <input type="submit" value="OK" class="button">
394
    <input type="submit" value="OK" class="button">
389
  </form>
395
  </form>
390
396
Lines 403-408 sub getframeworks { Link Here
403
    return ( \%itemtypes );
409
    return ( \%itemtypes );
404
}
410
}
405
411
412
=head2 GetFrameworksLoop
413
414
  $frameworks = GetFrameworksLoop( $frameworkcode );
415
416
Returns the loop suggested on getframework(),
417
418
build a HTML select with the following code :
419
420
=head3 in PERL SCRIPT
421
422
  $template->param(frameworkloop => GetFrameworksLoop( $frameworkcode );
423
424
=head3 in TEMPLATE
425
426
  Same as getframework()
427
428
  <form action="[% script_name %] method=post>
429
    <select name="frameworkcode">
430
        <option value="">Default</option>
431
        [% FOREACH framework IN frameworkloop %]
432
        [% IF ( framework.selected ) %]
433
        <option value="[% framework.value %]" selected>[% framework.description %]</option>
434
        [% ELSE %]
435
        <option value="[% framework.value %]">[% framework.description %]</option>
436
        [% END %]
437
        [% END %]
438
    </select>
439
    <input type=text name=searchfield value="[% searchfield %]">
440
    <input type="submit" value="OK" class="button">
441
  </form>
442
443
=cut
444
445
sub GetFrameworksLoop {
446
    my $frameworkcode = shift;
447
    my $frameworks = getframeworks();
448
    my @frameworkloop;
449
    foreach my $thisframework (sort { uc($frameworks->{$a}->{'frameworktext'}) cmp uc($frameworks->{$b}->{'frameworktext'}) } keys %$frameworks) {
450
        my $selected = ( $thisframework eq $frameworkcode ) ? 1 : undef;
451
        my %row = (
452
                value       => $thisframework,
453
                selected    => $selected,
454
                description => $frameworks->{$thisframework}->{'frameworktext'},
455
            );
456
        push @frameworkloop, \%row;
457
  }
458
  return \@frameworkloop;
459
}
460
406
=head2 getframeworkinfo
461
=head2 getframeworkinfo
407
462
408
  $frameworkinfo = &getframeworkinfo($frameworkcode);
463
  $frameworkinfo = &getframeworkinfo($frameworkcode);
(-)a/catalogue/labeledMARCdetail.pl (-24 / +3 lines)
Lines 29-34 use C4::Items; Link Here
29
use C4::Members; # to use GetMember
29
use C4::Members; # to use GetMember
30
use C4::Search;		# enabled_staff_search_views
30
use C4::Search;		# enabled_staff_search_views
31
use C4::Acquisition qw(GetOrdersByBiblionumber);
31
use C4::Acquisition qw(GetOrdersByBiblionumber);
32
use C4::Koha qw( GetFrameworksLoop );
32
33
33
my $query        = new CGI;
34
my $query        = new CGI;
34
my $dbh          = C4::Context->dbh;
35
my $dbh          = C4::Context->dbh;
Lines 79-108 my $itemcount = GetItemsCount($biblionumber); Link Here
79
$template->param( count => $itemcount,
80
$template->param( count => $itemcount,
80
					bibliotitle => $biblio->{title}, );
81
					bibliotitle => $biblio->{title}, );
81
82
82
#Getting the list of all frameworks
83
#Getting framework loop
83
my $queryfwk =
84
$template->param(frameworkloop => GetFrameworksLoop( $frameworkcode ) );
84
  $dbh->prepare("select frameworktext, frameworkcode from biblio_framework");
85
$queryfwk->execute;
86
my %select_fwk;
87
my @select_fwk;
88
my $curfwk;
89
push @select_fwk, "Default";
90
$select_fwk{"Default"} = "Default";
91
92
while ( my ( $description, $fwk ) = $queryfwk->fetchrow ) {
93
    push @select_fwk, $fwk;
94
    $select_fwk{$fwk} = $description;
95
}
96
$curfwk=$frameworkcode;
97
my $framework=CGI::scrolling_list( -name     => 'Frameworks',
98
            -id => 'Frameworks',
99
            -default => $curfwk,
100
            -OnChange => 'Changefwk(this);',
101
            -values   => \@select_fwk,
102
            -labels   => \%select_fwk,
103
            -size     => 1,
104
            -multiple => 0 );
105
$template->param(framework => $framework);
106
85
107
my @marc_data;
86
my @marc_data;
108
my $prevlabel = '';
87
my $prevlabel = '';
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tt (-2 / +12 lines)
Lines 57-63 Link Here
57
					[% UNLESS ( popup ) %]
57
					[% UNLESS ( popup ) %]
58
						<h1>Labeled MARC biblio : [% biblionumber %]  ( [% bibliotitle %] )</h1>
58
						<h1>Labeled MARC biblio : [% biblionumber %]  ( [% bibliotitle %] )</h1>
59
					[% END %]
59
					[% END %]
60
                    <p><b>With framework :[% framework %]</b></p>
60
                    <p><b>With framework:
61
                    <select name="Frameworks" id="Frameworks" size="1" onchange="Changefwk(this);">
62
                        <option value="">Default</option>
63
                        [% FOREACH framework IN frameworkloop %]
64
                        [% IF ( framework.selected ) %]
65
                        <option value="[% framework.value %]" selected>[% framework.description %]</option>
66
                        [% ELSE %]
67
                        <option value="[% framework.value %]">[% framework.description %]</option>
68
                        [% END %]
69
                        [% END %]
70
                    </select>
71
                    </b></p>
61
					<!-- div id="bibliotabs" class="toptabs numbered" -->
72
					<!-- div id="bibliotabs" class="toptabs numbered" -->
62
					<div>
73
					<div>
63
						<table class="labeledmarc-table">
74
						<table class="labeledmarc-table">
64
- 

Return to bug 12675