From 280a5b1e5a10940117d3ee6e541f1c2de3750afa Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Sun, 28 Feb 2021 16:18:45 +0000 Subject: [PATCH] Bug 26247: Make search terms optionally sticky This patch adds a configurable option for retaining stickiness of search terms across search tabs To test: 1 - Apply all patches except this one, enable StaffRetainSearchTerms 2 - Search in staff client from header 3 - Confirm behaviour is that term is retained, but not copied when switching header search tab 4 - Apply this patch, updatedatabase 5 - Search again 6 - Previous behaviour is restored, search terms are sticky between tabs 7 - Disable preference StaffStickySearchTerms 8 - Search again 9 - Search terms retained, but not sticky --- installer/data/mysql/mandatory/sysprefs.sql | 1 + koha-tmpl/intranet-tmpl/prog/en/includes/catalog-search-box.inc | 4 ++++ .../intranet-tmpl/prog/en/modules/admin/preferences/searching.pref | 7 +++++++ 3 files changed, 12 insertions(+) diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index a1c2cae039..e577977cb8 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -625,6 +625,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('StaffRetainSearchTerms', '1', NULL, 'If enabled, searches entered into the search bar will be retained', 'YesNo'), ('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'), ('StaffSerialIssueDisplayCount','3','','Number of serial issues to display per subscription in the staff interface','Integer'), +('StaffStickySearchTerms', '1', NULL, 'If enabled, searches entered into the search bar will be copied to other header tabs', 'YesNo'), ('StaticHoldsQueueWeight','0',NULL,'Specify a list of library location codes separated by commas -- the list of codes will be traversed and weighted with first values given higher weight for holds fulfillment -- alternatively, if RandomizeHoldsQueueWeight is set, the list will be randomly selective','Integer'), ('StatisticsFields','location|itype|ccode', NULL, 'Define Fields (from the items table) used for statistics members','Free'), ('StockRotation','0',NULL,'If ON, enables the stock rotation module','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/catalog-search-box.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/catalog-search-box.inc index 7eca35f0b1..88453ac250 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/catalog-search-box.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/catalog-search-box.inc @@ -7,7 +7,11 @@ [% ELSE %] [% END %] + [% IF ( Koha.Preference('StaffStickySearchTerms') ) %] + + [% ELSE %] + [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref index fc40ab7b52..5babcaba9c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -268,6 +268,13 @@ Searching: no: "don't retain" - search terms between searches. - + - When searching from the header in the staff client + - pref: StaffStickySearchTerms + choices: + yes: "copy" + no: "don't copy" + - search terms between search tabs. + - - pref: BiblioItemtypeInfo choices: yes: "Display" -- 2.11.0