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

(-)a/cataloguing/value_builder/marc21_linking_section.pl (-20 / +1 lines)
Lines 356-380 sub plugin { Link Here
356
         );
356
         );
357
             $sth->finish;
357
             $sth->finish;
358
358
359
         my @branchloop;
359
         # To show list of branches please use GetBranchesLoop() and modify template
360
                my @select_branch;
361
             my %select_branches;
362
           my $branches = GetBranches;
363
            push @select_branch, "";
364
               $select_branches{''} = "";
365
             foreach my $thisbranch ( keys %$branches ) {
366
                   push @select_branch, $branches->{$thisbranch}->{'branchcode'};
367
                 $select_branches{ $branches->{$thisbranch}->{'branchcode'} } =
368
                   $branches->{$thisbranch}->{'branchname'};
369
            }
370
              my $CGIbranch = CGI::scrolling_list(
371
                   -name     => 'value',
372
                  -values   => \@select_branch,
373
                  -labels   => \%select_branches,
374
                        -size     => 1,
375
                        -multiple => 0
376
         );
377
             $sth->finish;
378
360
379
         my $req = $dbh->prepare(
361
         my $req = $dbh->prepare(
380
"select distinctrow left(publishercode,45) from biblioitems order by publishercode"
362
"select distinctrow left(publishercode,45) from biblioitems order by publishercode"
Lines 404-410 sub plugin { Link Here
404
386
405
            $template->param(    #classlist => $classlist,
387
            $template->param(    #classlist => $classlist,
406
                 CGIitemtype  => $CGIitemtype,
388
                 CGIitemtype  => $CGIitemtype,
407
                  CGIbranch    => $CGIbranch,
408
                    CGIPublisher => $CGIpublisher,
389
                    CGIPublisher => $CGIpublisher,
409
                 itypeloop    => \@itemtypes,
390
                 itypeloop    => \@itemtypes,
410
                   index        => $query->param('index'),
391
                   index        => $query->param('index'),
(-)a/cataloguing/value_builder/unimarc_field_4XX.pl (-20 / +1 lines)
Lines 511-535 sub plugin { Link Here
511
        );
511
        );
512
        $sth->finish;
512
        $sth->finish;
513
513
514
        my @branchloop;
514
        # To show list of branches please use GetBranchesLoop() and modify template
515
        my @select_branch;
516
        my %select_branches;
517
        my $branches = GetBranches;
518
        push @select_branch, "";
519
        $select_branches{''} = "";
520
        foreach my $thisbranch ( keys %$branches ) {
521
            push @select_branch, $branches->{$thisbranch}->{'branchcode'};
522
            $select_branches{ $branches->{$thisbranch}->{'branchcode'} } =
523
              $branches->{$thisbranch}->{'branchname'};
524
        }
525
        my $CGIbranch = CGI::scrolling_list(
526
            -name     => 'value',
527
            -values   => \@select_branch,
528
            -labels   => \%select_branches,
529
            -size     => 1,
530
            -multiple => 0
531
        );
532
        $sth->finish;
533
515
534
        my $req =
516
        my $req =
535
          $dbh->prepare(
517
          $dbh->prepare(
Lines 560-566 sub plugin { Link Here
560
542
561
        $template->param(    #classlist => $classlist,
543
        $template->param(    #classlist => $classlist,
562
            CGIitemtype  => $CGIitemtype,
544
            CGIitemtype  => $CGIitemtype,
563
            CGIbranch    => $CGIbranch,
564
            CGIPublisher => $CGIpublisher,
545
            CGIPublisher => $CGIpublisher,
565
            itypeloop    => \@itemtypes,
546
            itypeloop    => \@itemtypes,
566
            index        => $query->param('index'),
547
            index        => $query->param('index'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-6 / +17 lines)
Lines 988-1001 Link Here
988
        [% END %]
988
        [% END %]
989
        [% UNLESS nobranchcode %]
989
        [% UNLESS nobranchcode %]
990
    <li>
990
    <li>
991
      [% IF ( mandatorybranchcode ) %]
991
      [%- IF ( mandatorybranchcode ) -%]
992
        <label for="branchcode" class="required">
992
        <label for="branchcode" class="required">
993
      [% ELSE %]
993
      [%- ELSE -%]
994
        <label for="branchcode">
994
        <label for="branchcode">
995
      [% END %]
995
      [%- END -%]
996
      Library: </label>
996
      Library:</label>
997
      [% CGIbranch %]
997
      <select name="branchcode" size="1" id="branchcode">
998
	  [% IF ( mandatorybranchcode ) %]<span class="required">Required</span>[% END %]
998
        <option value=""></option>
999
        [%- FOREACH branchloo IN branchloop %]
1000
          [% IF ( branchloo.selected ) -%]
1001
            <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
1002
          [%- ELSE -%]
1003
            <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
1004
          [%- END -%]
1005
        [%- END %]
1006
      </select>
1007
      [% IF ( mandatorybranchcode ) -%]
1008
      <span class="required">Required</span>
1009
      [%- END %]
999
    </li>
1010
    </li>
1000
        [% END %]
1011
        [% END %]
1001
    <li>
1012
    <li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt (-1 / +7 lines)
Lines 164-170 Link Here
164
				<td>Library</td>
164
				<td>Library</td>
165
				<td><input type="radio" name="Line" value="branchcode" /></td>
165
				<td><input type="radio" name="Line" value="branchcode" /></td>
166
				<td><input type="radio" name="Column" value="branchcode" /></td>
166
				<td><input type="radio" name="Column" value="branchcode" /></td>
167
				<td>[% CGIBranch %]</td>
167
                           <td><select name="Filter" size="1" id="branch">
168
                                    <option value=""></option>
169
                                [%- FOREACH branchloo IN branchloop %]
170
                                    <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
171
                                [%- END %]
172
                                    </select>
173
                                </td>
168
			</tr>
174
			</tr>
169
<!-- Modified according to statistics table
175
<!-- Modified according to statistics table
170
			<tr>
176
			<tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_by_borrower_category.tt (-13 / +29 lines)
Lines 51-69 Link Here
51
	</table>
51
	</table>
52
[% END %]
52
[% END %]
53
[% ELSE %]
53
[% ELSE %]
54
	<form method="post" action="/cgi-bin/koha/reports/manager.pl">
54
        <form method="post" action="/cgi-bin/koha/reports/manager.pl">
55
		<fieldset class="rows">
55
          <fieldset class="rows">
56
		<legend>Checkouts by patron category</legend>
56
            <legend>Checkouts by patron category</legend>
57
		<ol><li><label for="borrowercategory">Select a borrower category</label><select name="value" id="borrowercategory"><option value="" > Any Category code</option>
57
            <ol>
58
    [% FOREACH loopcategorie IN loopcategories %]
58
              <li>
59
        <option value="[% loopcategorie.value %]" >[% loopcategorie.description %] </option>  
59
                <label for="borrowercategory">Select a borrower category</label>
60
     [% END %] 
60
                <select name="value" id="borrowercategory">
61
    </select></li>
61
                  <option value="">Any Category code</option>
62
		<li><label for="branch">Select a library:</label> [% CGIbranch %]</li></ol></fieldset>
62
                [%- FOREACH loopcategorie IN loopcategories %]
63
		<fieldset class="action"><input type="submit" value="Submit" />
63
                  <option value="[% loopcategorie.value %]" >[% loopcategorie.description %]</option>
64
		<input type="hidden" name="report_name" value="[% report_name %]" />
64
                [%- END %]
65
		<input type="hidden" name="do_it" value="1" /></fieldset>
65
                </select>
66
	</form>
66
              </li>
67
              <li>
68
                <label for="branch">Select a library:</label>
69
                <select name="value" size="1" id="branch">
70
                  <option value=""></option>
71
                [%- FOREACH branchloo IN branchloop %]
72
                  <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
73
                [%- END %]
74
               </select>
75
              </li>
76
            </ol>
77
          </fieldset>
78
          <fieldset class="action"><input type="submit" value="Submit" />
79
            <input type="hidden" name="report_name" value="[% report_name %]" />
80
            <input type="hidden" name="do_it" value="1" />
81
          </fieldset>
82
        </form>
67
[% END %]
83
[% END %]
68
84
69
</div>
85
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemtypes.tt (-8 / +25 lines)
Lines 57-70 $(document).ready(function(){ Link Here
57
	</table>
57
	</table>
58
[% END %]
58
[% END %]
59
[% ELSE %]
59
[% ELSE %]
60
	<h3>View a count of items held at your library grouped by item type</h3>
60
        <h3>View a count of items held at your library grouped by item type</h3>
61
	<form method="post" action="/cgi-bin/koha/reports/manager.pl?report_name=itemtypes">
61
        <form method="post" action="/cgi-bin/koha/reports/manager.pl?report_name=itemtypes">
62
		<fieldset class="rows"><ol><li><label for="value">Select a library</label> [% CGIbranch %]
62
          <fieldset class="rows">
63
		<span class="tip">Select none to see all libraries</span></li></ol></fieldset>
63
            <ol>
64
		<fieldset class="action"><input type="submit" value="Submit" />
64
              <li>
65
		<input type="hidden" name="report_name" value="[% report_name %]" />
65
                <label for="value">Select a library</label>
66
		<input type="hidden" name="do_it" value="1" /></fieldset>
66
                <select name="value" size="1" id="value">
67
	</form>
67
                  <option value=""></option>
68
                [%- FOREACH branchloo IN branchloop %]
69
                 [% IF ( branchloo.selected ) -%]
70
                  <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
71
                 [%- ELSE -%]
72
                  <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
73
                 [%- END -%]
74
                [%- END %]
75
                </select>
76
                <span class="tip">Select none to see all libraries</span>
77
              </li>
78
            </ol>
79
          </fieldset>
80
          <fieldset class="action"><input type="submit" value="Submit" />
81
            <input type="hidden" name="report_name" value="[% report_name %]" />
82
            <input type="hidden" name="do_it" value="1" />
83
          </fieldset>
84
        </form>
68
[% END %]
85
[% END %]
69
86
70
</div>
87
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-3 / +11 lines)
Lines 286-292 function checkMultiHold() { Link Here
286
        </li>
286
        </li>
287
        <li>
287
        <li>
288
            <label for="pickup">Pickup at:</label>
288
            <label for="pickup">Pickup at:</label>
289
            [% CGIbranch %]
289
            <select name="pickup" size="1" id="pickup">
290
            [%- FOREACH branchloo IN branchloop %]
291
              [% IF ( branchloo.selected ) -%]
292
                <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
293
              [%- ELSE -%]
294
                <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
295
              [%- END -%]
296
            [%- END %]
297
            </select>
290
        </li>
298
        </li>
291
299
292
	[% IF ( reserve_in_future ) %]
300
	[% IF ( reserve_in_future ) %]
Lines 620-628 function checkMultiHold() { Link Here
620
          <select name="pickup">
628
          <select name="pickup">
621
      [% FOREACH branchloo IN reserveloo.branchloop %]
629
      [% FOREACH branchloo IN reserveloo.branchloop %]
622
        [% IF ( branchloo.selected ) %]
630
        [% IF ( branchloo.selected ) %]
623
            <option value="[% branchloo.value %]" selected="selected">
631
            <option value="[% branchloo.branchcode %]" selected="selected">
624
        [% ELSE %]
632
        [% ELSE %]
625
            <option value="[% branchloo.value %]">
633
            <option value="[% branchloo.branchcode %]">
626
        [% END %]
634
        [% END %]
627
              [% branchloo.branchname %]
635
              [% branchloo.branchname %]
628
            </option>
636
            </option>
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt (-8 / +8 lines)
Lines 390-410 Link Here
390
                                          <td class="branch">
390
                                          <td class="branch">
391
                         [% UNLESS ( bibitemloo.holdable ) %]
391
                         [% UNLESS ( bibitemloo.holdable ) %]
392
                            <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
392
                            <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
393
                              [% FOREACH branchChoicesLoo IN bibitemloo.branchChoicesLoop %]
393
                              [% FOREACH branchloo IN bibitemloo.branchloop %]
394
                                [% IF ( branchChoicesLoo.selected ) %]
394
                                [% IF ( branchloo.selected ) %]
395
                                  <option value="[% branchChoicesLoo.value %]" selected="selected">[% branchChoicesLoo.branchname %]</option>
395
                                  <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
396
                                [% ELSE %]
396
                                [% ELSE %]
397
                                  <option value="[% branchChoicesLoo.value %]">[% branchChoicesLoo.branchname %]</option>
397
                                  <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
398
                                [% END %]
398
                                [% END %]
399
                              [% END %]
399
                              [% END %]
400
                          </select>
400
                          </select>
401
                          [% ELSE %]
401
                          [% ELSE %]
402
                            <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
402
                            <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
403
                              [% FOREACH branchChoicesLoo IN bibitemloo.branchChoicesLoop %]
403
                              [% FOREACH branchloo IN bibitemloo.branchloop %]
404
                                [% IF ( branchChoicesLoo.selected ) %]
404
                                [% IF ( branchloo.selected ) %]
405
                                  <option value="[% branchChoicesLoo.value %]" selected="selected">[% branchChoicesLoo.branchname %]</option>
405
                                  <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
406
                                [% ELSE %]
406
                                [% ELSE %]
407
                                  <option value="[% branchChoicesLoo.value %]">[% branchChoicesLoo.branchname %]</option>
407
                                  <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
408
                                [% END %]
408
                                [% END %]
409
                              [% END %]
409
                              [% END %]
410
                            </select>
410
                            </select>
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tt (-5 / +5 lines)
Lines 116-129 $.tablesorter.addParser({ Link Here
116
			[% IF ( itemtypeloo.selected ) %]<option value="[% itemtypeloo.itemtype %]" selected="selected"> [% ELSE %]<option value="[% itemtypeloo.itemtype %]"> [% END %] [% itemtypeloo.description %]</option>
116
			[% IF ( itemtypeloo.selected ) %]<option value="[% itemtypeloo.itemtype %]" selected="selected"> [% ELSE %]<option value="[% itemtypeloo.itemtype %]"> [% END %] [% itemtypeloo.description %]</option>
117
        [% END %]
117
        [% END %]
118
        </select> </li>
118
        </select> </li>
119
    [% IF ( branch_loop ) %]
119
    [% IF ( branchloop ) %]
120
    <li><label for="branch">Library:</label>
120
    <li><label for="branch">Library:</label>
121
        <select name="branch" id="branch">
121
        <select name="branch" id="branch">
122
        [% FOREACH branch_loo IN branch_loop %]
122
        [% FOREACH branchloo IN branchloop %]
123
            [% IF ( branch_loo.selected ) %]
123
            [% IF ( branchloo.selected ) %]
124
            <option value="[% branch_loo.value %]" selected="selected">[% branch_loo.branchname %]</option>
124
            <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
125
            [% ELSE %]
125
            [% ELSE %]
126
            <option value="[% branch_loo.value %]">[% branch_loo.branchname %]</option>
126
            <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
127
            [% END %]
127
            [% END %]
128
        [% END %]
128
        [% END %]
129
        </select>
129
        </select>
(-)a/members/memberentry.pl (-35 / +10 lines)
Lines 568-610 foreach (keys(%flags)) { Link Here
568
	push @flagdata,\%row;
568
	push @flagdata,\%row;
569
}
569
}
570
570
571
#get Branches
571
# get Branch Loop
572
my @branches;
572
# in modify mod: userbranch value for GetBranchesLoop() comes from borrowers table
573
my @select_branch;
573
# in add    mod: userbranch value come from branches table (ip correspondence)
574
my %select_branches;
574
575
575
my $userbranch = C4::Context->userenv->{'branch'};
576
my $onlymine=(C4::Context->preference('IndependantBranches') && 
577
              C4::Context->userenv && 
578
              C4::Context->userenv->{flags} % 2 !=1  && 
579
              C4::Context->userenv->{branch}?1:0);
580
              
581
my $branches=GetBranches($onlymine);
582
my $default;
583
my $CGIbranch;
584
for my $branch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) {
585
    push @select_branch,$branch;
586
    $select_branches{$branch} = $branches->{$branch}->{'branchname'};
587
    $default = C4::Context->userenv->{'branch'} if (C4::Context->userenv && C4::Context->userenv->{'branch'});
588
}
589
if(scalar(@select_branch) > 0){
590
# --------------------------------------------------------------------------------------------------------
591
  #in modify mod :default value from $CGIbranch comes from borrowers table
592
  #in add mod: default value come from branches table (ip correspendence)
593
if (defined ($data{'branchcode'}) and ( $op eq 'modify' || ( $op eq 'add' && $category_type eq 'C' ) )) {
576
if (defined ($data{'branchcode'}) and ( $op eq 'modify' || ( $op eq 'add' && $category_type eq 'C' ) )) {
594
    $default = $data{'branchcode'};
577
    $userbranch = $data{'branchcode'};
595
}
596
$CGIbranch = CGI::scrolling_list(-id    => 'branchcode',
597
            -name   => 'branchcode',
598
            -values => \@select_branch,
599
            -labels => \%select_branches,
600
            -size   => 1,
601
            -override => 1,  
602
            -multiple =>0,
603
            -default => $default,
604
        );
605
}
578
}
606
579
607
if(!$CGIbranch){
580
my $branchloop = GetBranchesLoop( $userbranch );
581
582
if( !$branchloop ){
608
    $no_add = 1;
583
    $no_add = 1;
609
    $template->param(no_branches => 1);
584
    $template->param(no_branches => 1);
610
}
585
}
Lines 709-715 $template->param( Link Here
709
  check_member    => $check_member,#to know if the borrower already exist(=>1) or not (=>0) 
684
  check_member    => $check_member,#to know if the borrower already exist(=>1) or not (=>0) 
710
  "op$op"   => 1);
685
  "op$op"   => 1);
711
686
712
$template->param(CGIbranch=>$CGIbranch) if ($CGIbranch);
687
$template->param( branchloop => $branchloop ) if ( $branchloop );
713
$template->param(
688
$template->param(
714
  nodouble  => $nodouble,
689
  nodouble  => $nodouble,
715
  borrowernumber  => $borrowernumber, #register number
690
  borrowernumber  => $borrowernumber, #register number
(-)a/opac/opac-reserve.pl (-3 / +2 lines)
Lines 108-115 my $branch = $query->param('branch') || $borr->{'branchcode'} || C4::Context->us Link Here
108
$template->param( branch => $branch );
108
$template->param( branch => $branch );
109
109
110
# make branch selection options...
110
# make branch selection options...
111
my $CGIbranchloop = GetBranchesLoop($branch);
111
my $branchloop = GetBranchesLoop($branch);
112
$template->param( CGIbranch => $CGIbranchloop );
113
112
114
# Is the person allowed to choose their branch
113
# Is the person allowed to choose their branch
115
my $OPACChooseBranch = (C4::Context->preference("OPACAllowUserToChooseBranch")) ? 1 : 0;
114
my $OPACChooseBranch = (C4::Context->preference("OPACAllowUserToChooseBranch")) ? 1 : 0;
Lines 358-364 foreach my $biblioNum (@biblionumbers) { Link Here
358
357
359
    my $record = GetMarcBiblio($biblioNum);
358
    my $record = GetMarcBiblio($biblioNum);
360
    # Init the bib item with the choices for branch pickup
359
    # Init the bib item with the choices for branch pickup
361
    my %biblioLoopIter = ( branchChoicesLoop => $CGIbranchloop );
360
    my %biblioLoopIter = ( branchloop => $branchloop );
362
361
363
    # Get relevant biblio data.
362
    # Get relevant biblio data.
364
    my $biblioData = $biblioDataHash{$biblioNum};
363
    my $biblioData = $biblioDataHash{$biblioNum};
(-)a/opac/opac-suggestions.pl (-2 / +2 lines)
Lines 131-138 if ( C4::Context->preference("AllowPurchaseSuggestionBranchChoice") ) { Link Here
131
    my $branch = $input->param('branch') || $borr->{'branchcode'} || C4::Context->userenv->{branch} || '' ;
131
    my $branch = $input->param('branch') || $borr->{'branchcode'} || C4::Context->userenv->{branch} || '' ;
132
132
133
# make branch selection options...
133
# make branch selection options...
134
    my $CGIbranchloop = GetBranchesLoop($branch);
134
    my $branchloop = GetBranchesLoop($branch);
135
    $template->param( branch_loop => $CGIbranchloop );
135
    $template->param( branchloop => $branchloop );
136
}
136
}
137
137
138
$template->param(
138
$template->param(
(-)a/reports/issues_avg_stats.pl (-23 / +8 lines)
Lines 160-180 if ($do_it) { Link Here
160
        $hassort1 =1 if ($value);
160
        $hassort1 =1 if ($value);
161
        push @select, $value;
161
        push @select, $value;
162
    }
162
    }
163
    my $branches=GetBranches();
164
    my @select_branch;
165
    my %select_branches;
166
    push @select_branch,"";
167
    $select_branches{""} = "";
168
    foreach my $branch (keys %$branches) {
169
        push @select_branch, $branch;
170
        $select_branches{$branch} = $branches->{$branch}->{'branchname'};
171
    }
172
    my $CGIBranch=CGI::scrolling_list( -name     => 'Filter',
173
                -id => 'branch',
174
                -values   => \@select_branch,
175
                -labels   => \%select_branches,
176
                -size     => 1,
177
                -multiple => 0 );
178
    
163
    
179
    my $CGISort1=CGI::scrolling_list( -name     => 'Filter',
164
    my $CGISort1=CGI::scrolling_list( -name     => 'Filter',
180
                -id => 'sort1',
165
                -id => 'sort1',
Lines 209-222 if ($do_it) { Link Here
209
    my $CGIsepChoice=GetDelimiterChoices;
194
    my $CGIsepChoice=GetDelimiterChoices;
210
    
195
    
211
    $template->param(
196
    $template->param(
212
                    CGIBorCat => $CGIBorCat,
197
                    CGIBorCat    => $CGIBorCat,
213
                    CGIItemType => $CGIItemTypes,
198
                    CGIItemType  => $CGIItemTypes,
214
                    CGIBranch => $CGIBranch,
199
                    branchloop   => GetBranchesLoop(),
215
                    hassort1=> $hassort1,
200
                    hassort1     => $hassort1,
216
                    hassort2=> $hassort2,
201
                    hassort2     => $hassort2,
217
                    HlghtSort2 => $hglghtsort2,
202
                    HlghtSort2   => $hglghtsort2,
218
                    CGISort1 => $CGISort1,
203
                    CGISort1     => $CGISort1,
219
                    CGISort2 => $CGISort2,
204
                    CGISort2     => $CGISort2,
220
                    CGIextChoice => $CGIextChoice,
205
                    CGIextChoice => $CGIextChoice,
221
                    CGIsepChoice => $CGIsepChoice
206
                    CGIsepChoice => $CGIsepChoice
222
                    );
207
                    );
(-)a/reports/issues_by_borrower_category.plugin (-28 / +14 lines)
Lines 62-97 the hashes are then translated to hash / arrays to be returned to manager.pl & s Link Here
62
=cut
62
=cut
63
63
64
sub set_parameters {
64
sub set_parameters {
65
	my ($template) = @_;
65
    my ($template) = @_;
66
	my $dbh = C4::Context->dbh;
66
67
	my $branches=GetBranches();
67
    $template->param( branchloop => GetBranchesLoop() );
68
	my @branches;
69
	my @select_branch;
70
	my %select_branches;
71
	push @select_branch,"";
72
	$select_branches{""} = "";
73
	foreach my $branch (keys %$branches) {
74
		push @select_branch, $branch;
75
		$select_branches{$branch} = $branches->{$branch}->{'branchname'};
76
	}
77
	my $CGIbranch=CGI::scrolling_list( -name     => 'value',
78
				-id => 'branch',
79
				-values   => \@select_branch,
80
				-labels   => \%select_branches,
81
				-size     => 1,
82
				-multiple => 0 );
83
	$template->param(CGIbranch => $CGIbranch);
84
  
68
  
85
  my ($codes,$labels)=GetborCatFromCatType(undef,undef);
69
    my ($codes,$labels)=GetborCatFromCatType(undef,undef);
86
  my @borcatloop;
70
    my @borcatloop;
87
  foreach my $thisborcat (sort keys %$labels) {
71
    foreach my $thisborcat (sort keys %$labels) {
88
            push @borcatloop, {value => $thisborcat,
72
        push @borcatloop, {
89
                               description => $labels->{$thisborcat},
73
                          value       => $thisborcat,
90
                            };
74
                          description => $labels->{$thisborcat},
91
  }
75
                          };
92
  $template->param(loopcategories => \@borcatloop);
76
    }
93
	return $template;
77
    $template->param(loopcategories => \@borcatloop);
78
    return $template;
94
}
79
}
80
95
sub calculate {
81
sub calculate {
96
	my ($parameters) = @_;
82
	my ($parameters) = @_;
97
	my @results =();
83
	my @results =();
(-)a/reports/itemtypes.plugin (-21 / +3 lines)
Lines 32-60 use C4::Branch; # GetBranches Link Here
32
32
33
sub set_parameters {
33
sub set_parameters {
34
	my ($template) = @_;
34
	my ($template) = @_;
35
	my $dbh = C4::Context->dbh;
35
    my $userbranch = C4::Context->userenv->{'branch'};
36
	my $branches=GetBranches();
36
     $template->param( branchloop => GetBranchesLoop($userbranch) );
37
	my @branches;
38
	my $default;
39
	my @select_branch;
40
	my %select_branches;
41
	push @select_branch,"";
42
	$select_branches{""} = "";
43
	for my $branch (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) {
44
		push @select_branch, $branch;
45
		$select_branches{$branch} = $branches->{$branch}->{'branchname'};
46
		$default = C4::Context->userenv->{'branch'} if (C4::Context->userenv && C4::Context->userenv->{'branch'});
47
	}
48
	my $CGIbranch=CGI::scrolling_list( -name     => 'value',
49
				-id => 'value',
50
				-values   => \@select_branch,
51
				-labels   => \%select_branches,
52
				-size     => 1,
53
				-multiple => 0,
54
				-default => $default, );
55
	$template->param(CGIbranch => $CGIbranch);
56
	return $template;
37
	return $template;
57
}
38
}
39
58
sub calculate {
40
sub calculate {
59
	my ($parameters) = @_;
41
	my ($parameters) = @_;
60
	my @results =();
42
	my @results =();
(-)a/reserve/request.pl (-20 / +2 lines)
Lines 65-87 my $showallitems = $input->param('showallitems'); Link Here
65
my $branches = GetBranches();
65
my $branches = GetBranches();
66
my $itemtypes = GetItemTypes();
66
my $itemtypes = GetItemTypes();
67
67
68
my $default = C4::Context->userenv->{branch};
68
my $userbranch = C4::Context->userenv->{branch};
69
my @values;
70
my %label_of;
71
72
foreach my $branchcode ( sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches ) {
73
    push @values, $branchcode;
74
    $label_of{$branchcode} = $branches->{$branchcode}->{branchname};
75
}
76
my $CGIbranch = CGI::scrolling_list(
77
                                    -name     => 'pickup',
78
                                    -id          => 'pickup',
79
                                    -values   => \@values,
80
                                    -default  => $default,
81
                                    -labels   => \%label_of,
82
                                    -size     => 1,
83
                                    -multiple => 0,
84
                                   );
85
69
86
# Select borrowers infos
70
# Select borrowers infos
87
my $findborrower = $input->param('findborrower');
71
my $findborrower = $input->param('findborrower');
Lines 590-597 foreach my $biblionumber (@biblionumbers) { Link Here
590
    my $time = time();
574
    my $time = time();
591
575
592
    $template->param(
576
    $template->param(
593
                     CGIbranch   => $CGIbranch,
577
                     branchloop  => GetBranchesLoop($userbranch),
594
595
                     time        => $time,
578
                     time        => $time,
596
                     fixedRank   => $fixedRank,
579
                     fixedRank   => $fixedRank,
597
                    );
580
                    );
598
- 

Return to bug 9457