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

(-)a/cataloguing/value_builder/marc21_linking_section.pl (-20 / +1 lines)
Lines 348-372 sub plugin { Link Here
348
         );
348
         );
349
             $sth->finish;
349
             $sth->finish;
350
350
351
         my @branchloop;
351
         # To show list of branches please use GetBranchesLoop() and modify template
352
                my @select_branch;
353
             my %select_branches;
354
           my $branches = GetBranches;
355
            push @select_branch, "";
356
               $select_branches{''} = "";
357
             foreach my $thisbranch ( keys %$branches ) {
358
                   push @select_branch, $branches->{$thisbranch}->{'branchcode'};
359
                 $select_branches{ $branches->{$thisbranch}->{'branchcode'} } =
360
                   $branches->{$thisbranch}->{'branchname'};
361
            }
362
              my $CGIbranch = CGI::scrolling_list(
363
                   -name     => 'value',
364
                  -values   => \@select_branch,
365
                  -labels   => \%select_branches,
366
                        -size     => 1,
367
                        -multiple => 0
368
         );
369
             $sth->finish;
370
352
371
         my $req = $dbh->prepare(
353
         my $req = $dbh->prepare(
372
"select distinctrow left(publishercode,45) from biblioitems order by publishercode"
354
"select distinctrow left(publishercode,45) from biblioitems order by publishercode"
Lines 396-402 sub plugin { Link Here
396
378
397
            $template->param(    #classlist => $classlist,
379
            $template->param(    #classlist => $classlist,
398
                 CGIitemtype  => $CGIitemtype,
380
                 CGIitemtype  => $CGIitemtype,
399
                  CGIbranch    => $CGIbranch,
400
                    CGIPublisher => $CGIpublisher,
381
                    CGIPublisher => $CGIpublisher,
401
                 itypeloop    => \@itemtypes,
382
                 itypeloop    => \@itemtypes,
402
                   index        => $query->param('index'),
383
                   index        => $query->param('index'),
(-)a/cataloguing/value_builder/unimarc_field_4XX.pl (-20 / +1 lines)
Lines 503-527 sub plugin { Link Here
503
        );
503
        );
504
        $sth->finish;
504
        $sth->finish;
505
505
506
        my @branchloop;
506
        # To show list of branches please use GetBranchesLoop() and modify template
507
        my @select_branch;
508
        my %select_branches;
509
        my $branches = GetBranches;
510
        push @select_branch, "";
511
        $select_branches{''} = "";
512
        foreach my $thisbranch ( keys %$branches ) {
513
            push @select_branch, $branches->{$thisbranch}->{'branchcode'};
514
            $select_branches{ $branches->{$thisbranch}->{'branchcode'} } =
515
              $branches->{$thisbranch}->{'branchname'};
516
        }
517
        my $CGIbranch = CGI::scrolling_list(
518
            -name     => 'value',
519
            -values   => \@select_branch,
520
            -labels   => \%select_branches,
521
            -size     => 1,
522
            -multiple => 0
523
        );
524
        $sth->finish;
525
507
526
        my $req =
508
        my $req =
527
          $dbh->prepare(
509
          $dbh->prepare(
Lines 552-558 sub plugin { Link Here
552
534
553
        $template->param(    #classlist => $classlist,
535
        $template->param(    #classlist => $classlist,
554
            CGIitemtype  => $CGIitemtype,
536
            CGIitemtype  => $CGIitemtype,
555
            CGIbranch    => $CGIbranch,
556
            CGIPublisher => $CGIpublisher,
537
            CGIPublisher => $CGIpublisher,
557
            itypeloop    => \@itemtypes,
538
            itypeloop    => \@itemtypes,
558
            index        => $query->param('index'),
539
            index        => $query->param('index'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-6 / +17 lines)
Lines 993-1006 Link Here
993
        [% END %]
993
        [% END %]
994
        [% UNLESS nobranchcode %]
994
        [% UNLESS nobranchcode %]
995
    <li>
995
    <li>
996
      [% IF ( mandatorybranchcode ) %]
996
      [%- IF ( mandatorybranchcode ) -%]
997
        <label for="branchcode" class="required">
997
        <label for="branchcode" class="required">
998
      [% ELSE %]
998
      [%- ELSE -%]
999
        <label for="branchcode">
999
        <label for="branchcode">
1000
      [% END %]
1000
      [%- END -%]
1001
      Library: </label>
1001
      Library:</label>
1002
      [% CGIbranch %]
1002
      <select name="branchcode" size="1" id="branchcode">
1003
	  [% IF ( mandatorybranchcode ) %]<span class="required">Required</span>[% END %]
1003
        <option value=""></option>
1004
        [%- FOREACH branchloo IN branchloop %]
1005
          [% IF ( branchloo.selected ) -%]
1006
            <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
1007
          [%- ELSE -%]
1008
            <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
1009
          [%- END -%]
1010
        [%- END %]
1011
      </select>
1012
      [% IF ( mandatorybranchcode ) -%]
1013
      <span class="required">Required</span>
1014
      [%- END %]
1004
    </li>
1015
    </li>
1005
        [% END %]
1016
        [% END %]
1006
    <li>
1017
    <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 49-62 $(document).ready(function() { Link Here
49
	</table>
49
	</table>
50
[% END %]
50
[% END %]
51
[% ELSE %]
51
[% ELSE %]
52
	<h3>View a count of items held at your library grouped by item type</h3>
52
        <h3>View a count of items held at your library grouped by item type</h3>
53
	<form method="post" action="/cgi-bin/koha/reports/manager.pl?report_name=itemtypes">
53
        <form method="post" action="/cgi-bin/koha/reports/manager.pl?report_name=itemtypes">
54
		<fieldset class="rows"><ol><li><label for="value">Select a library</label> [% CGIbranch %]
54
          <fieldset class="rows">
55
		<span class="tip">Select none to see all libraries</span></li></ol></fieldset>
55
            <ol>
56
		<fieldset class="action"><input type="submit" value="Submit" />
56
              <li>
57
		<input type="hidden" name="report_name" value="[% report_name %]" />
57
                <label for="value">Select a library</label>
58
		<input type="hidden" name="do_it" value="1" /></fieldset>
58
                <select name="value" size="1" id="value">
59
	</form>
59
                  <option value=""></option>
60
                [%- FOREACH branchloo IN branchloop %]
61
                 [% IF ( branchloo.selected ) -%]
62
                  <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
63
                 [%- ELSE -%]
64
                  <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
65
                 [%- END -%]
66
                [%- END %]
67
                </select>
68
                <span class="tip">Select none to see all libraries</span>
69
              </li>
70
            </ol>
71
          </fieldset>
72
          <fieldset class="action"><input type="submit" value="Submit" />
73
            <input type="hidden" name="report_name" value="[% report_name %]" />
74
            <input type="hidden" name="do_it" value="1" />
75
          </fieldset>
76
        </form>
60
[% END %]
77
[% END %]
61
78
62
</div>
79
</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 710-716 $template->param( Link Here
710
  check_member    => $check_member,#to know if the borrower already exist(=>1) or not (=>0) 
685
  check_member    => $check_member,#to know if the borrower already exist(=>1) or not (=>0) 
711
  "op$op"   => 1);
686
  "op$op"   => 1);
712
687
713
$template->param(CGIbranch=>$CGIbranch) if ($CGIbranch);
688
$template->param( branchloop => $branchloop ) if ( $branchloop );
714
$template->param(
689
$template->param(
715
  nodouble  => $nodouble,
690
  nodouble  => $nodouble,
716
  borrowernumber  => $borrowernumber, #register number
691
  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