From 3175425f9eabc9f2739e70f629b12cbe58ab66cd 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 ++++++ C4/XSLT.pm | 4 ++++ Koha/Template/Plugin/Branches.pm | 5 +++-- Koha/UI/Form/Builder/Item.pm | 6 +++++- catalogue/MARCdetail.pl | 2 ++ catalogue/export.pl | 13 +++++++++++++ catalogue/issuehistory.pl | 8 ++++++-- catalogue/itemsearch.pl | 13 ++++++++++++- catalogue/search.pl | 3 +++ cataloguing/additem.pl | 1 + 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 | 1 - .../intranet-tmpl/prog/en/modules/acqui/invoices.tt | 4 ++++ .../prog/en/modules/admin/preferences/admin.pref | 7 +++++++ .../prog/en/modules/catalogue/advsearch.tt | 3 +++ .../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 | 6 +++++- .../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 | 3 +++ tools/export.pl | 10 +++++++++- tools/modborrowers.pl | 6 +++++- 54 files changed, 281 insertions(+), 20 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_28642.perl diff --git a/C4/Context.pm b/C4/Context.pm index b42f933b08..30bdd07189 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -900,8 +900,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 a7f06dd876..bd477bb765 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -773,6 +773,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}; } @@ -870,7 +872,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 85a02bf5a2..f08f0b3ff0 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1818,6 +1818,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/C4/XSLT.pm b/C4/XSLT.pm index ca25d0db30..a0fa15baad 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -337,6 +337,10 @@ sub buildKohaItemsNamespace { $items_rs = Koha::Items->new; } + if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) { + $query->{'me.homebranch'} = C4::Context->userenv->{branch}; + } + my $items = $items_rs->search( $query, { prefetch => [ 'branchtransfers', 'reserves' ] } ); my $shelflocations = diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm index 981c5b413d..5b6a4cce8a 100644 --- a/Koha/Template/Plugin/Branches.pm +++ b/Koha/Template/Plugin/Branches.pm @@ -103,8 +103,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/Koha/UI/Form/Builder/Item.pm b/Koha/UI/Form/Builder/Item.pm index 5efe6ed796..afb12861fd 100644 --- a/Koha/UI/Form/Builder/Item.pm +++ b/Koha/UI/Form/Builder/Item.pm @@ -470,8 +470,12 @@ sub edit_form { my $branch_limit = $params->{branch_limit}; my $default_branches_empty = $params->{default_branches_empty}; + my $libraries_filter = {}; + if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') ) { + $libraries_filter->{branchcode} = C4::Context->userenv->{branch}; + } my $libraries = - Koha::Libraries->search( {}, { order_by => ['branchname'] } )->unblessed; + Koha::Libraries->search( $libraries_filter, { order_by => ['branchname'] } )->unblessed; for my $library (@$libraries) { $library->{selected} = 1 if $branchcode && $library->{branchcode} eq $branchcode; } diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index 4ff6a03c54..6fd4dd58b8 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 4f361367bf..1ea4228e90 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', } )->as_list; 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 e18524307c..dfcb14bd52 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'); @@ -276,7 +283,11 @@ if ( defined $format ) { # Display the search form -my @branches = map { value => $_->branchcode, label => $_->branchname }, Koha::Libraries->search( {}, { order_by => 'branchname' } )->as_list; +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' } )->as_list; my @itemtypes = map { value => $_->itemtype, label => $_->translated_description }, Koha::ItemTypes->search_with_localization->as_list; my @ccodes = Koha::AuthorisedValues->get_descriptions_by_koha_field({ kohafield => 'items.ccode' }); diff --git a/catalogue/search.pl b/catalogue/search.pl index ef7f49088f..897cf40293 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -173,6 +173,9 @@ my @limits = map uri_unescape($_), $cgi->multi_param("limit"); my @nolimits = map uri_unescape($_), $cgi->multi_param('nolimit'); my %is_nolimit = map { $_ => 1 } @nolimits; @limits = grep { not $is_nolimit{$_} } @limits; +if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && ! grep { /^(multi|home|holding)?branch/ } @limits ) { + push @limits, 'homebranch: '. C4::Context->userenv->{branch}; +} if ( !$cgi->param('edit_search') && ( (@limits>=1) || (defined $cgi->param("q") && $cgi->param("q") ne "" ) || ($cgi->param('limit-yr')) ) diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index b7508db1a7..b8643710c6 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -509,6 +509,7 @@ if ($op) { my @items; for my $item ( $biblio->items->as_list, $biblio->host_items->as_list ) { + next if ( C4::Context->only_my_library('IndependentBranchesHideOtherBranchesItems') && $item->homebranch ne C4::Context->userenv->{branch} ); push @items, $item->columns_to_str; } diff --git a/circ/overdue.pl b/circ/overdue.pl index 178ec03041..2980b48ac4 100755 --- a/circ/overdue.pl +++ b/circ/overdue.pl @@ -80,6 +80,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 1b029aa5ee..8f3a2c92f4 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -270,6 +270,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..8ac388e084 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 || facets_loo.type_label_HoldingLibrary ) && Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) && facet.facet_link_value != Branches.GetLoggedInBranchcode() ) %][% NEXT %][% END %] [% IF loop.count > 5 && !facet.active %]
  • + [% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %] + [% PROCESS options_for_libraries libraries => Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() }, selected => branch, unfiltered => 1 ) %] + [% ELSE %] [%# FIXME Should not we filter the libraries %] [% PROCESS options_for_libraries libraries => Branches.all( selected => branch, unfiltered => 1 ) %] + [% END %]
  • 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 2eab55ae03..9fcaaec56d 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 @@ -124,6 +124,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 23ef320fb6..a9c6264cdf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt @@ -281,6 +281,9 @@

    + [% 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 %]

  • @@ -245,7 +253,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 6eeb9f65c6..f0aede0477 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 @@ -244,8 +244,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 0cd62451bf..2e6c98cff5 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 @@ -86,8 +86,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 c74f614aad..00cadb173f 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 418bdfbccd..25c871f14c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt @@ -6,7 +6,11 @@ [% USE Categories %] [% SET footerjs = 1 %] [% PROCESS 'patronfields.inc' %] -[% SET libraries = Branches.all %] +[% IF Branches.InIndependentBranchesMode({syspref=>'IndependentBranchesHideOtherBranchesItems'}) %] + [% SET libraries = Branches.all( search_params => { branchcode => Branches.GetLoggedInBranchcode() } ) %] +[% ELSE %] + [% SET libraries = Branches.all %] +[% END %] [% SET categories = Categories.all.unblessed %] [% SET columns = ['cardnumber', 'name-address', 'dateofbirth', 'branch', 'category', 'dateexpiry', 'checkouts', 'account_balance', 'borrowernotes', 'action'] %] [% PROCESS 'patron-search.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index d01b2316bc..96800b8ca3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -902,7 +902,11 @@ legend:hover {
  • 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 aa41d41a16..62399535b4 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 @@ -180,7 +181,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 2e3bc98874..c21e5ec433 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 0cf4e3fdac..718d3e019a 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 @@ -181,8 +181,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 46dc8ac727..f91c0efcda 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 @@ -205,8 +205,12 @@ @@ -270,8 +274,12 @@ @@ -280,8 +288,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 181fb4e188..cc26cf05bc 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 @@ -208,8 +208,12 @@ @@ -218,8 +222,12 @@ @@ -228,8 +236,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 f8d2304cfc..42efaab0dd 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 42f2f42626..180a86b5c7 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 23c0a851a8..1e3d133d4e 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 22f161aea8..fbc05efe67 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 4e3924ce0a..34c1b8519f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/export.tt @@ -139,7 +139,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 1446b72b27..064a89599f 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 @@ -252,10 +252,16 @@
  • [% borrower_db_column | 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 9aacf152de..d8c0d24059 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt @@ -99,8 +99,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 5e6e638c0b..3940d4ab54 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 %]