Bugzilla – Attachment 178776 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 localStorage to remember user selection
Bug-37883-Use-localStorage-to-remember-user-select.patch (text/plain), 3.11 KB, created by
Lucas Gass (lukeg)
on 2025-02-26 23:30:56 UTC
(
hide
)
Description:
Bug 37883: Use localStorage to remember user selection
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-02-26 23:30:56 UTC
Size:
3.11 KB
patch
obsolete
>From c7959b07d0732b70fb52aa225348dd7bc6a8c077 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Wed, 26 Feb 2025 23:28:17 +0000 >Subject: [PATCH] Bug 37883: Use localStorage to remember user selection > >--- > .../prog/en/modules/catalogue/results.tt | 13 ++++++++++++- > koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 1 + > 2 files changed, 13 insertions(+), 1 deletion(-) > >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 72cbc5fa7ba..0957aaa67cd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -555,7 +555,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 ) %] >@@ -970,6 +970,11 @@ > var holdforclub = "[% holdforclub | html %]"; > var userbranch = "[% userbranch | html %]"; > [% IF Koha.Preference('FilterSearchResultsByLoggedInBranch') %] >+ $(document).ready( function() { >+ if (localStorage.getItem("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"); > $('.branch_specific').toggle(); >@@ -979,6 +984,12 @@ > $(this).toggle(); > } > }); >+ $(this).toggleClass('show-local-items show-all-items'); >+ if ($(this).hasClass('show-local-items')) { >+ localStorage.setItem("show_local_items", 'all'); >+ } else { >+ localStorage.setItem("show_local_items", 'local'); >+ } > }); > [% END %] > [% IF SEARCH_RESULTS %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >index ff9f29b371c..25a4b0c5376 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js >@@ -504,6 +504,7 @@ function logOut() { > localStorage.removeItem("patron_search_selections"); > localStorage.removeItem("item_search_selections"); > localStorage.removeItem("copiedPermissions"); >+ localStorage.removeItem("show_local_items"); > > // Remove DataTables states > Object.keys(localStorage).forEach(k => { >-- >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