From 88b99dca3d34d74a967d0a97db577d1c1f39ed71 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 18 Feb 2021 16:37:37 +0000 Subject: [PATCH] Bug 27725: Use JavaScript to set history state during patron search This patch modifies the patron search page so that clicks on the "Browse by last name" letters add an entry to the browser history, allowing the user to click back and forth from results while preserving their search. To test, apply the patch and go to Patrons in the staff interface. - Click one of the "Browse by last name" letters. - The table of search results should load the correct data. - In the browser's location bar you should see a query string added to the URL, e.g. /cgi-bin/koha/members/members-home.pl?firstletter=Q - Click another letter. - Click the back button. You should be returned to the search results for your first letter choice. - Clicking the forward button should work correctly as well. - Other patron searches (header search, sidebar search) should continue to work as expected. EDIT: Clear single-letter querystring history item if only one result was returned. --- .../prog/en/modules/members/member.tt | 30 ++++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) 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 2ab9c823a2..5cd93fc367 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt @@ -195,6 +195,13 @@ [% Asset.js("lib/hc-sticky.js") | $raw %] [% Asset.js("js/members-menu.js") | $raw %]