From 5de9b2f2a042dcf540c34be096d0821a52c3675d Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 26 Feb 2025 23:17:07 +0000 Subject: [PATCH] Bug Bug 37883: Adjust template for new system preference --- .../prog/en/modules/catalogue/results.tt | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index 53e1360e2e3..72cbc5fa7ba 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -554,7 +554,9 @@ [% ELSE # /IF scan %]
[% INCLUDE 'page-numbers.inc' %] - + [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %] + + [% END %]
[% IF ( searchdesc ) %] [% FOREACH QUERY_INPUT IN QUERY_INPUTS %] @@ -754,7 +756,7 @@ , None available [% END %]
- [% IF SEARCH_RESULT.branchtotalcount > 0 %] + [% IF SEARCH_RESULT.branchtotalcount > 0 && Koha.Preference('FilterSearchResultsByLoggedInBranch') %]
[% tnx('{count} item', '{count} items', SEARCH_RESULT.branchtotalcount, {count = SEARCH_RESULT.branchtotalcount}) | html %][% IF ( SEARCH_RESULT.branchavailablecount ) %] , [% SEARCH_RESULT.branchavailablecount | html %] available: @@ -789,12 +791,16 @@ [% IF status_count == "onloancount" %] [% IF SEARCH_RESULT.${status_count} > 0 %]
[% SEARCH_RESULT.${status_count} | html %] checked out:
-
[% SEARCH_RESULT.branchonloancount | html %] checked out:
+ [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %] +
[% SEARCH_RESULT.branchonloancount | html %] checked out:
+ [% END %] [% END %] [% ELSIF status_count == "othercount" %] [% IF SEARCH_RESULT.${status_count} > 0 %]
[% SEARCH_RESULT.${status_count} | html %] unavailable:
-
[% SEARCH_RESULT.branchothercount | html %] unavailable:
+ [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %] +
[% SEARCH_RESULT.branchothercount | html %] unavailable:
+ [% END %] [% END %] [% END %] [% IF SEARCH_RESULT.${items_loop}.size > 0 %] @@ -875,7 +881,7 @@ No items [% END %] [% END # /IF ( SEARCH_RESULT.items_count ) %] - [% IF SEARCH_RESULT.branchtotalcount == 0 %] + [% IF SEARCH_RESULT.branchtotalcount == 0 && Koha.Preference('FilterSearchResultsByLoggedInBranch') %] No items [% END %]
@@ -963,16 +969,18 @@ var holdfor_cardnumber = "[% holdfor_patron.cardnumber | html %]"; var holdforclub = "[% holdforclub | html %]"; var userbranch = "[% userbranch | html %]"; - $('#toggleitems').click( function() { - $('#toggleitems').text() === 'Show local items only' ? $('#toggleitems').text("Show items in all libraries") : $('#toggleitems').text("Show local items only"); - $('.branch_specific').toggle(); - $('.all').toggle(); - $('ul[class*="_loop_items"] li').each( function() { - if ( !$(this).hasClass(userbranch) ) { - $(this).toggle(); - } + [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %] + $('#toggleitems').click( function() { + $('#toggleitems').text() === 'Show local items only' ? $('#toggleitems').text("Show items in all libraries") : $('#toggleitems').text("Show local items only"); + $('.branch_specific').toggle(); + $('.all').toggle(); + $('ul[class*="_loop_items"] li').each( function() { + if ( !$(this).hasClass(userbranch) ) { + $(this).toggle(); + } + }); }); - }); + [% END %] [% IF SEARCH_RESULTS %] var SEARCH_RESULTS = 1; [% ELSE %] -- 2.39.5