Bugzilla – Attachment 178775 Details for
Bug 37883
Add a filter for staff search results to filter by library
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug Bug 37883: Adjust template for new system preference
Bug-Bug-37883-Adjust-template-for-new-system-prefe.patch (text/plain), 6.54 KB, created by
Lucas Gass (lukeg)
on 2025-02-26 23:17:51 UTC
(
hide
)
Description:
Bug Bug 37883: Adjust template for new system preference
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-02-26 23:17:51 UTC
Size:
6.54 KB
patch
obsolete
>From 5de9b2f2a042dcf540c34be096d0821a52c3675d Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >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 %] > <div id="searchresults"> > [% INCLUDE 'page-numbers.inc' %] >- <button href="#" id="toggleitems" class="btn btn-primary btn-xs" style="float: right;">Show local items only</button> >+ [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %] >+ <button href="#" id="toggleitems" class="btn btn-primary btn-xs" style="float: right;">Show local items only</button> >+ [% END %] > <form action="/cgi-bin/koha/catalogue/search.pl" method="get" name="bookbag_form" id="bookbag_form"> > [% IF ( searchdesc ) %] > [% FOREACH QUERY_INPUT IN QUERY_INPUTS %] >@@ -754,7 +756,7 @@ > , <span>None available</span> > [% END %] > </div> >- [% IF SEARCH_RESULT.branchtotalcount > 0 %] >+ [% IF SEARCH_RESULT.branchtotalcount > 0 && Koha.Preference('FilterSearchResultsByLoggedInBranch') %] > <div class="branch_specific"> > [% tnx('{count} item', '{count} items', SEARCH_RESULT.branchtotalcount, {count = SEARCH_RESULT.branchtotalcount}) | html %][% IF ( SEARCH_RESULT.branchavailablecount ) %] > , [% SEARCH_RESULT.branchavailablecount | html %] <span>available:</span> >@@ -789,12 +791,16 @@ > [% IF status_count == "onloancount" %] > [% IF SEARCH_RESULT.${status_count} > 0 %] > <div class="results_checkedout all">[% SEARCH_RESULT.${status_count} | html %] checked out:</div> >- <div class="results_checkedout branch_specific">[% SEARCH_RESULT.branchonloancount | html %] checked out:</div> >+ [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %] >+ <div class="results_checkedout branch_specific">[% SEARCH_RESULT.branchonloancount | html %] checked out:</div> >+ [% END %] > [% END %] > [% ELSIF status_count == "othercount" %] > [% IF SEARCH_RESULT.${status_count} > 0 %] > <div class="results_unavailable all">[% SEARCH_RESULT.${status_count} | html %] unavailable:</div> >- <div class="results_unavailable branch_specific">[% SEARCH_RESULT.branchothercount | html %] unavailable:</div> >+ [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %] >+ <div class="results_unavailable branch_specific">[% SEARCH_RESULT.branchothercount | html %] unavailable:</div> >+ [% END %] > [% END %] > [% END %] > [% IF SEARCH_RESULT.${items_loop}.size > 0 %] >@@ -875,7 +881,7 @@ > <span class="unavailable all">No items</span> > [% END %] > [% END # /IF ( SEARCH_RESULT.items_count ) %] >- [% IF SEARCH_RESULT.branchtotalcount == 0 %] >+ [% IF SEARCH_RESULT.branchtotalcount == 0 && Koha.Preference('FilterSearchResultsByLoggedInBranch') %] > <span class="unavailable branch_specific">No items</span> > [% END %] > </div> >@@ -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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37883
:
171256
|
171257
|
171261
|
171286
|
171287
|
171289
|
171291
|
171406
|
171407
|
171408
|
171409
|
171410
|
171411
|
176697
|
177306
|
177784
|
177785
|
177786
|
177787
|
177788
|
177789
|
177790
|
177791
|
178772
|
178773
|
178774
| 178775 |
178776
|
178777