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

(-)a/C4/Context.pm (-1 / +3 lines)
Lines 900-907 sub mybranch { Link Here
900
=cut
900
=cut
901
901
902
sub only_my_library {
902
sub only_my_library {
903
    my ( $class, $pref ) = @_;
904
    $pref //= 'IndependentBranches';
903
    return
905
    return
904
         C4::Context->preference('IndependentBranches')
906
         C4::Context->preference($pref)
905
      && C4::Context->userenv
907
      && C4::Context->userenv
906
      && !C4::Context->IsSuperLibrarian()
908
      && !C4::Context->IsSuperLibrarian()
907
      && C4::Context->userenv->{branch};
909
      && C4::Context->userenv->{branch};
(-)a/C4/Items.pm (-1 / +8 lines)
Lines 773-778 sub GetItemsInfo { Link Here
773
    my $userenv = C4::Context->userenv;
773
    my $userenv = C4::Context->userenv;
774
    my $want_not_same_branch = C4::Context->preference("IndependentBranches") && !C4::Context->IsSuperLibrarian();
774
    my $want_not_same_branch = C4::Context->preference("IndependentBranches") && !C4::Context->IsSuperLibrarian();
775
    while ( my $data = $sth->fetchrow_hashref ) {
775
    while ( my $data = $sth->fetchrow_hashref ) {
776
        next if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && $data->{homebranch} ne $userenv->{branch} );
777
776
        if ( $data->{borrowernumber} && $want_not_same_branch) {
778
        if ( $data->{borrowernumber} && $want_not_same_branch) {
777
            $data->{'NOTSAMEBRANCH'} = $data->{'bcode'} ne $userenv->{branch};
779
            $data->{'NOTSAMEBRANCH'} = $data->{'bcode'} ne $userenv->{branch};
778
        }
780
        }
Lines 870-876 sub GetItemsLocationInfo { Link Here
870
			    location, itemcallnumber, cn_sort
872
			    location, itemcallnumber, cn_sort
871
		     FROM items, branches as a, branches as b
873
		     FROM items, branches as a, branches as b
872
		     WHERE homebranch = a.branchcode AND holdingbranch = b.branchcode 
874
		     WHERE homebranch = a.branchcode AND holdingbranch = b.branchcode 
873
		     AND biblionumber = ?
875
		     AND biblionumber = ?";
876
    if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') &&( my $mybranch = C4::Context->userenv->{branch} ) ) {
877
        $query .= "
878
             AND homebranch = '$mybranch'";
879
    }
880
    $query .= "
874
		     ORDER BY cn_sort ASC";
881
		     ORDER BY cn_sort ASC";
875
	my $sth = $dbh->prepare($query);
882
	my $sth = $dbh->prepare($query);
876
        $sth->execute($biblionumber);
883
        $sth->execute($biblionumber);
(-)a/C4/Search.pm (+6 lines)
Lines 1818-1823 sub searchResults { Link Here
1818
                    next;
1818
                    next;
1819
                }
1819
                }
1820
            }
1820
            }
1821
            if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
1822
                if ( $item->{homebranch} ne $userenv->{branch} ) {
1823
                    $items_count--;
1824
                    next;
1825
                }
1826
            }
1821
1827
1822
            my $hbranch     = C4::Context->preference('StaffSearchResultsDisplayBranch');
1828
            my $hbranch     = C4::Context->preference('StaffSearchResultsDisplayBranch');
1823
            my $otherbranch = $hbranch eq 'homebranch' ? 'holdingbranch' : 'homebranch';
1829
            my $otherbranch = $hbranch eq 'homebranch' ? 'holdingbranch' : 'homebranch';
(-)a/C4/XSLT.pm (+4 lines)
Lines 337-342 sub buildKohaItemsNamespace { Link Here
337
        $items_rs = Koha::Items->new;
337
        $items_rs = Koha::Items->new;
338
    }
338
    }
339
339
340
    if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
341
        $query->{'me.homebranch'} = C4::Context->userenv->{branch};
342
    }
343
340
    my $items = $items_rs->search( $query, { prefetch => [ 'branchtransfers', 'reserves' ] } );
344
    my $items = $items_rs->search( $query, { prefetch => [ 'branchtransfers', 'reserves' ] } );
341
345
342
    my $shelflocations =
346
    my $shelflocations =
(-)a/Koha/Template/Plugin/Branches.pm (-2 / +3 lines)
Lines 103-110 sub all { Link Here
103
}
103
}
104
104
105
sub InIndependentBranchesMode {
105
sub InIndependentBranchesMode {
106
    my ( $self ) = @_;
106
    my ( $self, $params ) = @_;
107
    return ( not C4::Context->preference("IndependentBranches") or C4::Context::IsSuperLibrarian );
107
    my $pref = $params->{syspref} || 'IndependentBranches';
108
    return ( C4::Context->preference($pref) and not C4::Context::IsSuperLibrarian );
108
}
109
}
109
110
110
sub pickup_locations {
111
sub pickup_locations {
(-)a/Koha/UI/Form/Builder/Item.pm (-1 / +5 lines)
Lines 470-477 sub edit_form { Link Here
470
    my $branch_limit = $params->{branch_limit};
470
    my $branch_limit = $params->{branch_limit};
471
    my $default_branches_empty = $params->{default_branches_empty};
471
    my $default_branches_empty = $params->{default_branches_empty};
472
472
473
    my $libraries_filter = {};
474
    if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
475
        $libraries_filter->{branchcode} = C4::Context->userenv->{branch};
476
    }
473
    my $libraries =
477
    my $libraries =
474
      Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed;
478
      Koha::Libraries->search( $libraries_filter, { order_by => ['branchname'] } )->unblessed;
475
    for my $library (@$libraries) {
479
    for my $library (@$libraries) {
476
        $library->{selected} = 1 if $branchcode && $library->{branchcode} eq $branchcode;
480
        $library->{selected} = 1 if $branchcode && $library->{branchcode} eq $branchcode;
477
    }
481
    }
(-)a/catalogue/MARCdetail.pl (+2 lines)
Lines 265-270 for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) { Link Here
265
# loop through each tag
265
# loop through each tag
266
# warning : we may have differents number of columns in each row. Thus, we first build a hash, complete it if necessary
266
# warning : we may have differents number of columns in each row. Thus, we first build a hash, complete it if necessary
267
# then construct template.
267
# then construct template.
268
my ($homebrtagf,$homebrtagsubf) = &GetMarcFromKohaField( "items.homebranch" );
268
my @fields = $record->fields();
269
my @fields = $record->fields();
269
my %witness
270
my %witness
270
  ; #---- stores the list of subfields used at least once, with the "meaning" of the code
271
  ; #---- stores the list of subfields used at least once, with the "meaning" of the code
Lines 302-307 foreach my $field (@fields) { Link Here
302
          if grep { $kohafield eq $_ }
303
          if grep { $kohafield eq $_ }
303
              qw( items.dateaccessioned items.onloan items.datelastseen items.datelastborrowed items.replacementpricedate );
304
              qw( items.dateaccessioned items.onloan items.datelastseen items.datelastborrowed items.replacementpricedate );
304
    }
305
    }
306
    next if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && $item && $item->{$homebrtagsubf} ne C4::Context->userenv->{'branchname'} );
305
    push @item_loop, $item if $item;
307
    push @item_loop, $item if $item;
306
}
308
}
307
309
(-)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 41-55 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
41
41
42
my $biblionumber = $query->param('biblionumber');
42
my $biblionumber = $query->param('biblionumber');
43
43
44
my $issue_filter = { biblionumber => $biblionumber };
45
if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
46
    $issue_filter->{'item.homebranch'} = C4::Context->userenv->{branch};
47
}
44
my @checkouts = Koha::Checkouts->search(
48
my @checkouts = Koha::Checkouts->search(
45
    { biblionumber => $biblionumber },
49
    $issue_filter,
46
    {
50
    {
47
        join       => 'item',
51
        join       => 'item',
48
        order_by   => 'timestamp',
52
        order_by   => 'timestamp',
49
    }
53
    }
50
)->as_list;
54
)->as_list;
51
my @old_checkouts = Koha::Old::Checkouts->search(
55
my @old_checkouts = Koha::Old::Checkouts->search(
52
    { biblionumber => $biblionumber },
56
    $issue_filter,
53
    {
57
    {
54
        join       => 'item',
58
        join       => 'item',
55
        order_by   => 'timestamp',
59
        order_by   => 'timestamp',
(-)a/catalogue/itemsearch.pl (-1 / +12 lines)
Lines 113-121 if ( defined $format ) { Link Here
113
        filters => [],
113
        filters => [],
114
    };
114
    };
115
115
116
    # IndependentBranchesHideOtherBranchesItems forces homebranch filter
117
    #  if it isn't already set
118
    my $got_branch = 0;
116
    foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost withdrawn)) {
119
    foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost withdrawn)) {
117
        if (my @q = $cgi->multi_param($p)) {
120
        if (my @q = $cgi->multi_param($p)) {
118
            if ($q[0] ne '') {
121
            if ($q[0] ne '') {
122
                if ( $p eq 'homebranch' ) { $got_branch = 1; }
119
                my $f = {
123
                my $f = {
120
                    field => $p,
124
                    field => $p,
121
                    query => \@q,
125
                    query => \@q,
Lines 127-132 if ( defined $format ) { Link Here
127
            }
131
            }
128
        }
132
        }
129
    }
133
    }
134
    if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && ! $got_branch ) {
135
        push @{ $filter->{filters} }, { field => 'homebranch', query => [ C4::Context->userenv->{branch} ] };
136
    }
130
137
131
    my @c = $cgi->multi_param('c');
138
    my @c = $cgi->multi_param('c');
132
    my @fields = $cgi->multi_param('f');
139
    my @fields = $cgi->multi_param('f');
Lines 276-282 if ( defined $format ) { Link Here
276
283
277
# Display the search form
284
# Display the search form
278
285
279
my @branches = map { value => $_->branchcode, label => $_->branchname }, Koha::Libraries->search( {}, { order_by => 'branchname' } )->as_list;
286
my $library_filter = {};
287
if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
288
    $library_filter->{'branchcode'} = C4::Context->userenv->{branch};
289
}
290
my @branches = map { value => $_->branchcode, label => $_->branchname }, Koha::Libraries->search( $library_filter, { order_by => 'branchname' } )->as_list;
280
my @itemtypes = map { value => $_->itemtype, label => $_->translated_description }, Koha::ItemTypes->search_with_localization->as_list;
291
my @itemtypes = map { value => $_->itemtype, label => $_->translated_description }, Koha::ItemTypes->search_with_localization->as_list;
281
292
282
my @ccodes = Koha::AuthorisedValues->get_descriptions_by_koha_field({ kohafield => 'items.ccode' });
293
my @ccodes = Koha::AuthorisedValues->get_descriptions_by_koha_field({ kohafield => 'items.ccode' });
(-)a/catalogue/search.pl (+3 lines)
Lines 173-178 my @limits = map uri_unescape($_), $cgi->multi_param("limit"); Link Here
173
my @nolimits = map uri_unescape($_), $cgi->multi_param('nolimit');
173
my @nolimits = map uri_unescape($_), $cgi->multi_param('nolimit');
174
my %is_nolimit = map { $_ => 1 } @nolimits;
174
my %is_nolimit = map { $_ => 1 } @nolimits;
175
@limits = grep { not $is_nolimit{$_} } @limits;
175
@limits = grep { not $is_nolimit{$_} } @limits;
176
if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && ! grep { /^(multi|home|holding)?branch/ } @limits ) {
177
    push @limits, 'homebranch: '. C4::Context->userenv->{branch};
178
}
176
if  (
179
if  (
177
        !$cgi->param('edit_search') &&
180
        !$cgi->param('edit_search') &&
178
        ( (@limits>=1) || (defined $cgi->param("q") && $cgi->param("q") ne "" ) || ($cgi->param('limit-yr')) )
181
        ( (@limits>=1) || (defined $cgi->param("q") && $cgi->param("q") ne "" ) || ($cgi->param('limit-yr')) )
(-)a/cataloguing/additem.pl (+1 lines)
Lines 509-514 if ($op) { Link Here
509
509
510
my @items;
510
my @items;
511
for my $item ( $biblio->items->as_list, $biblio->host_items->as_list ) {
511
for my $item ( $biblio->items->as_list, $biblio->host_items->as_list ) {
512
    next if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && $item->homebranch ne C4::Context->userenv->{branch} );
512
    push @items, $item->columns_to_str;
513
    push @items, $item->columns_to_str;
513
}
514
}
514
515
(-)a/circ/overdue.pl (+7 lines)
Lines 80-85 our $logged_in_user = Koha::Patrons->find( $loggedinuser ); Link Here
80
80
81
my $dbh = C4::Context->dbh;
81
my $dbh = C4::Context->dbh;
82
82
83
if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && (my $mybranch = C4::Context->userenv->{branch}) ) {
84
    $homebranchfilter = $mybranch;
85
    $holdingbranchfilter = '';
86
    $filters->{homebranch} = $mybranch;
87
    $filters->{holdingbranch} = $mybranch;
88
}
89
83
my $req;
90
my $req;
84
$req = $dbh->prepare( "select categorycode, description from categories order by description");
91
$req = $dbh->prepare( "select categorycode, description from categories order by description");
85
$req->execute;
92
$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','0','','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/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 270-275 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
270
('IncludeSeeFromInSearches','0','','Include see-from references in searches.','YesNo'),
270
('IncludeSeeFromInSearches','0','','Include see-from references in searches.','YesNo'),
271
('IndependentBranches','0',NULL,'If ON, increases security between libraries','YesNo'),
271
('IndependentBranches','0',NULL,'If ON, increases security between libraries','YesNo'),
272
('IndependentBranchesPatronModifications','0', NULL, 'Show only modification request for the logged in branch','YesNo'),
272
('IndependentBranchesPatronModifications','0', NULL, 'Show only modification request for the logged in branch','YesNo'),
273
('IndependentBranchesHideOtherBranchesItems','0',NULL,'Hide other branches in selects.  Hide items belonging to other branches in search results, holds, biblio and item details, and exports.','YesNo'),
273
('IndependentBranchesTransfers','0', NULL, 'Allow non-superlibrarians to transfer items between libraries','YesNo'),
274
('IndependentBranchesTransfers','0', NULL, 'Allow non-superlibrarians to transfer items between libraries','YesNo'),
274
('IntranetCatalogSearchPulldown','0', NULL, 'Show a search field pulldown for \"Search the catalog\" boxes','YesNo'),
275
('IntranetCatalogSearchPulldown','0', NULL, 'Show a search field pulldown for \"Search the catalog\" boxes','YesNo'),
275
('RecordedBooksClientSecret','','30','Client key for RecordedBooks integration','Free'),
276
('RecordedBooksClientSecret','','30','Client key for RecordedBooks integration','Free'),
(-)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 36-41 Link Here
36
  [% FOREACH facet IN facets_loo.facets %]
37
  [% FOREACH facet IN facets_loo.facets %]
37
  [% 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 %]
38
  [% 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 %]
38
  [% IF facets_loo.type_label_Language %][% SET facet.facet_label_value = Languages.GetByISOCode(lang,facet.facet_label_value) || facet.facet_label_value %][% END %]
39
  [% IF facets_loo.type_label_Language %][% SET facet.facet_label_value = Languages.GetByISOCode(lang,facet.facet_label_value) || facet.facet_label_value %][% END %]
40
  [% IF ( ( facets_loo.type_label_HomeLibrary || facets_loo.type_label_HoldingLibrary ) && Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) && facet.facet_link_value != Branches.GetLoggedInBranchcode() ) %][% NEXT %][% END %]
39
  [% IF loop.count > 5 && !facet.active %]
41
  [% IF loop.count > 5 && !facet.active %]
40
    <li class="collapsible-facet" style="display:none">
42
    <li class="collapsible-facet" style="display:none">
41
  [% ELSE %]
43
  [% ELSE %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc (-1 lines)
Lines 37-43 Link Here
37
                        <li>
37
                        <li>
38
                            <label for="branchcode_filter">Library:</label>
38
                            <label for="branchcode_filter">Library:</label>
39
                            <select id="branchcode_filter">
39
                            <select id="branchcode_filter">
40
                                [% SET libraries = Branches.all( only_from_group => 1 ) %]
41
                                [% IF libraries.size != 1 %]
40
                                [% IF libraries.size != 1 %]
42
                                    <option value="">Any</option>
41
                                    <option value="">Any</option>
43
                                [% END %]
42
                                [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt (+4 lines)
Lines 376-384 Link Here
376
                            <li>
376
                            <li>
377
                                <label for="branch">Library:</label>
377
                                <label for="branch">Library:</label>
378
                                <select id="branch" name="branch">
378
                                <select id="branch" name="branch">
379
                                    [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
380
                                    [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => branch, unfiltered => 1 ) %]
381
                                    [% ELSE %]
379
                                    <option value="">All</option>
382
                                    <option value="">All</option>
380
                                    [%# FIXME Should not we filter the libraries %]
383
                                    [%# FIXME Should not we filter the libraries %]
381
                                    [% PROCESS options_for_libraries libraries => Branches.all( selected => branch, unfiltered => 1 ) %]
384
                                    [% PROCESS options_for_libraries libraries => Branches.all( selected => branch, unfiltered => 1 ) %]
385
                                    [% END %]
382
                                </select>
386
                                </select>
383
                            </li>
387
                            </li>
384
                        </ol>
388
                        </ol>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref (+7 lines)
Lines 124-129 Administration: Link Here
124
                  1: "Yes"
124
                  1: "Yes"
125
                  0: "No"
125
                  0: "No"
126
            - "<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>"
126
            - "<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>"
127
        -
128
            - "Prevent staff (but not superlibrarians) from selecting other libraries in dropdowns and seeing items belonging to other libraries: "
129
            - pref: IndependentBranchesHideOtherBranchesItems
130
              default: 0
131
              choices:
132
                  1: "Yes"
133
                  0: "No"
127
        -
134
        -
128
            - "Prevent staff (but not superlibrarians) from viewing and approving/denying patron modification requests for patrons belonging to other libraries: "
135
            - "Prevent staff (but not superlibrarians) from viewing and approving/denying patron modification requests for patrons belonging to other libraries: "
129
            - pref: IndependentBranchesPatronModifications
136
            - pref: IndependentBranchesPatronModifications
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt (+3 lines)
Lines 281-286 Link Here
281
281
282
<fieldset id="select-libs">
282
<fieldset id="select-libs">
283
        <p><label for="branchloop">Individual libraries:</label><select name="limit" id="branchloop">
283
        <p><label for="branchloop">Individual libraries:</label><select name="limit" id="branchloop">
284
        [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
285
        [% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, unfiltered => 1 ) %]
286
        [% ELSE %]
284
        <option value="">All libraries</option>
287
        <option value="">All libraries</option>
285
        [%# FIXME Should not we filter the libraries displayed? %]
288
        [%# FIXME Should not we filter the libraries displayed? %]
286
        [% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( unfiltered => 1, do_not_select_my_library => 1, selected => limits.branch.0 ) %]
289
        [% PROCESS options_for_libraries prefix => "branch:" libraries => Branches.all( unfiltered => 1, do_not_select_my_library => 1, selected => limits.branch.0 ) %]
(-)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 228-243 Link Here
228
    <li>
228
    <li>
229
        <label>Item home library:</label>
229
        <label>Item home library:</label>
230
        <select name="homebranch" id="homebranch">
230
        <select name="homebranch" id="homebranch">
231
            [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
232
            [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => filters.homebranch ) %]
233
	    [% ELSE %]
231
            <option value="">Any</option>
234
            <option value="">Any</option>
232
            [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.homebranch ) %]
235
            [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.homebranch ) %]
236
	    [% END %]
233
        </select>
237
        </select>
234
    </li>
238
    </li>
235
239
236
    <li>
240
    <li>
237
        <label>Item holding library:</label>
241
        <label>Item holding library:</label>
238
        <select name="holdingbranch" id="holdingbranch">
242
        <select name="holdingbranch" id="holdingbranch">
243
            [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
244
            [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => filters.holdingbranch ) %]
245
	    [% ELSE %]
239
            <option value="">Any</option>
246
            <option value="">Any</option>
240
            [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.holdingbranch ) %]
247
            [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.holdingbranch ) %]
248
	    [% END %]
241
        </select>
249
        </select>
242
    </li>
250
    </li>
243
251
Lines 245-251 Link Here
245
        <label>Library of the patron:</label>
253
        <label>Library of the patron:</label>
246
        <select name="branch" id="branch">
254
        <select name="branch" id="branch">
247
            <option value="">Any</option>
255
            <option value="">Any</option>
256
            [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
257
            [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => filters.branch, only_from_group => 1 ) %]
258
            [% ELSE %]
248
            [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.branch, only_from_group => 1 ) %]
259
            [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.branch, only_from_group => 1 ) %]
260
            [% END %]
249
        </select>
261
        </select>
250
    </li>
262
    </li>
251
263
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt (+4 lines)
Lines 244-251 Link Here
244
                <li>
244
                <li>
245
                    <label for="branchlimit">Library: </label>
245
                    <label for="branchlimit">Library: </label>
246
                    <select name="branchlimit" id="branchlimit">
246
                    <select name="branchlimit" id="branchlimit">
247
                        [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
248
                        [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, only_from_group => 1 ) %]
249
                        [% ELSE %]
247
                        <option value="">All</option>
250
                        <option value="">All</option>
248
                        [% PROCESS options_for_libraries libraries => Branches.all( selected => branchlimit, only_from_group => 1 ) %]
251
                        [% PROCESS options_for_libraries libraries => Branches.all( selected => branchlimit, only_from_group => 1 ) %]
252
                        [% END %]
249
                    </select>
253
                    </select>
250
                </li>
254
                </li>
251
                <li>
255
                <li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt (+4 lines)
Lines 86-93 Link Here
86
                        <li>
86
                        <li>
87
                            <label for="club-template-branchcode">Library:</label>
87
                            <label for="club-template-branchcode">Library:</label>
88
                            <select name="branchcode" id="club-template-branchcode">
88
                            <select name="branchcode" id="club-template-branchcode">
89
                            [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
90
                                [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => club.branch.branchcode ) %]
91
                            [% ELSE %]
89
                                <option value=""></option>
92
                                <option value=""></option>
90
                                [% PROCESS options_for_libraries libraries => Branches.all( selected => club.branch.branchcode ) %]
93
                                [% PROCESS options_for_libraries libraries => Branches.all( selected => club.branch.branchcode ) %]
94
                            [% END %]
91
                            </select>
95
                            </select>
92
                        </li>
96
                        </li>
93
97
(-)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 (-1 / +5 lines)
Lines 6-12 Link Here
6
[% USE Categories %]
6
[% USE Categories %]
7
[% SET footerjs = 1 %]
7
[% SET footerjs = 1 %]
8
[% PROCESS 'patronfields.inc' %]
8
[% PROCESS 'patronfields.inc' %]
9
[% SET libraries = Branches.all %]
9
[% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
10
  [% SET libraries = Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
11
[% ELSE %]
12
  [% SET libraries = Branches.all %]
13
[% END %]
10
[% SET categories = Categories.all.unblessed %]
14
[% SET categories = Categories.all.unblessed %]
11
[% SET columns = ['cardnumber', 'name-address', 'dateofbirth', 'branch', 'category', 'dateexpiry', 'checkouts', 'account_balance', 'borrowernotes', 'action'] %]
15
[% SET columns = ['cardnumber', 'name-address', 'dateofbirth', 'branch', 'category', 'dateexpiry', 'checkouts', 'account_balance', 'borrowernotes', 'action'] %]
12
[% PROCESS 'patron-search.inc' %]
16
[% PROCESS 'patron-search.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (+4 lines)
Lines 902-908 legend:hover { Link Here
902
                                            <li>
902
                                            <li>
903
                                                <label for="libraries" class="required">Library:</label>
903
                                                <label for="libraries" class="required">Library:</label>
904
                                                <select name="branchcode" id="libraries">
904
                                                <select name="branchcode" id="libraries">
905
                                                    [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
906
                                                    [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => userbranch, only_from_group => 1 ) %]
907
                                                    [% ELSE %]
905
                                                    [% PROCESS options_for_libraries libraries => Branches.all( selected => userbranch, only_from_group => 1 ) %]
908
                                                    [% PROCESS options_for_libraries libraries => Branches.all( selected => userbranch, only_from_group => 1 ) %]
909
                                                    [% END %]
906
                                                </select>
910
                                                </select>
907
                                                <span class="required">Required</span>
911
                                                <span class="required">Required</span>
908
                                            </li>
912
                                            </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 180-186 Link Here
180
                <td><input type="radio" name="Column" value="items.homebranch" /></td>
181
                <td><input type="radio" name="Column" value="items.homebranch" /></td>
181
                <td>
182
                <td>
182
                    <select name="Filter">
183
                    <select name="Filter">
184
                        [% UNLESS Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
183
                        <option value="" selected="selected">All libraries</option>
185
                        <option value="" selected="selected">All libraries</option>
186
                        [% END %]
184
                        [% FOREACH branch IN branches %]
187
                        [% FOREACH branch IN branches %]
185
                            <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
188
                            <option value="[% branch.branchcode | html %]">[% branch.branchname | html %]</option>
186
                        [% END %]
189
                        [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/bor_issues_top.tt (-2 / +9 lines)
Lines 136-145 Link Here
136
            </li>
136
            </li>
137
			<li> 
137
			<li> 
138
				<label for="branch">Library: </label>
138
				<label for="branch">Library: </label>
139
<select name="Filter" id="branch"><option value="" > Any library</option>
139
<select name="Filter" id="branch">
140
    [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
141
    [% FOREACH l IN Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, unfiltered => 1 ) %]
142
        <option value="[% l.branchcode | html %]" >[% l.branchname | html %] </option>
143
     [% END %]
144
    [% ELSE %]
145
        <option value="" > Any library</option>
140
    [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
146
    [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
141
        <option value="[% l.branchcode | html %]" >[% l.branchname | html %] </option>
147
        <option value="[% l.branchcode | html %]" >[% l.branchname | html %] </option>
142
     [% END %] 
148
     [% END %]
149
    [% END %]
143
    </select>			</li>
150
    </select>			</li>
144
			<li> 
151
			<li> 
145
                <label for="documenttype">Item type: </label><select name="Filter" id="documenttype"><option value="" > Any item type</option>
152
                <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 169-178 Link Here
169
			<td><input type="radio" name="Column" value="branchcode" /></td>
169
			<td><input type="radio" name="Column" value="branchcode" /></td>
170
			<td>
170
			<td>
171
                <select name="Filter" id="branch">
171
                <select name="Filter" id="branch">
172
                [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
173
                [% FOREACH l IN Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, unfiltered => 1 ) %]
174
                    <option value="[% l.branchcode | html %]">[% l.branchcode | html %] - [% l.branchname || 'UNKNOWN' | html %]</option>
175
                [% END %]
176
                [% ELSE %]
172
                <option value=""></option>
177
                <option value=""></option>
173
                [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
178
                [% FOREACH l IN Branches.all( unfiltered => 1 ) %]
174
                    <option value="[% l.branchcode | html %]">[% l.branchcode | html %] - [% l.branchname || 'UNKNOWN' | html %]</option>
179
                    <option value="[% l.branchcode | html %]">[% l.branchcode | html %] - [% l.branchname || 'UNKNOWN' | html %]</option>
175
                [% END %]
180
                [% END %]
181
                [% END %]
176
                </select>
182
                </select>
177
			</td>
183
			</td>
178
			</tr>
184
			</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 107-114 Link Here
107
        </li>
107
        </li>
108
        <li>
108
        <li>
109
            <label for="branch">Library: </label>
109
            <label for="branch">Library: </label>
110
            <select name="Filter" id="branch"><option value="" > Any library</option>
110
            <select name="Filter" id="branch">
111
	    [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
112
                [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
113
	    [% ELSE %]
114
	        <option value="" > Any library</option>
111
                [% PROCESS options_for_libraries libraries => Branches.all() %]
115
                [% PROCESS options_for_libraries libraries => Branches.all() %]
116
            [% END %]
112
            </select>
117
            </select>
113
        </li>
118
        </li>
114
      <li> 
119
      <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 181-188 Link Here
181
				<td><input type="radio" name="Column" value="branchcode" /></td>
181
				<td><input type="radio" name="Column" value="branchcode" /></td>
182
                <td>
182
                <td>
183
                    <select name="Filter" id="branch">
183
                    <select name="Filter" id="branch">
184
                    [% IF Branches.InIndependentBranchesMode({syspref=>''}) %]
185
                        [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
186
                    [% ELSE %]
184
                        <option value=""></option>
187
                        <option value=""></option>
185
                        [% PROCESS options_for_libraries libraries => Branches.all() %]
188
                        [% PROCESS options_for_libraries libraries => Branches.all() %]
189
                    [% END %]
186
                    </select>
190
                    </select>
187
                </td>
191
                </td>
188
			</tr>
192
			</tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tt (+12 lines)
Lines 205-212 Link Here
205
            <td><input type="radio" checked="checked" name="Line" value="branch" /></td>
205
            <td><input type="radio" checked="checked" name="Line" value="branch" /></td>
206
            <td><input type="radio" name="Column" value="branch" /></td>
206
            <td><input type="radio" name="Column" value="branch" /></td>
207
            <td><select name="Filter" id="branch">
207
            <td><select name="Filter" id="branch">
208
                [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
209
                [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
210
                [% ELSE %]
208
                <option value=""> </option>
211
                <option value=""> </option>
209
                [% PROCESS options_for_libraries libraries => Branches.all() %]
212
                [% PROCESS options_for_libraries libraries => Branches.all() %]
213
                [% END %]
210
               </select>
214
               </select>
211
             </td> 
215
             </td> 
212
        </tr>
216
        </tr>
Lines 270-277 Link Here
270
            <td><input type="radio" name="Line" value="items.homebranch" /></td>
274
            <td><input type="radio" name="Line" value="items.homebranch" /></td>
271
            <td><input type="radio" name="Column" value="items.homebranch" /></td>
275
            <td><input type="radio" name="Column" value="items.homebranch" /></td>
272
            <td><select name="Filter" id="homebranch">
276
            <td><select name="Filter" id="homebranch">
277
                    [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
278
                    [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
279
                    [% ELSE %]
273
                    <option value=""> </option>
280
                    <option value=""> </option>
274
                    [% PROCESS options_for_libraries libraries => Branches.all() %]
281
                    [% PROCESS options_for_libraries libraries => Branches.all() %]
282
                    [% END %]
275
                </select>
283
                </select>
276
            </td>
284
            </td>
277
        </tr>
285
        </tr>
Lines 280-287 Link Here
280
            <td><input type="radio" name="Line" value="items.holdingbranch" /></td>
288
            <td><input type="radio" name="Line" value="items.holdingbranch" /></td>
281
            <td><input type="radio" name="Column" value="items.holdingbranch" /></td>
289
            <td><input type="radio" name="Column" value="items.holdingbranch" /></td>
282
            <td><select name="Filter" id="holdingbranch">
290
            <td><select name="Filter" id="holdingbranch">
291
                    [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
292
                    [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
293
                    [% ELSE %]
283
                    <option value=""> </option>
294
                    <option value=""> </option>
284
                    [% PROCESS options_for_libraries libraries => Branches.all() %]
295
                    [% PROCESS options_for_libraries libraries => Branches.all() %]
296
                    [% END %]
285
                </select>
297
                </select>
286
            </td>
298
            </td>
287
        </tr>
299
        </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 208-215 Link Here
208
            <td><input type="radio" name="Line" value="reserves.branchcode" checked="checked" /></td>
208
            <td><input type="radio" name="Line" value="reserves.branchcode" checked="checked" /></td>
209
            <td><input type="radio" name="Column" value="reserves.branchcode" /></td>
209
            <td><input type="radio" name="Column" value="reserves.branchcode" /></td>
210
            <td><select name="filter_reserves.branchcode" id="resbranchcode">
210
            <td><select name="filter_reserves.branchcode" id="resbranchcode">
211
               [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
212
                [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
213
               [% ELSE %]
211
               <option value=""> </option>
214
               <option value=""> </option>
212
                [% PROCESS options_for_libraries libraries => Branches.all() %]
215
                [% PROCESS options_for_libraries libraries => Branches.all() %]
216
               [% END %]
213
               </select>
217
               </select>
214
             </td> 
218
             </td> 
215
        </tr>
219
        </tr>
Lines 218-225 Link Here
218
            <td><input type="radio" name="Line" value="items.holdingbranch" /></td>
222
            <td><input type="radio" name="Line" value="items.holdingbranch" /></td>
219
            <td><input type="radio" name="Column" value="items.holdingbranch" /></td>
223
            <td><input type="radio" name="Column" value="items.holdingbranch" /></td>
220
            <td><select name="filter_items.holdingbranch" id="holdingbranch">
224
            <td><select name="filter_items.holdingbranch" id="holdingbranch">
225
               [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
226
                [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
227
               [% ELSE %]
221
               <option value=""> </option>
228
               <option value=""> </option>
222
                [% PROCESS options_for_libraries libraries => Branches.all() %]
229
                [% PROCESS options_for_libraries libraries => Branches.all() %]
230
               [% END %]
223
               </select>
231
               </select>
224
             </td> 
232
             </td> 
225
        </tr>
233
        </tr>
Lines 228-235 Link Here
228
            <td><input type="radio" name="Line" value="items.homebranch" /></td>
236
            <td><input type="radio" name="Line" value="items.homebranch" /></td>
229
            <td><input type="radio" name="Column" value="items.homebranch" /></td>
237
            <td><input type="radio" name="Column" value="items.homebranch" /></td>
230
            <td><select name="filter_items.homebranch" id="homebranch">
238
            <td><select name="filter_items.homebranch" id="homebranch">
239
               [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
240
                [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
241
               [% ELSE %]
231
                <option value=""> </option>
242
                <option value=""> </option>
232
                [% PROCESS options_for_libraries libraries => Branches.all() %]
243
                [% PROCESS options_for_libraries libraries => Branches.all() %]
244
               [% END %]
233
               </select>
245
               </select>
234
             </td> 
246
             </td> 
235
        </tr>
247
        </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 => branchcode ) %]
586
                                [% PROCESS options_for_libraries libraries => Branches.all( selected => 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 139-145 Link Here
139
        </li>
139
        </li>
140
        <li>
140
        <li>
141
        <label for="strip_items_not_from_libraries">Remove items not owned by selected libraries:</label>
141
        <label for="strip_items_not_from_libraries">Remove items not owned by selected libraries:</label>
142
	[% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
143
        <input id="strip_items_not_from_libraries" type="checkbox" name="strip_items_not_from_libraries" checked="checked" />
144
	[% ELSE %]
142
        <input id="strip_items_not_from_libraries" type="checkbox" name="strip_items_not_from_libraries" />
145
        <input id="strip_items_not_from_libraries" type="checkbox" name="strip_items_not_from_libraries" />
146
	[% END %]
143
        </li>
147
        </li>
144
        <li>
148
        <li>
145
        <label for="export_remove_fields">Don't export fields:</label>
149
        <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 252-261 Link Here
252
                        <li>
252
                        <li>
253
                            <label class="description" for="branchcode">[% borrower_fields.$borrower_db_column | html %]: </label>
253
                            <label class="description" for="branchcode">[% borrower_fields.$borrower_db_column | html %]: </label>
254
                            <select id="branchcode" name="branchcode">
254
                            <select id="branchcode" name="branchcode">
255
                            [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
256
                                [% FOREACH library IN Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %]
257
                                    <option value="[% library.branchcode | html %]">[% library.branchname | html %]</option>
258
                                [% END %]
259
                            [% ELSE %]
255
                                <option value="" selected="selected"></option>
260
                                <option value="" selected="selected"></option>
256
                                [% FOREACH library IN Branches.all() %]
261
                                [% FOREACH library IN Branches.all() %]
257
                                    <option value="[% library.branchcode | html %]">[% library.branchname | html %]</option>
262
                                    <option value="[% library.branchcode | html %]">[% library.branchname | html %]</option>
258
                                [% END %]
263
                                [% END %]
264
                            [% END %]
259
                            </select>
265
                            </select>
260
                            <span class="field_hint">[% borrower_db_column | html %]</span>
266
                            <span class="field_hint">[% borrower_db_column | html %]</span>
261
                        </li>
267
                        </li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt (+4 lines)
Lines 99-106 Link Here
99
            <input type="radio" name="branch" value="holdingbranch"> Current library</input>
99
            <input type="radio" name="branch" value="holdingbranch"> Current library</input>
100
        </li><li>
100
        </li><li>
101
        <label for="branchloop">Library: </label><select id="branchloop" name="branchcode" style="width:12em;">
101
        <label for="branchloop">Library: </label><select id="branchloop" name="branchcode" style="width:12em;">
102
        [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %]
103
            [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => branchcode, unfiltered => 1, ) %]
104
        [% ELSE %]
102
            <option value="">All libraries</option>
105
            <option value="">All libraries</option>
103
            [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
106
            [% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %]
107
        [% END %]
104
        </select>
108
        </select>
105
        </li>
109
        </li>
106
        [% IF (authorised_values) %]
110
        [% IF (authorised_values) %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc (+1 lines)
Lines 45-50 Link Here
45
                            [% FOREACH facet IN facets_loo.facets %]
45
                            [% 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, opac =>1 ) || facet.facet_label_value %][% END %]
46
                            [% IF facets_loo.type_label_CollectionCodes %][% SET facet.facet_label_value = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => facet.facet_label_value, opac =>1 ) || 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 %]
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_HomeLibrary || facets_loo.type_label_HoldingLibrary ) && opac_name && Koha.Preference('IndependentBranchesHideOtherBranchesItems') && facet.facet_link_value != opac_name %][% NEXT %][% END %]
48
                            [% IF loop.count > 5 && !facet.active %]
49
                            [% IF loop.count > 5 && !facet.active %]
49
                                <li class="collapsible-facet" style="display:none">
50
                                <li class="collapsible-facet" style="display:none">
50
                            [% ELSE %]
51
                            [% ELSE %]
(-)a/reports/acquisitions_stats.pl (-1 / +5 lines)
Lines 181-187 else { Link Here
181
181
182
    my $CGIsepChoice = GetDelimiterChoices;
182
    my $CGIsepChoice = GetDelimiterChoices;
183
183
184
    my $libraries = Koha::Libraries->search({}, { order_by => 'branchname' });
184
    my $libraries_filter = {};
185
    if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
186
        $libraries_filter->{branchcode} = C4::Context->userenv->{branch};
187
    }
188
    my $libraries = Koha::Libraries->search($libraries_filter, { order_by => 'branchname' });
185
189
186
    my $ccode_subfield_structure = GetMarcSubfieldStructureFromKohaField('items.ccode');
190
    my $ccode_subfield_structure = GetMarcSubfieldStructureFromKohaField('items.ccode');
187
    my $ccode_label;
191
    my $ccode_label;
(-)a/reports/cash_register_stats.pl (-1 / +5 lines)
Lines 191-201 if ($do_it) { Link Here
191
191
192
}
192
}
193
193
194
my $libraries_filter = {};
195
if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
196
    $libraries_filter->{branchcode} = C4::Context->userenv->{branch};
197
}
194
$template->param(
198
$template->param(
195
    beginDate        => $fromDate,
199
    beginDate        => $fromDate,
196
    endDate          => $toDate,
200
    endDate          => $toDate,
197
    transaction_type => $transaction_type,
201
    transaction_type => $transaction_type,
198
    branchloop       => Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed,
202
    branchloop       => Koha::Libraries->search($libraries_filter, { order_by => ['branchname'] })->unblessed,
199
    debit_types      => \@debit_types,
203
    debit_types      => \@debit_types,
200
    credit_types     => \@credit_types,
204
    credit_types     => \@credit_types,
201
    registerid       => $registerid,
205
    registerid       => $registerid,
(-)a/reserve/request.pl (+4 lines)
Lines 473-478 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
473
                        unless ( C4::Context->IsSuperLibrarian ) {
473
                        unless ( C4::Context->IsSuperLibrarian ) {
474
                            $item->{cantreserve} = 1 if ( $item->{homebranch} ne $userenv->{branch} );
474
                            $item->{cantreserve} = 1 if ( $item->{homebranch} ne $userenv->{branch} );
475
                        }
475
                        }
476
                        if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && $item->{homebranch} ne $userenv->{branch} ) {
477
                            $item->{hide} = 1;
478
                            $hiddencount++;
479
                        }
476
                    }
480
                    }
477
                }
481
                }
478
482
(-)a/reviews/reviewswaiting.pl (-2 / +7 lines)
Lines 40-46 my $status = $query->param('status') || 0; Link Here
40
my $reviewid = $query->param('reviewid');
40
my $reviewid = $query->param('reviewid');
41
my $page     = $query->param('page') || 1;
41
my $page     = $query->param('page') || 1;
42
my $count    = C4::Context->preference('numSearchResults') || 20;
42
my $count    = C4::Context->preference('numSearchResults') || 20;
43
my $total    = Koha::Reviews->search_limited({ approved => $status })->count;
43
my $review_filter = { approved => $status };
44
if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
45
    # search_limited supplies the borrowernumber relation
46
    $review_filter->{'borrowernumber.branchcode'} = C4::Context->userenv->{branch};
47
}
48
my $total    = Koha::Reviews->search_limited($review_filter)->count;
44
49
45
if ( $op eq 'approve' ) {
50
if ( $op eq 'approve' ) {
46
    my $review = Koha::Reviews->find( $reviewid );
51
    my $review = Koha::Reviews->find( $reviewid );
Lines 56-62 elsif ( $op eq 'delete' ) { Link Here
56
}
61
}
57
62
58
my $reviews = Koha::Reviews->search_limited(
63
my $reviews = Koha::Reviews->search_limited(
59
    { approved => $status },
64
    $review_filter,
60
    {
65
    {
61
        rows => $count,
66
        rows => $count,
62
        page => $page,
67
        page => $page,
(-)a/tools/batchMod.pl (+3 lines)
Lines 232-237 if ($op eq "show"){ Link Here
232
        if (defined $biblionumber && !@itemnumbers){
232
        if (defined $biblionumber && !@itemnumbers){
233
            my $biblio = Koha::Biblios->find($biblionumber);
233
            my $biblio = Koha::Biblios->find($biblionumber);
234
            @itemnumbers = $biblio ? $biblio->items->get_column('itemnumber') : ();
234
            @itemnumbers = $biblio ? $biblio->items->get_column('itemnumber') : ();
235
            if ( $biblio && C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
236
                @itemnumbers = $biblio->items->search({ homebranch => C4::Context->userenv->{branch} })->get_column('itemnumber');
237
            }
235
        }
238
        }
236
        if ( my $list = $input->param('barcodelist') ) {
239
        if ( my $list = $input->param('barcodelist') ) {
237
            my @barcodelist = grep /\S/, ( split /[$split_chars]/, $list );
240
            my @barcodelist = grep /\S/, ( split /[$split_chars]/, $list );
(-)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 172-178 if ( $op eq 'show' ) { Link Here
172
    $template->param( useborrowernumbers => $useborrowernumbers );
172
    $template->param( useborrowernumbers => $useborrowernumbers );
173
173
174
    # Construct drop-down list values
174
    # Construct drop-down list values
175
    my $branches = Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed;
175
    my $library_filter = {};
176
    if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) {
177
        $library_filter->{'branchcode'} = C4::Context->userenv->{branch};
178
    }
179
    my $branches = Koha::Libraries->search($library_filter, { order_by => ['branchname'] })->unblessed;
176
    my @branches_option;
180
    my @branches_option;
177
    push @branches_option, { value => $_->{branchcode}, lib => $_->{branchname} } for @$branches;
181
    push @branches_option, { value => $_->{branchcode}, lib => $_->{branchname} } for @$branches;
178
    unshift @branches_option, { value => "", lib => "" };
182
    unshift @branches_option, { value => "", lib => "" };
179
- 

Return to bug 28642