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

(-)a/C4/Context.pm (-1 / +3 lines)
Lines 946-953 sub mybranch { Link Here
946
=cut
946
=cut
947
947
948
sub only_my_library {
948
sub only_my_library {
949
    my ( $class, $pref ) = @_;
950
    $pref //= 'IndependentBranches';
949
    return
951
    return
950
         C4::Context->preference('IndependentBranches')
952
         C4::Context->preference($pref)
951
      && C4::Context->userenv
953
      && C4::Context->userenv
952
      && !C4::Context->IsSuperLibrarian()
954
      && !C4::Context->IsSuperLibrarian()
953
      && C4::Context->userenv->{branch};
955
      && C4::Context->userenv->{branch};
(-)a/C4/Items.pm (-1 / +8 lines)
Lines 767-772 sub GetItemsInfo { Link Here
767
    my $userenv = C4::Context->userenv;
767
    my $userenv = C4::Context->userenv;
768
    my $want_not_same_branch = C4::Context->preference("IndependentBranches") && !C4::Context->IsSuperLibrarian();
768
    my $want_not_same_branch = C4::Context->preference("IndependentBranches") && !C4::Context->IsSuperLibrarian();
769
    while ( my $data = $sth->fetchrow_hashref ) {
769
    while ( my $data = $sth->fetchrow_hashref ) {
770
        next if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && $data->{homebranch} ne $userenv->{branch} );
771
770
        if ( $data->{borrowernumber} && $want_not_same_branch) {
772
        if ( $data->{borrowernumber} && $want_not_same_branch) {
771
            $data->{'NOTSAMEBRANCH'} = $data->{'bcode'} ne $userenv->{branch};
773
            $data->{'NOTSAMEBRANCH'} = $data->{'bcode'} ne $userenv->{branch};
772
        }
774
        }
Lines 864-870 sub GetItemsLocationInfo { Link Here
864
			    location, itemcallnumber, cn_sort
866
			    location, itemcallnumber, cn_sort
865
		     FROM items, branches as a, branches as b
867
		     FROM items, branches as a, branches as b
866
		     WHERE homebranch = a.branchcode AND holdingbranch = b.branchcode 
868
		     WHERE homebranch = a.branchcode AND holdingbranch = b.branchcode 
867
		     AND biblionumber = ?
869
		     AND biblionumber = ?";
870
    if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') &&( my $mybranch = C4::Context->userenv->{branch} ) ) {
871
        $query .= "
872
             AND homebranch = '$mybranch'";
873
    }
874
    $query .= "
868
		     ORDER BY cn_sort ASC";
875
		     ORDER BY cn_sort ASC";
869
	my $sth = $dbh->prepare($query);
876
	my $sth = $dbh->prepare($query);
870
        $sth->execute($biblionumber);
877
        $sth->execute($biblionumber);
(-)a/C4/Search.pm (+6 lines)
Lines 1836-1841 sub searchResults { Link Here
1836
                    next;
1836
                    next;
1837
                }
1837
                }
1838
            }
1838
            }
1839
            if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
1840
                if ( $item->{homebranch} ne $userenv->{branch} ) {
1841
                    $items_count--;
1842
                    next;
1843
                }
1844
            }
1839
1845
1840
            my $hbranch     = C4::Context->preference('StaffSearchResultsDisplayBranch');
1846
            my $hbranch     = C4::Context->preference('StaffSearchResultsDisplayBranch');
1841
            my $otherbranch = $hbranch eq 'homebranch' ? 'holdingbranch' : 'homebranch';
1847
            my $otherbranch = $hbranch eq 'homebranch' ? 'holdingbranch' : 'homebranch';
(-)a/Koha/Template/Plugin/Branches.pm (-2 / +3 lines)
Lines 92-99 sub all { Link Here
92
}
92
}
93
93
94
sub InIndependentBranchesMode {
94
sub InIndependentBranchesMode {
95
    my ( $self ) = @_;
95
    my ( $self, $params ) = @_;
96
    return ( not C4::Context->preference("IndependentBranches") or C4::Context::IsSuperLibrarian );
96
    my $pref = $params->{syspref} || 'IndependentBranches';
97
    return ( C4::Context->preference($pref) and not C4::Context::IsSuperLibrarian );
97
}
98
}
98
99
99
sub pickup_locations {
100
sub pickup_locations {
(-)a/catalogue/MARCdetail.pl (+2 lines)
Lines 261-266 for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) { Link Here
261
# loop through each tag
261
# loop through each tag
262
# warning : we may have differents number of columns in each row. Thus, we first build a hash, complete it if necessary
262
# warning : we may have differents number of columns in each row. Thus, we first build a hash, complete it if necessary
263
# then construct template.
263
# then construct template.
264
my ($homebrtagf,$homebrtagsubf) = &GetMarcFromKohaField( "items.homebranch" );
264
my @fields = $record->fields();
265
my @fields = $record->fields();
265
my %witness
266
my %witness
266
  ; #---- stores the list of subfields used at least once, with the "meaning" of the code
267
  ; #---- stores the list of subfields used at least once, with the "meaning" of the code
Lines 298-303 foreach my $field (@fields) { Link Here
298
          if grep { $kohafield eq $_ }
299
          if grep { $kohafield eq $_ }
299
              qw( items.dateaccessioned items.onloan items.datelastseen items.datelastborrowed items.replacementpricedate );
300
              qw( items.dateaccessioned items.onloan items.datelastseen items.datelastborrowed items.replacementpricedate );
300
    }
301
    }
302
    next if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && $item && $item->{$homebrtagsubf} ne C4::Context->userenv->{'branchname'} );
301
    push @item_loop, $item if $item;
303
    push @item_loop, $item if $item;
302
}
304
}
303
305
(-)a/catalogue/export.pl (+13 lines)
Lines 40-45 if ($op eq "export") { Link Here
40
                }
40
                }
41
            }
41
            }
42
42
43
            if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
44
                my $mybranch = C4::Context->userenv->{branch};
45
                my ($homebrtagf,$homebrtagsubf) = &GetMarcFromKohaField( "items.homebranch" );
46
                my @fields = $marc->field($homebrtagf);
47
                my @delete;
48
                foreach my $field (@fields) {
49
                    if ( $field->subfield($homebrtagsubf) ne $mybranch ) {
50
                        push @delete, $field;
51
                    }
52
                }
53
                $marc->delete_fields(@delete) if ( @delete );
54
            }
55
43
            if ($format =~ /endnote/) {
56
            if ($format =~ /endnote/) {
44
                $marc = marc2endnote($marc);
57
                $marc = marc2endnote($marc);
45
                $format = 'endnote';
58
                $format = 'endnote';
(-)a/catalogue/issuehistory.pl (-2 / +6 lines)
Lines 42-56 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
42
42
43
my $biblionumber = $query->param('biblionumber');
43
my $biblionumber = $query->param('biblionumber');
44
44
45
my $issue_filter = { biblionumber => $biblionumber };
46
if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
47
    $issue_filter->{'item.homebranch'} = C4::Context->userenv->{branch};
48
}
45
my @checkouts = Koha::Checkouts->search(
49
my @checkouts = Koha::Checkouts->search(
46
    { biblionumber => $biblionumber },
50
    $issue_filter,
47
    {
51
    {
48
        join       => 'item',
52
        join       => 'item',
49
        order_by   => 'timestamp',
53
        order_by   => 'timestamp',
50
    }
54
    }
51
);
55
);
52
my @old_checkouts = Koha::Old::Checkouts->search(
56
my @old_checkouts = Koha::Old::Checkouts->search(
53
    { biblionumber => $biblionumber },
57
    $issue_filter,
54
    {
58
    {
55
        join       => 'item',
59
        join       => 'item',
56
        order_by   => 'timestamp',
60
        order_by   => 'timestamp',
(-)a/catalogue/itemsearch.pl (-1 / +12 lines)
Lines 114-122 if ( defined $format ) { Link Here
114
        filters => [],
114
        filters => [],
115
    };
115
    };
116
116
117
    # IndependentBranchesHideOtherBranchesItems forces homebranch filter
118
    #  if it isn't already set
119
    my $got_branch = 0;
117
    foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost withdrawn)) {
120
    foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost withdrawn)) {
118
        if (my @q = $cgi->multi_param($p)) {
121
        if (my @q = $cgi->multi_param($p)) {
119
            if ($q[0] ne '') {
122
            if ($q[0] ne '') {
123
                if ( $p eq 'homebranch' ) { $got_branch = 1; }
120
                my $f = {
124
                my $f = {
121
                    field => $p,
125
                    field => $p,
122
                    query => \@q,
126
                    query => \@q,
Lines 128-133 if ( defined $format ) { Link Here
128
            }
132
            }
129
        }
133
        }
130
    }
134
    }
135
    if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && ! $got_branch ) {
136
        push @{ $filter->{filters} }, { field => 'homebranch', query => [ C4::Context->userenv->{branch} ] };
137
    }
131
138
132
    my @c = $cgi->multi_param('c');
139
    my @c = $cgi->multi_param('c');
133
    my @fields = $cgi->multi_param('f');
140
    my @fields = $cgi->multi_param('f');
Lines 260-266 if ( defined $format ) { Link Here
260
267
261
# Display the search form
268
# Display the search form
262
269
263
my @branches = map { value => $_->branchcode, label => $_->branchname }, Koha::Libraries->search( {}, { order_by => 'branchname' } );
270
my $library_filter = {};
271
if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
272
    $library_filter->{'branchcode'} = C4::Context->userenv->{branch};
273
}
274
my @branches = map { value => $_->branchcode, label => $_->branchname }, Koha::Libraries->search( $library_filter, { order_by => 'branchname' } );
264
my @itemtypes;
275
my @itemtypes;
265
foreach my $itemtype ( Koha::ItemTypes->search ) {
276
foreach my $itemtype ( Koha::ItemTypes->search ) {
266
    push @itemtypes, {
277
    push @itemtypes, {
(-)a/catalogue/search.pl (+4 lines)
Lines 399-404 if ( $params->{'multibranchlimit'} ) { Link Here
399
    }
399
    }
400
}
400
}
401
401
402
if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && ! grep { /branch:/ } @limits ) {
403
    push @limits, 'branch: '. C4::Context->userenv->{branch};
404
}
405
402
for ( my $i=0; $i<@limits; $i++ ) {
406
for ( my $i=0; $i<@limits; $i++ ) {
403
    if ( $limits[$i] =~ /^branch:/ ) {
407
    if ( $limits[$i] =~ /^branch:/ ) {
404
        my $branchfield  = C4::Context->preference('SearchLimitLibrary');
408
        my $branchfield  = C4::Context->preference('SearchLimitLibrary');
(-)a/cataloguing/additem.pl (-1 / +6 lines)
Lines 873-878 foreach my $field (@fields) { Link Here
873
        }
873
        }
874
    }
874
    }
875
    if (%this_row) {
875
    if (%this_row) {
876
        next if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && $this_row{$branchtagsubfield} ne C4::Context->userenv->{branchname} );
876
        push(@big_array, \%this_row);
877
        push(@big_array, \%this_row);
877
    }
878
    }
878
}
879
}
Lines 933-939 my @loop_data =(); Link Here
933
my $i=0;
934
my $i=0;
934
935
935
my $branch = $input->param('branch') || C4::Context->userenv->{branch};
936
my $branch = $input->param('branch') || C4::Context->userenv->{branch};
936
my $libraries = Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed;# build once ahead of time, instead of multiple times later.
937
my $libraries_filter = {};
938
if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
939
    $libraries_filter->{branchcode} = C4::Context->userenv->{branch};
940
}
941
my $libraries = Koha::Libraries->search($libraries_filter, { order_by => ['branchname'] })->unblessed;# build once ahead of time, instead of multiple times later.
937
for my $library ( @$libraries ) {
942
for my $library ( @$libraries ) {
938
    $library->{selected} = 1 if $library->{branchcode} eq $branch
943
    $library->{selected} = 1 if $library->{branchcode} eq $branch
939
}
944
}
(-)a/circ/overdue.pl (+7 lines)
Lines 78-83 our $logged_in_user = Koha::Patrons->find( $loggedinuser ); Link Here
78
78
79
my $dbh = C4::Context->dbh;
79
my $dbh = C4::Context->dbh;
80
80
81
if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && (my $mybranch = C4::Context->userenv->{branch}) ) {
82
    $homebranchfilter = $mybranch;
83
    $holdingbranchfilter = '';
84
    $filters->{homebranch} = $mybranch;
85
    $filters->{holdingbranch} = $mybranch;
86
}
87
81
my $req;
88
my $req;
82
$req = $dbh->prepare( "select categorycode, description from categories order by description");
89
$req = $dbh->prepare( "select categorycode, description from categories order by description");
83
$req->execute;
90
$req->execute;
(-)a/installer/data/mysql/atomicupdate/bug_28642.perl (+5 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do( "INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('IndependentBranchesHideOtherBranchesItems','1','','Hide other branches in selects.  Hide items belonging to other branches in search results, holds, biblio and item details, and exports.','YesNo')" );
4
    NewVersion( $DBversion, 28642, "Add new systempreference IndependentBranchesHideOtherBranchesItems");
5
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc (+2 lines)
Lines 1-6 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE AuthorisedValues %]
2
[% USE AuthorisedValues %]
3
[% USE Languages %]
3
[% USE Languages %]
4
[% USE Branches %]
4
[% IF ( opacfacets ) %]
5
[% IF ( opacfacets ) %]
5
[% IF ( facets_loop ) %]
6
[% IF ( facets_loop ) %]
6
<div id="search-facets">
7
<div id="search-facets">
Lines 45-50 Link Here
45
  [% FOREACH facet IN facets_loo.facets %]
46
  [% FOREACH facet IN facets_loo.facets %]
46
  [% IF facets_loo.type_label_CollectionCodes %][% SET facet.facet_label_value = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => facet.facet_label_value ) || facet.facet_label_value %][% END %]
47
  [% IF facets_loo.type_label_CollectionCodes %][% SET facet.facet_label_value = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => facet.facet_label_value ) || facet.facet_label_value %][% END %]
47
  [% IF facets_loo.type_label_Language %][% SET facet.facet_label_value = Languages.GetByISOCode(lang,facet.facet_label_value) || facet.facet_label_value %][% END %]
48
  [% IF facets_loo.type_label_Language %][% SET facet.facet_label_value = Languages.GetByISOCode(lang,facet.facet_label_value) || facet.facet_label_value %][% END %]
49
  [% IF ( facets_loo.type_label_HomeLibrary && Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) && facet.facet_link_value != Branches.GetLoggedInBranchcode() ) %][% NEXT %][% END %]
48
  [% IF loop.count > 5 && !facet.active %]
50
  [% IF loop.count > 5 && !facet.active %]
49
    <li class="collapsible-facet" style="display:none">
51
    <li class="collapsible-facet" style="display:none">
50
  [% ELSE %]
52
  [% ELSE %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc (+4 lines)
Lines 52-58 Link Here
52
52
53
        <p>
53
        <p>
54
            <label for="branchcode">Library: </label>
54
            <label for="branchcode">Library: </label>
55
            [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
56
            [% SET branches = Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => branchcode_filter, only_from_group => 1 ) %]
57
            [% ELSE %]
55
            [% SET branches = Branches.all( selected => branchcode_filter, only_from_group => 1 ) %]
58
            [% SET branches = Branches.all( selected => branchcode_filter, only_from_group => 1 ) %]
59
            [% END %]
56
            <select name="branchcode_filter" id="branchcode">
60
            <select name="branchcode_filter" id="branchcode">
57
                [% IF branches.size != 1 %]
61
                [% IF branches.size != 1 %]
58
                  <option value="">Any</option>
62
                  <option value="">Any</option>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref (+7 lines)
Lines 116-121 Administration: Link Here
116
                  1: "Yes"
116
                  1: "Yes"
117
                  0: "No"
117
                  0: "No"
118
            - "<p class='text-danger'><strong>Warning:</strong> Changing this system preference will radically alter the behavior of Koha. Changing preference on a production system is highly discouraged.</p>"
118
            - "<p class='text-danger'><strong>Warning:</strong> Changing this system preference will radically alter the behavior of Koha. Changing preference on a production system is highly discouraged.</p>"
119
        -
120
            - "Prevent staff (but not superlibrarians) from selecting other libraries in dropdowns and seeing items belonging to other libraries: "
121
            - pref: IndependentBranchesHideOtherBranchesItems
122
              default: 0
123
              choices:
124
                  1: "Yes"
125
                  0: "No"
119
        -
126
        -
120
            - "Prevent staff (but not superlibrarians) from viewing and approving/denying patron modification requests for patrons belonging to other libraries: "
127
            - "Prevent staff (but not superlibrarians) from viewing and approving/denying patron modification requests for patrons belonging to other libraries: "
121
            - pref: IndependentBranchesPatronModifications
128
            - pref: IndependentBranchesPatronModifications
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt (+4 lines)
Lines 285-293 Link Here
285
285
286
<fieldset id="select-libs">
286
<fieldset id="select-libs">
287
        <p><label for="branchloop">Individual libraries:</label><select name="limit" id="branchloop">
287
        <p><label for="branchloop">Individual libraries:</label><select name="limit" id="branchloop">
288
        [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
289
        [% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, unfiltered => 1 ) %]
290
        [% ELSE %]
288
        <option value="">All libraries</option>
291
        <option value="">All libraries</option>
289
        [%# FIXME Should not we filter the libraries displayed? %]
292
        [%# FIXME Should not we filter the libraries displayed? %]
290
        [% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( selected => selected_branchcode, unfiltered => 1 ) %]
293
        [% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( selected => selected_branchcode, unfiltered => 1 ) %]
294
        [% END %]
291
        </select></p>
295
        </select></p>
292
    <!-- <input type="hidden" name="limit" value="branch: MAIN" /> -->
296
    <!-- <input type="hidden" name="limit" value="branch: MAIN" /> -->
293
        [% IF search_groups %]
297
        [% IF search_groups %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt (+3 lines)
Lines 2-7 Link Here
2
[% USE To %]
2
[% USE To %]
3
[% USE Asset %]
3
[% USE Asset %]
4
[% USE AuthorisedValues %]
4
[% USE AuthorisedValues %]
5
[% USE Branches %]
5
6
6
[%- BLOCK form_label -%]
7
[%- BLOCK form_label -%]
7
  [%- SWITCH label -%]
8
  [%- SWITCH label -%]
Lines 41-49 Link Here
41
      <option value="!=" >is not</option>
42
      <option value="!=" >is not</option>
42
    </select>
43
    </select>
43
    <select id="[% name | html %]" name="[% name | html %]" multiple="multiple" size="[% options.size < 4 ? options.size + 1 : 4 | html %]">
44
    <select id="[% name | html %]" name="[% name | html %]" multiple="multiple" size="[% options.size < 4 ? options.size + 1 : 4 | html %]">
45
      [% UNLESS ( name == 'homebranch' || name == 'holdingbranch' ) && Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
44
      <option value="" selected="selected">
46
      <option value="" selected="selected">
45
        [% IF (empty_option) %][% INCLUDE form_label label=empty_option %][% ELSE %]<span>All</span>[% END %]
47
        [% IF (empty_option) %][% INCLUDE form_label label=empty_option %][% ELSE %]<span>All</span>[% END %]
46
      </option>
48
      </option>
49
      [% END %]
47
      [% FOREACH option IN options %]
50
      [% FOREACH option IN options %]
48
        <option value="[% option.value | html %]">[% option.label | html %]</option>
51
        <option value="[% option.value | html %]">[% option.label | html %]</option>
49
      [% END %]
52
      [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt (+12 lines)
Lines 225-240 Link Here
225
    <li>
225
    <li>
226
        <label>Item home library:</label>
226
        <label>Item home library:</label>
227
        <select name="homebranch" id="homebranch">
227
        <select name="homebranch" id="homebranch">
228
            [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
229
            [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => filters.homebranch ) %]
230
	    [% ELSE %]
228
            <option value="">Any</option>
231
            <option value="">Any</option>
229
            [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.homebranch ) %]
232
            [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.homebranch ) %]
233
	    [% END %]
230
        </select>
234
        </select>
231
    </li>
235
    </li>
232
236
233
    <li>
237
    <li>
234
        <label>Item holding library:</label>
238
        <label>Item holding library:</label>
235
        <select name="holdingbranch" id="holdingbranch">
239
        <select name="holdingbranch" id="holdingbranch">
240
            [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
241
            [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => filters.holdingbranch ) %]
242
	    [% ELSE %]
236
            <option value="">Any</option>
243
            <option value="">Any</option>
237
            [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.holdingbranch ) %]
244
            [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.holdingbranch ) %]
245
	    [% END %]
238
        </select>
246
        </select>
239
    </li>
247
    </li>
240
248
Lines 242-248 Link Here
242
        <label>Library of the patron:</label>
250
        <label>Library of the patron:</label>
243
        <select name="branch" id="branch">
251
        <select name="branch" id="branch">
244
            <option value="">Any</option>
252
            <option value="">Any</option>
253
            [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
254
            [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => filters.branch, only_from_group => 1 ) %]
255
            [% ELSE %]
245
            [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.branch, only_from_group => 1 ) %]
256
            [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.branch, only_from_group => 1 ) %]
257
            [% END %]
246
        </select>
258
        </select>
247
    </li>
259
    </li>
248
260
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt (+4 lines)
Lines 206-213 Link Here
206
        <li>
206
        <li>
207
            <label for="branchlimit">Library: </label>
207
            <label for="branchlimit">Library: </label>
208
            <select name="branchlimit" id="branchlimit">
208
            <select name="branchlimit" id="branchlimit">
209
                [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
210
                [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, only_from_group => 1 ) %]
211
                [% ELSE %]
209
                <option value="">All</option>
212
                <option value="">All</option>
210
                [% PROCESS options_for_libraries libraries => Branches.all( only_from_group => 1 ) %]
213
                [% PROCESS options_for_libraries libraries => Branches.all( only_from_group => 1 ) %]
214
                [% END %]
211
            </select>
215
            </select>
212
        </li>
216
        </li>
213
    </ol></fieldset>
217
    </ol></fieldset>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt (+4 lines)
Lines 84-91 Link Here
84
                        <li>
84
                        <li>
85
                            <label for="club-template-branchcode">Library:</label>
85
                            <label for="club-template-branchcode">Library:</label>
86
                            <select name="branchcode" id="club-template-branchcode">
86
                            <select name="branchcode" id="club-template-branchcode">
87
                            [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
88
                                [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => club.branch.branchcode ) %]
89
                            [% ELSE %]
87
                                <option value=""></option>
90
                                <option value=""></option>
88
                                [% PROCESS options_for_libraries libraries => Branches.all( selected => club.branch.branchcode ) %]
91
                                [% PROCESS options_for_libraries libraries => Branches.all( selected => club.branch.branchcode ) %]
92
                            [% END %]
89
                            </select>
93
                            </select>
90
                        </li>
94
                        </li>
91
95
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt (+4 lines)
Lines 97-104 Link Here
97
                        <li>
97
                        <li>
98
                            <label for="club-template-branchcode">Library:</label>
98
                            <label for="club-template-branchcode">Library:</label>
99
                            <select name="branchcode" id="club-template-branchcode">
99
                            <select name="branchcode" id="club-template-branchcode">
100
                            [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
101
                                [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => club_template.branchcode ) %]
102
                            [% ELSE %]
100
                                <option value=""></option>
103
                                <option value=""></option>
101
                                [% PROCESS options_for_libraries libraries => Branches.all( selected => club_template.branchcode ) %]
104
                                [% PROCESS options_for_libraries libraries => Branches.all( selected => club_template.branchcode ) %]
105
                            [% END %]
102
                            </select>
106
                            </select>
103
                            <div class="hint">If set, only librarians logged in with this branch will be able to modify this club template.</div>
107
                            <div class="hint">If set, only librarians logged in with this branch will be able to modify this club template.</div>
104
                        </li>
108
                        </li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt (+4 lines)
Lines 191-197 Link Here
191
                      </li>
191
                      </li>
192
                      <li>
192
                      <li>
193
                        <label for="branchcode_filter">Library:</label>
193
                        <label for="branchcode_filter">Library:</label>
194
                        [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
195
                        [% SET branches = Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => branchcode_filter, only_from_group => 1 ) %]
196
                        [% ELSE %]
194
                        [% SET branches = Branches.all( selected => branchcode_filter, only_from_group => 1 ) %]
197
                        [% SET branches = Branches.all( selected => branchcode_filter, only_from_group => 1 ) %]
198
                        [% END %]
195
                        <select id="branchcode_filter">
199
                        <select id="branchcode_filter">
196
                          [% IF branches.size != 1 %]
200
                          [% IF branches.size != 1 %]
197
                            <option value="">Any</option>
201
                            <option value="">Any</option>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (+4 lines)
Lines 842-848 legend:hover { Link Here
842
                                            <li>
842
                                            <li>
843
                                                <label for="libraries" class="required">Library:</label>
843
                                                <label for="libraries" class="required">Library:</label>
844
                                                <select name="branchcode" id="libraries">
844
                                                <select name="branchcode" id="libraries">
845
                                                    [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
846
                                                    [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => userbranch, only_from_group => 1 ) %]
847
                                                    [% ELSE %]
845
                                                    [% PROCESS options_for_libraries libraries => Branches.all( selected => userbranch, only_from_group => 1 ) %]
848
                                                    [% PROCESS options_for_libraries libraries => Branches.all( selected => userbranch, only_from_group => 1 ) %]
849
                                                    [% END %]
846
                                                </select>
850
                                                </select>
847
                                                <span class="required">Required</span>
851
                                                <span class="required">Required</span>
848
                                            </li>
852
                                            </li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tt (+3 lines)
Lines 1-3 Link Here
1
[% USE Branches %]
1
[% SET footerjs = 1 %]
2
[% SET footerjs = 1 %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>[% IF ( do_it ) %]Acquisitions statistics &rsaquo; Results[% ELSE %]Acquisitions statistics[% END %] &rsaquo; Reports &rsaquo; Koha</title>
4
<title>[% IF ( do_it ) %]Acquisitions statistics &rsaquo; Results[% ELSE %]Acquisitions statistics[% END %] &rsaquo; Reports &rsaquo; Koha</title>
Lines 178-184 Link Here
178
                <td><input type="radio" name="Column" value="items.homebranch" /></td>
179
                <td><input type="radio" name="Column" value="items.homebranch" /></td>
179
                <td>
180
                <td>
180
                    <select name="Filter">
181
                    <select name="Filter">
182
                        [% UNLESS Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
181
                        <option value="" selected="selected">All libraries</option>
183
                        <option value="" selected="selected">All libraries</option>
184
                        [% END %]
182
                        [% FOREACH branch IN branches %]
185
                        [% FOREACH branch IN branches %]
183
                            <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
186
                            <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
184
                        [% END %]
187
                        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/bor_issues_top.tt (-2 / +9 lines)
Lines 125-134 Link Here
125
                    <span class="hint">[% INCLUDE 'date-format.inc' %]</span></li>
125
                    <span class="hint">[% INCLUDE 'date-format.inc' %]</span></li>
126
			<li> 
126
			<li> 
127
				<label for="branch">Library: </label>
127
				<label for="branch">Library: </label>
128
<select name="Filter" id="branch"><option value="" > Any library</option>
128
<select name="Filter" id="branch">
129
    [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
130
    [% FOREACH l IN Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, unfiltered => 1 ) %]
131
        <option value="[% l.branchcode | html %]" >[% l.branchname | html %] </option>
132
     [% END %]
133
    [% ELSE %]
134
        <option value="" > Any library</option>
129
    [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
135
    [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
130
        <option value="[% l.branchcode | html %]" >[% l.branchname | html %] </option>
136
        <option value="[% l.branchcode | html %]" >[% l.branchname | html %] </option>
131
     [% END %] 
137
     [% END %]
138
    [% END %]
132
    </select>			</li>
139
    </select>			</li>
133
			<li> 
140
			<li> 
134
                <label for="documenttype">Item type: </label><select name="Filter" id="documenttype"><option value="" > Any item type</option>
141
                <label for="documenttype">Item type: </label><select name="Filter" id="documenttype"><option value="" > Any item type</option>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/borrowers_stats.tt (+6 lines)
Lines 168-177 Link Here
168
			<td><input type="radio" name="Column" value="branchcode" /></td>
168
			<td><input type="radio" name="Column" value="branchcode" /></td>
169
			<td>
169
			<td>
170
                <select name="Filter" id="branch">
170
                <select name="Filter" id="branch">
171
                [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
172
                [% FOREACH l IN Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, unfiltered => 1 ) %]
173
                    <option value="[% l.branchcode | html %]">[% l.branchcode | html %] - [% l.branchname || 'UNKNOWN' | html %]</option>
174
                [% END %]
175
                [% ELSE %]
171
                <option value=""></option>
176
                <option value=""></option>
172
                [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
177
                [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
173
                    <option value="[% l.branchcode | html %]">[% l.branchcode | html %] - [% l.branchname || 'UNKNOWN' | html %]</option>
178
                    <option value="[% l.branchcode | html %]">[% l.branchcode | html %] - [% l.branchname || 'UNKNOWN' | html %]</option>
174
                [% END %]
179
                [% END %]
180
                [% END %]
175
                </select>
181
                </select>
176
			</td>
182
			</td>
177
			</tr>
183
			</tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt (+2 lines)
Lines 108-114 Link Here
108
                <li>
108
                <li>
109
                    <label>Transaction library</label>
109
                    <label>Transaction library</label>
110
                    <select name="branch" id="branch">
110
                    <select name="branch" id="branch">
111
                        [% UNLESS Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
111
                        <option value="ALL">All</option>
112
                        <option value="ALL">All</option>
113
                        [% END %]
112
                        [% FOREACH branchloo IN branchloop %]
114
                        [% FOREACH branchloo IN branchloop %]
113
                            [% IF ( branchloo.selected ) %]
115
                            [% IF ( branchloo.selected ) %]
114
                            <option value="[% branchloo.branchcode | html %]" selected="selected">[% branchloo.branchname | html %]</option>
116
                            <option value="[% branchloo.branchcode | html %]" selected="selected">[% branchloo.branchname | html %]</option>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cat_issues_top.tt (-1 / +6 lines)
Lines 103-110 Link Here
103
                    <span class="hint">[% INCLUDE 'date-format.inc' %]</span></li>
103
                    <span class="hint">[% INCLUDE 'date-format.inc' %]</span></li>
104
        <li>
104
        <li>
105
            <label for="branch">Library: </label>
105
            <label for="branch">Library: </label>
106
            <select name="Filter" id="branch"><option value="" > Any library</option>
106
            <select name="Filter" id="branch">
107
	    [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
108
                [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
109
	    [% ELSE %]
110
	        <option value="" > Any library</option>
107
                [% PROCESS options_for_libraries libraries => Branches.all() %]
111
                [% PROCESS options_for_libraries libraries => Branches.all() %]
112
            [% END %]
108
            </select>
113
            </select>
109
        </li>
114
        </li>
110
      <li> 
115
      <li> 
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_out.tt (+4 lines)
Lines 105-112 Link Here
105
		<ol>
105
		<ol>
106
			<li><label for="branch">Library: </label>
106
			<li><label for="branch">Library: </label>
107
	<select name="Filter" id="branch">
107
	<select name="Filter" id="branch">
108
	[% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
109
        [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
110
	[% ELSE %]
108
        <option value="">Any library</option>
111
        <option value="">Any library</option>
109
        [% PROCESS options_for_libraries libraries => Branches.all() %]
112
        [% PROCESS options_for_libraries libraries => Branches.all() %]
113
	[% END %]
110
    </select></li>
114
    </select></li>
111
      <li> 
115
      <li> 
112
        <label for="documenttype">Item type: </label><select name="Filter" id="documenttype">
116
        <label for="documenttype">Item type: </label><select name="Filter" id="documenttype">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt (+4 lines)
Lines 156-163 Link Here
156
                <td><input type="radio" checked="checked" name="Line" value="items.homebranch" /></td>
156
                <td><input type="radio" checked="checked" name="Line" value="items.homebranch" /></td>
157
				<td><input type="radio" name="Column" value="items.homebranch" /></td>
157
				<td><input type="radio" name="Column" value="items.homebranch" /></td>
158
				<td><select name="Filter" id="branch">
158
				<td><select name="Filter" id="branch">
159
                    [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
160
                    [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
161
                    [% ELSE %]
159
                    <option value=""> </option>
162
                    <option value=""> </option>
160
                    [% PROCESS options_for_libraries libraries => Branches.all() %]
163
                    [% PROCESS options_for_libraries libraries => Branches.all() %]
164
                    [% END %]
161
                    </select>
165
                    </select>
162
				</td>
166
				</td>
163
			</tr>
167
			</tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt (+4 lines)
Lines 173-180 Link Here
173
				<td><input type="radio" name="Column" value="branchcode" /></td>
173
				<td><input type="radio" name="Column" value="branchcode" /></td>
174
                <td>
174
                <td>
175
                    <select name="Filter" id="branch">
175
                    <select name="Filter" id="branch">
176
                    [% IF Branches.InIndependentBranchesMode({syspref=>''}) %]
177
                        [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
178
                    [% ELSE %]
176
                        <option value=""></option>
179
                        <option value=""></option>
177
                        [% PROCESS options_for_libraries libraries => Branches.all() %]
180
                        [% PROCESS options_for_libraries libraries => Branches.all() %]
181
                    [% END %]
178
                    </select>
182
                    </select>
179
                </td>
183
                </td>
180
			</tr>
184
			</tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tt (+12 lines)
Lines 203-210 Link Here
203
            <td><input type="radio" checked="checked" name="Line" value="branch" /></td>
203
            <td><input type="radio" checked="checked" name="Line" value="branch" /></td>
204
            <td><input type="radio" name="Column" value="branch" /></td>
204
            <td><input type="radio" name="Column" value="branch" /></td>
205
            <td><select name="Filter" id="branch">
205
            <td><select name="Filter" id="branch">
206
                [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
207
                [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
208
                [% ELSE %]
206
                <option value=""> </option>
209
                <option value=""> </option>
207
                [% PROCESS options_for_libraries libraries => Branches.all() %]
210
                [% PROCESS options_for_libraries libraries => Branches.all() %]
211
                [% END %]
208
               </select>
212
               </select>
209
             </td> 
213
             </td> 
210
        </tr>
214
        </tr>
Lines 268-275 Link Here
268
            <td><input type="radio" name="Line" value="items.homebranch" /></td>
272
            <td><input type="radio" name="Line" value="items.homebranch" /></td>
269
            <td><input type="radio" name="Column" value="items.homebranch" /></td>
273
            <td><input type="radio" name="Column" value="items.homebranch" /></td>
270
            <td><select name="Filter" id="homebranch">
274
            <td><select name="Filter" id="homebranch">
275
                    [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
276
                    [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
277
                    [% ELSE %]
271
                    <option value=""> </option>
278
                    <option value=""> </option>
272
                    [% PROCESS options_for_libraries libraries => Branches.all() %]
279
                    [% PROCESS options_for_libraries libraries => Branches.all() %]
280
                    [% END %]
273
                </select>
281
                </select>
274
            </td>
282
            </td>
275
        </tr>
283
        </tr>
Lines 278-285 Link Here
278
            <td><input type="radio" name="Line" value="items.holdingbranch" /></td>
286
            <td><input type="radio" name="Line" value="items.holdingbranch" /></td>
279
            <td><input type="radio" name="Column" value="items.holdingbranch" /></td>
287
            <td><input type="radio" name="Column" value="items.holdingbranch" /></td>
280
            <td><select name="Filter" id="holdingbranch">
288
            <td><select name="Filter" id="holdingbranch">
289
                    [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
290
                    [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
291
                    [% ELSE %]
281
                    <option value=""> </option>
292
                    <option value=""> </option>
282
                    [% PROCESS options_for_libraries libraries => Branches.all() %]
293
                    [% PROCESS options_for_libraries libraries => Branches.all() %]
294
                    [% END %]
283
                </select>
295
                </select>
284
            </td>
296
            </td>
285
        </tr>
297
        </tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt (+4 lines)
Lines 149-156 Link Here
149
149
150
	<li><label for="barcodefilter">Barcode: </label><input type="text" name="barcodefilter" id="barcodefilter" size="6" /></li>
150
	<li><label for="barcodefilter">Barcode: </label><input type="text" name="barcodefilter" id="barcodefilter" size="6" /></li>
151
	<li><label for="branchfilter">Library: </label><select name="branchfilter" id="branchfilter">
151
	<li><label for="branchfilter">Library: </label><select name="branchfilter" id="branchfilter">
152
            [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
153
                [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
154
            [% ELSE %]
152
                <option value="">All</option>
155
                <option value="">All</option>
153
                [% PROCESS options_for_libraries libraries => Branches.all() %]
156
                [% PROCESS options_for_libraries libraries => Branches.all() %]
157
            [% END %]
154
            </select></li>
158
            </select></li>
155
    <li><label for="itemtypesfilter">Item type: </label><select name="itemtypesfilter" id="itemtypesfilter">
159
    <li><label for="itemtypesfilter">Item type: </label><select name="itemtypesfilter" id="itemtypesfilter">
156
                <option value="">All</option>
160
                <option value="">All</option>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemtypes.tt (+6 lines)
Lines 81-90 Link Here
81
              <li>
81
              <li>
82
                <label for="value">Select a library:</label>
82
                <label for="value">Select a library:</label>
83
                <select name="value" id="value">
83
                <select name="value" id="value">
84
                [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
85
                  [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
86
                [% ELSE %]
84
                  <option value=""></option>
87
                  <option value=""></option>
85
                  [% PROCESS options_for_libraries libraries => Branches.all() %]
88
                  [% PROCESS options_for_libraries libraries => Branches.all() %]
89
                [% END %]
86
                </select>
90
                </select>
91
		[% UNLESS Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
87
                <span class="tip">Select none to see all libraries</span>
92
                <span class="tip">Select none to see all libraries</span>
93
		[% END %]
88
              </li>
94
              </li>
89
            </ol>
95
            </ol>
90
          </fieldset>
96
          </fieldset>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tt (+12 lines)
Lines 188-195 Link Here
188
            <td><input type="radio" name="Line" value="reserves.branchcode" checked="checked" /></td>
188
            <td><input type="radio" name="Line" value="reserves.branchcode" checked="checked" /></td>
189
            <td><input type="radio" name="Column" value="reserves.branchcode" /></td>
189
            <td><input type="radio" name="Column" value="reserves.branchcode" /></td>
190
            <td><select name="filter_reserves.branchcode" id="resbranchcode">
190
            <td><select name="filter_reserves.branchcode" id="resbranchcode">
191
               [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
192
                [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
193
               [% ELSE %]
191
               <option value=""> </option>
194
               <option value=""> </option>
192
                [% PROCESS options_for_libraries libraries => Branches.all() %]
195
                [% PROCESS options_for_libraries libraries => Branches.all() %]
196
               [% END %]
193
               </select>
197
               </select>
194
             </td> 
198
             </td> 
195
        </tr>
199
        </tr>
Lines 198-205 Link Here
198
            <td><input type="radio" name="Line" value="items.holdingbranch" /></td>
202
            <td><input type="radio" name="Line" value="items.holdingbranch" /></td>
199
            <td><input type="radio" name="Column" value="items.holdingbranch" /></td>
203
            <td><input type="radio" name="Column" value="items.holdingbranch" /></td>
200
            <td><select name="filter_items.holdingbranch" id="holdingbranch">
204
            <td><select name="filter_items.holdingbranch" id="holdingbranch">
205
               [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
206
                [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
207
               [% ELSE %]
201
               <option value=""> </option>
208
               <option value=""> </option>
202
                [% PROCESS options_for_libraries libraries => Branches.all() %]
209
                [% PROCESS options_for_libraries libraries => Branches.all() %]
210
               [% END %]
203
               </select>
211
               </select>
204
             </td> 
212
             </td> 
205
        </tr>
213
        </tr>
Lines 208-215 Link Here
208
            <td><input type="radio" name="Line" value="items.homebranch" /></td>
216
            <td><input type="radio" name="Line" value="items.homebranch" /></td>
209
            <td><input type="radio" name="Column" value="items.homebranch" /></td>
217
            <td><input type="radio" name="Column" value="items.homebranch" /></td>
210
            <td><select name="filter_items.homebranch" id="homebranch">
218
            <td><select name="filter_items.homebranch" id="homebranch">
219
               [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
220
                [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
221
               [% ELSE %]
211
                <option value=""> </option>
222
                <option value=""> </option>
212
                [% PROCESS options_for_libraries libraries => Branches.all() %]
223
                [% PROCESS options_for_libraries libraries => Branches.all() %]
224
               [% END %]
213
               </select>
225
               </select>
214
             </td> 
226
             </td> 
215
        </tr>
227
        </tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt (+4 lines)
Lines 95-102 Link Here
95
					Library:
95
					Library:
96
		    	</label>
96
		    	</label>
97
		    	<select name="branchcode"  id="branchcode">
97
		    	<select name="branchcode"  id="branchcode">
98
                [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
99
                [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
100
                [% ELSE %]
98
				<option value="">Any library</option>
101
				<option value="">Any library</option>
99
                [% PROCESS options_for_libraries libraries => Branches.all() %]
102
                [% PROCESS options_for_libraries libraries => Branches.all() %]
103
                [% END %]
100
		    	</select>
104
		    	</select>
101
105
102
		    </li>
106
		    </li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt (+4 lines)
Lines 47-54 Link Here
47
        [% IF can_change_library %]
47
        [% IF can_change_library %]
48
        <li><label for="branch">Library:</label>
48
        <li><label for="branch">Library:</label>
49
        <select id="branch" name="branch">
49
        <select id="branch" name="branch">
50
            [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
51
            [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => branch ) %]
52
            [% ELSE %]
50
            <option value="">All</option>
53
            <option value="">All</option>
51
            [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
54
            [% PROCESS options_for_libraries libraries => Branches.all( selected => branch ) %]
55
            [% END %]
52
        </select>
56
        </select>
53
        </li>
57
        </li>
54
        [% END %]
58
        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt (-1 / +9 lines)
Lines 149-155 fieldset.rows table { clear: none; margin: 0; } Link Here
149
                                <li>
149
                                <li>
150
                                    <label for="branchcode">Library:</label>
150
                                    <label for="branchcode">Library:</label>
151
                                    <select name="branchcode" id="branchcode">
151
                                    <select name="branchcode" id="branchcode">
152
                                        [% UNLESS ( Independentbranches ) %]
152
                                    [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
153
                                        [% IF CAN_user_serials_superserials %]
154
                                            [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => branchcode, unfiltered => 1 ) %]
155
                                        [% ELSE %]
156
                                            [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => branchcode ) %]
157
                                        [% END %]
158
                                    [% ELSE %]
159
                                        [% UNLESS ( Koha.Preference('Independentbranches') ) %]
153
                                            <option value="">None</option>
160
                                            <option value="">None</option>
154
                                        [% END %]
161
                                        [% END %]
155
                                        [% IF CAN_user_serials_superserials %]
162
                                        [% IF CAN_user_serials_superserials %]
Lines 157-162 fieldset.rows table { clear: none; margin: 0; } Link Here
157
                                        [% ELSE %]
164
                                        [% ELSE %]
158
                                            [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
165
                                            [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode ) %]
159
                                        [% END %]
166
                                        [% END %]
167
                                    [% END %]
160
                                    </select>
168
                                    </select>
161
                                </li>
169
                                </li>
162
                                <li>
170
                                <li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt (+8 lines)
Lines 579-586 Link Here
579
                        <li>
579
                        <li>
580
                            <label for="branchcode">Library:</label>
580
                            <label for="branchcode">Library:</label>
581
                            <select name="branchcode" id="branchcode">
581
                            <select name="branchcode" id="branchcode">
582
                            [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
583
                                [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => branchfilter || branchcode ) %]
584
                            [% ELSE %]
582
                                <option value="">Any</option>
585
                                <option value="">Any</option>
583
                                [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter || branchcode ) %]
586
                                [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter || branchcode ) %]
587
                            [% END %]
584
                            </select>
588
                            </select>
585
                        </li>
589
                        </li>
586
                        <li>
590
                        <li>
Lines 666-673 Link Here
666
            [% IF ( displayby != "branchcode" ) %]
670
            [% IF ( displayby != "branchcode" ) %]
667
                <label for="branchcode">Viewing suggestions for library:</label>
671
                <label for="branchcode">Viewing suggestions for library:</label>
668
                <select name="branchcode" id="branchcode">
672
                <select name="branchcode" id="branchcode">
673
                [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
674
                    [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => branchfilter || branchcode ) %]
675
                [% ELSE %]
669
                    <option value="__ANY__">Any</option>
676
                    <option value="__ANY__">Any</option>
670
                    [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter || branchcode ) %]
677
                    [% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter || branchcode ) %]
678
                [% END %]
671
                </select>
679
                </select>
672
            [% END %]
680
            [% END %]
673
681
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt (+4 lines)
Lines 137-143 Link Here
137
        </li>
137
        </li>
138
        <li>
138
        <li>
139
        <label for="strip_items_not_from_libraries">Remove items not owned by selected libraries:</label>
139
        <label for="strip_items_not_from_libraries">Remove items not owned by selected libraries:</label>
140
	[% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
141
        <input id="strip_items_not_from_libraries" type="checkbox" name="strip_items_not_from_libraries" checked="checked" />
142
	[% ELSE %]
140
        <input id="strip_items_not_from_libraries" type="checkbox" name="strip_items_not_from_libraries" />
143
        <input id="strip_items_not_from_libraries" type="checkbox" name="strip_items_not_from_libraries" />
144
	[% END %]
141
        </li>
145
        </li>
142
        <li>
146
        <li>
143
        <label for="export_remove_fields">Don't export fields:</label>
147
        <label for="export_remove_fields">Don't export fields:</label>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt (+6 lines)
Lines 253-262 Link Here
253
                        <li>
253
                        <li>
254
                            <label class="description" for="branchcode">[% borrower_field.description | html %]: </label>
254
                            <label class="description" for="branchcode">[% borrower_field.description | html %]: </label>
255
                            <select id="branchcode" name="branchcode">
255
                            <select id="branchcode" name="branchcode">
256
                            [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
257
                                [% FOREACH library IN Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
258
                                    <option value="[% library.branchcode | html %]">[% library.branchname | html %]</option>
259
                                [% END %]
260
                            [% ELSE %]
256
                                <option value="" selected="selected"></option>
261
                                <option value="" selected="selected"></option>
257
                                [% FOREACH library IN Branches.all() %]
262
                                [% FOREACH library IN Branches.all() %]
258
                                    <option value="[% library.branchcode | html %]">[% library.branchname | html %]</option>
263
                                    <option value="[% library.branchcode | html %]">[% library.branchname | html %]</option>
259
                                [% END %]
264
                                [% END %]
265
                            [% END %]
260
                            </select>
266
                            </select>
261
                            <span class="field_hint">[% borrower_field.field | html %]</span>
267
                            <span class="field_hint">[% borrower_field.field | html %]</span>
262
                        </li>
268
                        </li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt (+4 lines)
Lines 98-105 Link Here
98
            <input type="radio" name="branch" value="holdingbranch"> Current library</input>
98
            <input type="radio" name="branch" value="holdingbranch"> Current library</input>
99
        </li><li>
99
        </li><li>
100
        <label for="branchloop">Library: </label><select id="branchloop" name="branchcode" style="width:12em;">
100
        <label for="branchloop">Library: </label><select id="branchloop" name="branchcode" style="width:12em;">
101
        [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
102
            [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => branchcode, unfiltered => 1, ) %]
103
        [% ELSE %]
101
            <option value="">All libraries</option>
104
            <option value="">All libraries</option>
102
            [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
105
            [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
106
        [% END %]
103
        </select>
107
        </select>
104
        </li>
108
        </li>
105
        [% IF (authorised_values) %]
109
        [% IF (authorised_values) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt (+8 lines)
Lines 98-109 Link Here
98
            <li>
98
            <li>
99
                <label for="branch">Library: </label>
99
                <label for="branch">Library: </label>
100
                <select id="branch" name="branch">
100
                <select id="branch" name="branch">
101
                [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
102
                    [% PROCESS options_for_libraries libraries => Branches.all(  search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => new_detail.branchcode, unfiltered => 1, ) %]
103
                [% ELSE %]
101
                    [% IF ( new_detail.branchcode == '' ) %]
104
                    [% IF ( new_detail.branchcode == '' ) %]
102
                        <option value="" selected="selected">All libraries</option>
105
                        <option value="" selected="selected">All libraries</option>
103
                    [% ELSE %]
106
                    [% ELSE %]
104
                        <option value=""         >All libraries</option>
107
                        <option value=""         >All libraries</option>
105
                    [% END %]
108
                    [% END %]
106
                    [% PROCESS options_for_libraries libraries => Branches.all( selected => new_detail.branchcode, unfiltered => 1, ) %]
109
                    [% PROCESS options_for_libraries libraries => Branches.all( selected => new_detail.branchcode, unfiltered => 1, ) %]
110
                [% END %]
107
                </select>
111
                </select>
108
            </li>
112
            </li>
109
            <li>
113
            <li>
Lines 263-271 Link Here
263
                                        <li>
267
                                        <li>
264
                                            <label for="news_library">Library: </label>
268
                                            <label for="news_library">Library: </label>
265
                                            <select id="news_library" name="news_library">
269
                                            <select id="news_library" name="news_library">
270
                                            [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
271
                                                [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => branchcode, unfiltered => 1, ) %]
272
                                            [% ELSE %]
266
                                                <option value=""></option>
273
                                                <option value=""></option>
267
                                                <option value="">All libraries</option>
274
                                                <option value="">All libraries</option>
268
                                                [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
275
                                                [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
276
                                            [% END %]
269
                                            </select>
277
                                            </select>
270
                                        </li>
278
                                        </li>
271
                                        <li>
279
                                        <li>
(-)a/reports/acquisitions_stats.pl (-1 / +5 lines)
Lines 182-188 else { Link Here
182
182
183
    my $CGIsepChoice = GetDelimiterChoices;
183
    my $CGIsepChoice = GetDelimiterChoices;
184
184
185
    my @branches = Koha::Libraries->search({}, { order_by => 'branchname' });
185
    my $libraries_filter = {};
186
    if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
187
        $libraries_filter->{branchcode} = C4::Context->userenv->{branch};
188
    }
189
    my @branches = Koha::Libraries->search($libraries_filter, { order_by => 'branchname' });
186
190
187
    my $ccode_subfield_structure = GetMarcSubfieldStructureFromKohaField('items.ccode');
191
    my $ccode_subfield_structure = GetMarcSubfieldStructureFromKohaField('items.ccode');
188
    my $ccode_label;
192
    my $ccode_label;
(-)a/reports/cash_register_stats.pl (-1 / +5 lines)
Lines 192-202 if ($do_it) { Link Here
192
192
193
}
193
}
194
194
195
my $libraries_filter = {};
196
if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
197
    $libraries_filter->{branchcode} = C4::Context->userenv->{branch};
198
}
195
$template->param(
199
$template->param(
196
    beginDate        => $fromDate,
200
    beginDate        => $fromDate,
197
    endDate          => $toDate,
201
    endDate          => $toDate,
198
    transaction_type => $transaction_type,
202
    transaction_type => $transaction_type,
199
    branchloop       => Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed,
203
    branchloop       => Koha::Libraries->search($libraries_filter, { order_by => ['branchname'] })->unblessed,
200
    debit_types      => \@debit_types,
204
    debit_types      => \@debit_types,
201
    credit_types     => \@credit_types,
205
    credit_types     => \@credit_types,
202
    registerid       => $registerid,
206
    registerid       => $registerid,
(-)a/reserve/request.pl (+4 lines)
Lines 559-564 foreach my $biblionumber (@biblionumbers) { Link Here
559
                    unless ( C4::Context->IsSuperLibrarian ) {
559
                    unless ( C4::Context->IsSuperLibrarian ) {
560
                        $item->{cantreserve} = 1 if ( $item->{homebranch} ne $userenv->{branch} );
560
                        $item->{cantreserve} = 1 if ( $item->{homebranch} ne $userenv->{branch} );
561
                    }
561
                    }
562
                    if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && $item->{homebranch} ne $userenv->{branch} ) {
563
                        $item->{hide} = 1;
564
                        $hiddencount++;
565
                    }
562
                }
566
                }
563
            }
567
            }
564
568
(-)a/reviews/reviewswaiting.pl (-2 / +7 lines)
Lines 41-47 my $status = $query->param('status') || 0; Link Here
41
my $reviewid = $query->param('reviewid');
41
my $reviewid = $query->param('reviewid');
42
my $page     = $query->param('page') || 1;
42
my $page     = $query->param('page') || 1;
43
my $count    = C4::Context->preference('numSearchResults') || 20;
43
my $count    = C4::Context->preference('numSearchResults') || 20;
44
my $total    = Koha::Reviews->search_limited({ approved => $status })->count;
44
my $review_filter = { approved => $status };
45
if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
46
    # search_limited supplies the borrowernumber relation
47
    $review_filter->{'borrowernumber.branchcode'} = C4::Context->userenv->{branch};
48
}
49
my $total    = Koha::Reviews->search_limited($review_filter)->count;
45
50
46
if ( $op eq 'approve' ) {
51
if ( $op eq 'approve' ) {
47
    my $review = Koha::Reviews->find( $reviewid );
52
    my $review = Koha::Reviews->find( $reviewid );
Lines 57-63 elsif ( $op eq 'delete' ) { Link Here
57
}
62
}
58
63
59
my $reviews = Koha::Reviews->search_limited(
64
my $reviews = Koha::Reviews->search_limited(
60
    { approved => $status },
65
    $review_filter,
61
    {
66
    {
62
        rows => $count,
67
        rows => $count,
63
        page => $page,
68
        page => $page,
(-)a/tools/batchMod.pl (-1 / +5 lines)
Lines 398-404 my @loop_data =(); Link Here
398
my $i=0;
398
my $i=0;
399
my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
399
my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
400
400
401
my $libraries = Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed;# build once ahead of time, instead of multiple times later.
401
my $libraries_filter = {};
402
if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
403
    $libraries_filter->{branchcode} = C4::Context->userenv->{branch};
404
}
405
my $libraries = Koha::Libraries->search($libraries_filter, { order_by => ['branchname'] })->unblessed;# build once ahead of time, instead of multiple times later.
402
406
403
# Adding a default choice, in case the user does not want to modify the branch
407
# Adding a default choice, in case the user does not want to modify the branch
404
my $nochange_branch = { branchname => '', value => '', selected => 1 };
408
my $nochange_branch = { branchname => '', value => '', selected => 1 };
(-)a/tools/export.pl (-1 / +9 lines)
Lines 71-76 my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( Link Here
71
);
71
);
72
72
73
my @branch = $query->multi_param("branch");
73
my @branch = $query->multi_param("branch");
74
if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
75
    @branch = (C4::Context->userenv->{branch});
76
}
74
77
75
my @messages;
78
my @messages;
76
if ( $op eq 'export' ) {
79
if ( $op eq 'export' ) {
Lines 91-96 if ( $op eq "export" ) { Link Here
91
    my @biblionumbers      = $query->multi_param("biblionumbers");
94
    my @biblionumbers      = $query->multi_param("biblionumbers");
92
    my @itemnumbers        = $query->multi_param("itemnumbers");
95
    my @itemnumbers        = $query->multi_param("itemnumbers");
93
    my $strip_items_not_from_libraries =  $query->param('strip_items_not_from_libraries');
96
    my $strip_items_not_from_libraries =  $query->param('strip_items_not_from_libraries');
97
    $strip_items_not_from_libraries = 1 if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') );
94
98
95
    my $libraries = Koha::Libraries->search_filtered->unblessed;
99
    my $libraries = Koha::Libraries->search_filtered->unblessed;
96
    my $only_export_items_for_branches = $strip_items_not_from_libraries ? \@branch : undef;
100
    my $only_export_items_for_branches = $strip_items_not_from_libraries ? \@branch : undef;
Lines 271-277 else { Link Here
271
275
272
    my $authority_types = Koha::Authority::Types->search( {}, { order_by => ['authtypecode'] } );
276
    my $authority_types = Koha::Authority::Types->search( {}, { order_by => ['authtypecode'] } );
273
277
274
    my $libraries = Koha::Libraries->search_filtered({}, { order_by => ['branchname'] })->unblessed;
278
    my $library_filter = {};
279
    if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
280
        $library_filter->{'branchcode'} = C4::Context->userenv->{branch};
281
    }
282
    my $libraries = Koha::Libraries->search_filtered($library_filter, { order_by => ['branchname'] })->unblessed;
275
    for my $library ( @$libraries ) {
283
    for my $library ( @$libraries ) {
276
        $library->{selected} = 1 if grep { $library->{branchcode} eq $_ } @branch;
284
        $library->{selected} = 1 if grep { $library->{branchcode} eq $_ } @branch;
277
    }
285
    }
(-)a/tools/modborrowers.pl (-2 / +5 lines)
Lines 152-158 if ( $op eq 'show' ) { Link Here
152
        if @notfoundcardnumbers;
152
        if @notfoundcardnumbers;
153
153
154
    # Construct drop-down list values
154
    # Construct drop-down list values
155
    my $branches = Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed;
155
    my $library_filter = {};
156
    if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
157
        $library_filter->{'branchcode'} = C4::Context->userenv->{branch};
158
    }
159
    my $branches = Koha::Libraries->search($library_filter, { order_by => ['branchname'] })->unblessed;
156
    my @branches_option;
160
    my @branches_option;
157
    push @branches_option, { value => $_->{branchcode}, lib => $_->{branchname} } for @$branches;
161
    push @branches_option, { value => $_->{branchcode}, lib => $_->{branchname} } for @$branches;
158
    unshift @branches_option, { value => "", lib => "" };
162
    unshift @branches_option, { value => "", lib => "" };
159
- 

Return to bug 28642