From 4c26f1761c11cb66f89253d285e2e81e92a6a965 Mon Sep 17 00:00:00 2001 From: Michael Hafen Date: Tue, 29 Jun 2021 16:49:48 -0600 Subject: [PATCH] Bug 28642: Expand IndependentBranches to hide others items and libraries Content-Type: text/plain; charset="utf-8" Adds a system preference: IndependentBranchesHideOtherBranchesItems. When on: All library select's will be limited to just the users library. Item lists in search results, title details, item details, holds, and exports will only show items at the users library. Test Plan: Apply patch and run koha-upgrade-schema or manually create IndependentBranchesHideOtherBranchesItems system preference. Login with an account that is not Super Librarian. Set the IndependentBranchesHideOtherBranchesItems system preference to yes. On the Item Search page observe that only your library shows in the home and current library fields. On the Advanced Search page observe that only your library shows in the location -> individual libraries field. Search the catalog for a title with an item at your library and also at another library. Observe that you only see your library listed in the facets panel (Refine your search -> Home Libraries section) Observe that you only see the item at your library in the search results, title details, MARC details, Items, Checkout history, and Edit Items pages. On the title details page Save the title as a text format, for example MARCXML, and observe that only item(s) at your library are in the export. On the Place hold page, search for a patron and observe that only patrons at your library are found. After selecting a patron observe that only items at your library are displaed. In the Circulation -> Overdues page observe that you only see items at your library. In the Check out quick search search for patrons. Observe that only patrons at your school are found unless you search by cardnumber. On the Patrons page observe that only your library shows in the library field of the search form. In the Search Patrons tab of the quick search click the '+' to open the other fields. Observe that only your library shows in the Library field. On the Modify Patron page (edit patron) observe that only your library shows in the library field in the library management section. In Serials start a new subscription and observe that only your library shows in the library field. In Serials -> Check expiration observe that only your library show in the library field. In Reports observe that only your library shows in the following reports: Acquisitions statistics, Patrons statistics, Catalog statistics, Circulation statistics, Serials statistics, Cash register statistics, Holds statistics, Patrons with the most checkouts, Most-circulated items, Items with no checkouts, Items lost, Catalog by item type, Average loan time. In Suggestions observe that only your library shows in the library field on the Suggestion management and New purchase suggestion pages. In Tools -> Patron Lists when adding patrons to a list observe that only patrons at your library are found by name. In Patron Clubs observe that the library field only shows your library in the Club Template and Club edit pages. In Comments observe that only comments at your library are shown. In Import Patrons observe that the library field in the defaults section only shows your library. In Batch patron modification observe that your library is the only library in the library field. In Batch item modification observe that your library is the only library in the Home and Current library fields. In Export data observe that only your library shows in the 'With items owned by the following libraries' field and it is selected. In Inventory observe that only your library shows in the library field. In News observe that only your library shows in the library field in the Filter on the home page and the Edit entry page. Open the Opac and log in. On the Advanced search page observe that your library is the only library in the Location field. Search for a title with items at multiple libraries. Observe that only your library shows in the libraries facets (refine your search). --- C4/Context.pm | 4 +++- C4/Items.pm | 9 ++++++++- C4/Search.pm | 6 ++++++ Koha/Template/Plugin/Branches.pm | 5 +++-- catalogue/MARCdetail.pl | 2 ++ catalogue/export.pl | 13 +++++++++++++ catalogue/issuehistory.pl | 8 ++++++-- catalogue/itemsearch.pl | 13 ++++++++++++- catalogue/search.pl | 4 ++++ cataloguing/additem.pl | 7 ++++++- circ/overdue.pl | 7 +++++++ installer/data/mysql/atomicupdate/bug_28642.perl | 5 +++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc | 2 ++ .../prog/en/includes/patron-search.inc | 4 ++++ .../intranet-tmpl/prog/en/modules/acqui/invoices.tt | 4 ++++ .../prog/en/modules/admin/preferences/admin.pref | 7 +++++++ .../prog/en/modules/catalogue/advsearch.tt | 4 ++++ .../prog/en/modules/catalogue/itemsearch.tt | 3 +++ .../intranet-tmpl/prog/en/modules/circ/overdue.tt | 12 ++++++++++++ .../prog/en/modules/circ/view_holdsqueue.tt | 4 ++++ .../prog/en/modules/clubs/clubs-add-modify.tt | 4 ++++ .../prog/en/modules/clubs/templates-add-modify.tt | 4 ++++ .../intranet-tmpl/prog/en/modules/members/member.tt | 4 ++++ .../prog/en/modules/members/memberentrygen.tt | 4 ++++ .../prog/en/modules/reports/acquisitions_stats.tt | 3 +++ .../prog/en/modules/reports/bor_issues_top.tt | 11 +++++++++-- .../prog/en/modules/reports/borrowers_stats.tt | 6 ++++++ .../prog/en/modules/reports/cash_register_stats.tt | 2 ++ .../prog/en/modules/reports/cat_issues_top.tt | 7 ++++++- .../prog/en/modules/reports/catalogue_out.tt | 4 ++++ .../prog/en/modules/reports/catalogue_stats.tt | 4 ++++ .../prog/en/modules/reports/issues_avg_stats.tt | 4 ++++ .../prog/en/modules/reports/issues_stats.tt | 12 ++++++++++++ .../prog/en/modules/reports/itemslost.tt | 4 ++++ .../prog/en/modules/reports/itemtypes.tt | 6 ++++++ .../prog/en/modules/reports/reserves_stats.tt | 12 ++++++++++++ .../prog/en/modules/reports/serials_stats.tt | 4 ++++ .../prog/en/modules/serials/checkexpiration.tt | 4 ++++ .../prog/en/modules/serials/subscription-add.tt | 10 +++++++++- .../prog/en/modules/suggestion/suggestion.tt | 8 ++++++++ .../intranet-tmpl/prog/en/modules/tools/export.tt | 4 ++++ .../prog/en/modules/tools/import_borrowers.tt | 6 ++++++ .../prog/en/modules/tools/inventory.tt | 4 ++++ .../opac-tmpl/bootstrap/en/includes/opac-facets.inc | 1 + reports/acquisitions_stats.pl | 6 +++++- reports/cash_register_stats.pl | 6 +++++- reserve/request.pl | 4 ++++ reviews/reviewswaiting.pl | 9 +++++++-- tools/batchMod.pl | 6 +++++- tools/export.pl | 10 +++++++++- tools/modborrowers.pl | 6 +++++- 52 files changed, 284 insertions(+), 19 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_28642.perl diff --git a/C4/Context.pm b/C4/Context.pm index 241589e7b5..8c9ad93c59 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -899,8 +899,10 @@ sub mybranch { =cut sub only_my_library { + my ( $class, $pref ) = @_; + $pref //= 'IndependentBranches'; return - C4::Context->preference('IndependentBranches') + C4::Context->preference($pref) && C4::Context->userenv && !C4::Context->IsSuperLibrarian() && C4::Context->userenv->{branch}; diff --git a/C4/Items.pm b/C4/Items.pm index 7f83736ace..d8ee554c9a 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -766,6 +766,8 @@ sub GetItemsInfo { my $userenv = C4::Context->userenv; my $want_not_same_branch = C4::Context->preference("IndependentBranches") && !C4::Context->IsSuperLibrarian(); while ( my $data = $sth->fetchrow_hashref ) { + next if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && $data->{homebranch} ne $userenv->{branch} ); + if ( $data->{borrowernumber} && $want_not_same_branch) { $data->{'NOTSAMEBRANCH'} = $data->{'bcode'} ne $userenv->{branch}; } @@ -863,7 +865,12 @@ sub GetItemsLocationInfo { location, itemcallnumber, cn_sort FROM items, branches as a, branches as b WHERE homebranch = a.branchcode AND holdingbranch = b.branchcode - AND biblionumber = ? + AND biblionumber = ?"; + if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') &&( my $mybranch = C4::Context->userenv->{branch} ) ) { + $query .= " + AND homebranch = '$mybranch'"; + } + $query .= " ORDER BY cn_sort ASC"; my $sth = $dbh->prepare($query); $sth->execute($biblionumber); diff --git a/C4/Search.pm b/C4/Search.pm index 5814c5f5dc..243d159599 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1791,6 +1791,12 @@ sub searchResults { next; } } + if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) { + if ( $item->{homebranch} ne $userenv->{branch} ) { + $items_count--; + next; + } + } my $hbranch = C4::Context->preference('StaffSearchResultsDisplayBranch'); my $otherbranch = $hbranch eq 'homebranch' ? 'holdingbranch' : 'homebranch'; diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm index 92c83be68c..c42d8df999 100644 --- a/Koha/Template/Plugin/Branches.pm +++ b/Koha/Template/Plugin/Branches.pm @@ -92,8 +92,9 @@ sub all { } sub InIndependentBranchesMode { - my ( $self ) = @_; - return ( not C4::Context->preference("IndependentBranches") or C4::Context::IsSuperLibrarian ); + my ( $self, $params ) = @_; + my $pref = $params->{syspref} || 'IndependentBranches'; + return ( C4::Context->preference($pref) and not C4::Context::IsSuperLibrarian ); } sub pickup_locations { diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index 7ddbbd40dd..7cdba7a70b 100755 --- a/catalogue/MARCdetail.pl +++ b/catalogue/MARCdetail.pl @@ -265,6 +265,7 @@ for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) { # loop through each tag # warning : we may have differents number of columns in each row. Thus, we first build a hash, complete it if necessary # then construct template. +my ($homebrtagf,$homebrtagsubf) = &GetMarcFromKohaField( "items.homebranch" ); my @fields = $record->fields(); my %witness ; #---- stores the list of subfields used at least once, with the "meaning" of the code @@ -302,6 +303,7 @@ foreach my $field (@fields) { if grep { $kohafield eq $_ } qw( items.dateaccessioned items.onloan items.datelastseen items.datelastborrowed items.replacementpricedate ); } + next if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && $item && $item->{$homebrtagsubf} ne C4::Context->userenv->{'branchname'} ); push @item_loop, $item if $item; } diff --git a/catalogue/export.pl b/catalogue/export.pl index 3785116581..f4602b421a 100755 --- a/catalogue/export.pl +++ b/catalogue/export.pl @@ -40,6 +40,19 @@ if ($op eq "export") { } } + if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) { + my $mybranch = C4::Context->userenv->{branch}; + my ($homebrtagf,$homebrtagsubf) = &GetMarcFromKohaField( "items.homebranch" ); + my @fields = $marc->field($homebrtagf); + my @delete; + foreach my $field (@fields) { + if ( $field->subfield($homebrtagsubf) ne $mybranch ) { + push @delete, $field; + } + } + $marc->delete_fields(@delete) if ( @delete ); + } + if ($format =~ /endnote/) { $marc = marc2endnote($marc); $format = 'endnote'; diff --git a/catalogue/issuehistory.pl b/catalogue/issuehistory.pl index 8d17dc933a..3d02ff27a3 100755 --- a/catalogue/issuehistory.pl +++ b/catalogue/issuehistory.pl @@ -41,15 +41,19 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( my $biblionumber = $query->param('biblionumber'); +my $issue_filter = { biblionumber => $biblionumber }; +if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) { + $issue_filter->{'item.homebranch'} = C4::Context->userenv->{branch}; +} my @checkouts = Koha::Checkouts->search( - { biblionumber => $biblionumber }, + $issue_filter, { join => 'item', order_by => 'timestamp', } ); my @old_checkouts = Koha::Old::Checkouts->search( - { biblionumber => $biblionumber }, + $issue_filter, { join => 'item', order_by => 'timestamp', diff --git a/catalogue/itemsearch.pl b/catalogue/itemsearch.pl index 78900429f2..849e6e02f5 100755 --- a/catalogue/itemsearch.pl +++ b/catalogue/itemsearch.pl @@ -113,9 +113,13 @@ if ( defined $format ) { filters => [], }; + # IndependentBranchesHideOtherBranchesItems forces homebranch filter + # if it isn't already set + my $got_branch = 0; foreach my $p (qw(homebranch holdingbranch location itype ccode issues datelastborrowed notforloan itemlost withdrawn)) { if (my @q = $cgi->multi_param($p)) { if ($q[0] ne '') { + if ( $p eq 'homebranch' ) { $got_branch = 1; } my $f = { field => $p, query => \@q, @@ -127,6 +131,9 @@ if ( defined $format ) { } } } + if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && ! $got_branch ) { + push @{ $filter->{filters} }, { field => 'homebranch', query => [ C4::Context->userenv->{branch} ] }; + } my @c = $cgi->multi_param('c'); my @fields = $cgi->multi_param('f'); @@ -259,7 +266,11 @@ if ( defined $format ) { # Display the search form -my @branches = map { value => $_->branchcode, label => $_->branchname }, Koha::Libraries->search( {}, { order_by => 'branchname' } ); +my $library_filter = {}; +if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) { + $library_filter->{'branchcode'} = C4::Context->userenv->{branch}; +} +my @branches = map { value => $_->branchcode, label => $_->branchname }, Koha::Libraries->search( $library_filter, { order_by => 'branchname' } ); my @itemtypes; foreach my $itemtype ( Koha::ItemTypes->search_with_localization ) { push @itemtypes, { diff --git a/catalogue/search.pl b/catalogue/search.pl index 8ed6ff3181..a2ee924c16 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -398,6 +398,10 @@ if ( $params->{'multibranchlimit'} ) { } } +if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && ! grep { /branch:/ } @limits ) { + push @limits, 'branch: '. C4::Context->userenv->{branch}; +} + for ( my $i=0; $i<@limits; $i++ ) { if ( $limits[$i] =~ /^branch:/ ) { my $branchfield = C4::Context->preference('SearchLimitLibrary'); diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index e099215256..9f31d6010c 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -884,6 +884,7 @@ foreach my $field (@fields) { } } if (%this_row) { + next if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && $this_row{$branchtagsubfield} ne C4::Context->userenv->{branchname} ); push(@big_array, \%this_row); } } @@ -944,7 +945,11 @@ my @loop_data =(); my $i=0; my $branch = $input->param('branch') || C4::Context->userenv->{branch}; -my $libraries = Koha::Libraries->search({}, { order_by => ['branchname'] })->unblessed;# build once ahead of time, instead of multiple times later. +my $libraries_filter = {}; +if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) { + $libraries_filter->{branchcode} = C4::Context->userenv->{branch}; +} +my $libraries = Koha::Libraries->search($libraries_filter, { order_by => ['branchname'] })->unblessed;# build once ahead of time, instead of multiple times later. for my $library ( @$libraries ) { $library->{selected} = 1 if $library->{branchcode} eq $branch } diff --git a/circ/overdue.pl b/circ/overdue.pl index 941458d7d7..914c067fcb 100755 --- a/circ/overdue.pl +++ b/circ/overdue.pl @@ -78,6 +78,13 @@ our $logged_in_user = Koha::Patrons->find( $loggedinuser ); my $dbh = C4::Context->dbh; +if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && (my $mybranch = C4::Context->userenv->{branch}) ) { + $homebranchfilter = $mybranch; + $holdingbranchfilter = ''; + $filters->{homebranch} = $mybranch; + $filters->{holdingbranch} = $mybranch; +} + my $req; $req = $dbh->prepare( "select categorycode, description from categories order by description"); $req->execute; diff --git a/installer/data/mysql/atomicupdate/bug_28642.perl b/installer/data/mysql/atomicupdate/bug_28642.perl new file mode 100644 index 0000000000..9c3d93d750 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_28642.perl @@ -0,0 +1,5 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $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')" ); + NewVersion( $DBversion, 28642, "Add new systempreference IndependentBranchesHideOtherBranchesItems"); +} diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 59db857ca6..4b379d0762 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -264,6 +264,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('IncludeSeeFromInSearches','0','','Include see-from references in searches.','YesNo'), ('IndependentBranches','0',NULL,'If ON, increases security between libraries','YesNo'), ('IndependentBranchesPatronModifications','0', NULL, 'Show only modification request for the logged in branch','YesNo'), +('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'), ('IndependentBranchesTransfers','0', NULL, 'Allow non-superlibrarians to transfer items between libraries','YesNo'), ('IntranetCatalogSearchPulldown','0', NULL, 'Show a search field pulldown for \"Search the catalog\" boxes','YesNo'), ('RecordedBooksClientSecret','','30','Client key for RecordedBooks integration','Free'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc index d31ade3d23..d0fcc3c5ad 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc @@ -1,6 +1,7 @@ [% USE raw %] [% USE AuthorisedValues %] [% USE Languages %] +[% USE Branches %] [% IF ( opacfacets ) %] [% IF ( facets_loop ) %]
@@ -36,6 +37,7 @@ [% FOREACH facet IN facets_loo.facets %] [% 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 %] [% IF facets_loo.type_label_Language %][% SET facet.facet_label_value = Languages.GetByISOCode(lang,facet.facet_label_value) || facet.facet_label_value %][% END %] + [% IF ( facets_loo.type_label_HomeLibrary && Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) && facet.facet_link_value != Branches.GetLoggedInBranchcode() ) %][% NEXT %][% END %] [% IF loop.count > 5 && !facet.active %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref index a858b1d0da..68d84db1fb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref @@ -116,6 +116,13 @@ Administration: 1: "Yes" 0: "No" - "

Warning: Changing this system preference will radically alter the behavior of Koha. Changing preference on a production system is highly discouraged.

" + - + - "Prevent staff (but not superlibrarians) from selecting other libraries in dropdowns and seeing items belonging to other libraries: " + - pref: IndependentBranchesHideOtherBranchesItems + default: 0 + choices: + 1: "Yes" + 0: "No" - - "Prevent staff (but not superlibrarians) from viewing and approving/denying patron modification requests for patrons belonging to other libraries: " - pref: IndependentBranchesPatronModifications diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt index a4d7c6d9d7..ce29abb7d4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt @@ -285,9 +285,13 @@

[% IF search_groups %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt index 3d23fdcd24..f257ee7b5f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt @@ -2,6 +2,7 @@ [% USE To %] [% USE Asset %] [% USE AuthorisedValues %] +[% USE Branches %] [%- BLOCK form_label -%] [%- SWITCH label -%] @@ -41,9 +42,11 @@ + [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %] + [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => filters.homebranch ) %] + [% ELSE %] [% PROCESS options_for_libraries libraries => Branches.all( selected => filters.homebranch ) %] + [% END %]
  • @@ -244,7 +252,11 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt index 564ab5f54f..8bd2d2e288 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt @@ -206,8 +206,12 @@
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt index 8d89d44b4d..55e0425009 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/clubs-add-modify.tt @@ -84,8 +84,12 @@
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt index 73b3b4348b..acdbfe7514 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/clubs/templates-add-modify.tt @@ -97,8 +97,12 @@
  • If set, only librarians logged in with this branch will be able to modify this club template.
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt index f3c14cc6fc..2ccd534ccb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt @@ -191,7 +191,11 @@
  • + [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %] + [% SET branches = Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => branchcode_filter, only_from_group => 1 ) %] + [% ELSE %] [% SET branches = Branches.all( selected => branchcode_filter, only_from_group => 1 ) %] + [% END %] + [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %] + [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => userbranch, only_from_group => 1 ) %] + [% ELSE %] [% PROCESS options_for_libraries libraries => Branches.all( selected => userbranch, only_from_group => 1 ) %] + [% END %] Required
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tt index af06dc3e35..099ce5ed2a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tt @@ -1,3 +1,4 @@ +[% USE Branches %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] [% IF ( do_it ) %]Acquisitions statistics › Results[% ELSE %]Acquisitions statistics[% END %] › Reports › Koha @@ -178,7 +179,9 @@ +
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt index 4ec821bc6d..b8faba7779 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/cash_register_stats.tt @@ -108,7 +108,9 @@
  • +
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_out.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_out.tt index 522f5cbcca..175ef9d590 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_out.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_out.tt @@ -105,8 +105,12 @@
    1. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt index f976f1cffe..f88c0659ae 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_avg_stats.tt @@ -173,8 +173,12 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tt index ddf42c2bec..a03ee01416 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tt @@ -203,8 +203,12 @@ @@ -268,8 +272,12 @@ @@ -278,8 +286,12 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt index 11552c85fb..d738bbca17 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt @@ -149,8 +149,12 @@
    2. + [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %] + [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %] + [% ELSE %] [% PROCESS options_for_libraries libraries => Branches.all() %] + [% END %] + [% UNLESS Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %] Select none to see all libraries + [% END %]
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tt index dabfe169ea..db77a0c904 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tt @@ -188,8 +188,12 @@ @@ -198,8 +202,12 @@ @@ -208,8 +216,12 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt index dd7c0e23ce..5bd96ca0b4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt @@ -95,8 +95,12 @@ Library:
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt index cdd8861dae..cefff1149f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt @@ -47,8 +47,12 @@ [% IF can_change_library %]
  • [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt index 789596e4ec..ecd3a5531b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt @@ -149,7 +149,14 @@ fieldset.rows table { clear: none; margin: 0; }
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt index 416623a846..70994f59e3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -579,8 +579,12 @@
  • @@ -666,8 +670,12 @@ [% IF ( displayby != "branchcode" ) %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt index 04b7bc801c..918ddf5f9c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt @@ -137,7 +137,11 @@
  • + [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %] + + [% ELSE %] + [% END %]
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt index 153ffd3a09..f5b8749a58 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt @@ -253,10 +253,16 @@
  • [% borrower_field.field | html %]
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt index 8edc3739b4..478448a312 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt @@ -98,8 +98,12 @@ Current library
  • [% IF (authorised_values) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc index dad168a4ef..a891d9e0d5 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc @@ -45,6 +45,7 @@ [% FOREACH facet IN facets_loo.facets %] [% 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 %] [% IF facets_loo.type_label_Language %][% SET facet.facet_label_value = Languages.GetByISOCode(lang,facet.facet_label_value) || facet.facet_label_value %][% END %] + [% IF ( facets_loo.type_label_HomeLibrary || facets_loo.type_label_HoldingLibrary ) && opac_name && Koha.Preference('IndependentBranchesHideOtherBranchesItems') && facet.facet_link_value != opac_name %][% NEXT %][% END %] [% IF loop.count > 5 && !facet.active %]