Bugzilla – Attachment 171289 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 37883: Use Cookie to remember last selection
Bug-37883-Use-Cookie-to-remember-last-selection.patch (text/plain), 2.80 KB, created by
Lucas Gass (lukeg)
on 2024-09-10 20:24:22 UTC
(
hide
)
Description:
Bug 37883: Use Cookie to remember last selection
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-09-10 20:24:22 UTC
Size:
2.80 KB
patch
obsolete
>From f451adc6f65f7a9a4664022ff0eeb3c2300b0de4 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 10 Sep 2024 20:23:45 +0000 >Subject: [PATCH] Bug 37883: Use Cookie to remember last selection > >--- > .../prog/en/modules/catalogue/results.tt | 16 ++++++++++++++-- > 1 file changed, 14 insertions(+), 2 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 d23efc5ee9a..1203a0ab7cb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -452,7 +452,7 @@ > <div id="searchresults"> > [% INCLUDE 'page-numbers.inc' %] > [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %] >- <button href="#" id="toggleitems" class="btn btn-primary btn-xs" style="float: right;">Show local items only</button> >+ <button href="#" id="toggleitems" class="btn btn-primary btn-xs show-local-items" 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 ) %] >@@ -833,8 +833,13 @@ > var userbranch = "[% userbranch | html %]"; > > [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %] >+ $(document).ready( function() { >+ if ( Cookies.get("show_local_items") == 'local' ) { >+ $('#toggleitems').click(); >+ } >+ }); > $('#toggleitems').click( function() { >- $('#toggleitems').text() === 'Show local items only' ? $('#toggleitems').text("Show items in all libraries") : $('#toggleitems').text("Show local items only"); >+ $('#toggleitems').text($('#toggleitems').text() === 'Show local items only' ? 'Show items in all libraries' : 'Show local items only'); > $('.branch_specific').toggle(); > $('.all').toggle(); > $('ul[class*="_loop_items"] li').each( function() { >@@ -842,6 +847,13 @@ > $(this).toggle(); > } > }); >+ >+ $(this).toggleClass('show-local-items show-all-items'); >+ if ($(this).hasClass('show-local-items')) { >+ Cookies.set("show_local_items", 'all', { path: '/', sameSite: 'Lax' }); >+ } else { >+ Cookies.set("show_local_items", 'local', { path: '/', sameSite: 'Lax' }); >+ } > }); > [% END %] > [% IF SEARCH_RESULTS %] >-- >2.39.2
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