Bug 26247: Adding 2 Sysprefs for Search Terms
authorFlorian Bontemps <florian.bontemps@biblibre.com>
Tue, 28 Jun 2022 13:42:46 +0000 (13:42 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 12 Sep 2022 19:45:08 +0000 (16:45 -0300)
commit8fae3c2069a8d81c458d9f755fbbd442f42d009e
tree632def5ba6e3a2a6f68078aa463ffabfe6987295
parente4455a589372e3205f9a7456478ad4585c90bedb
Bug 26247: Adding 2 Sysprefs for Search Terms

This patch adds two system preferences options : 'RetainCatalogSearchTerms' and 'RetainPatronsSearchTerms'. If enabled, search terms will be retained between searches made from, respectively, the Search Catalog header and the Checkout or Search Patrons headers. If disabled, the searchbars will clear out between page loads.

Attention, this is an alternate solution from the previous patches, ONLY apply this patch when testing and not the previous ones.Changed the syspref wording as well.

To test:
1 - From the staff client, search some terms using the Check out header search bar.
2 - Confirm search terms are retained.
3 - Do Step 1-2 twice again, this time using the Search patrons and Search the catalog.
4 - Apply patch (again, only this one), update database.
5 - In the system preferences, look for RetainCatalogSearchTerms and set it to 'don't retain'.
6 - Use the checkout head search bar again, confirm that search terms aren't retained after page load.
7 - Do Step 5-6 once again, this time with the RetainPatronsSearchTerms and the Search Patrons and Search the catalog headers.
8 - Search boxes should be cleared.

Thanks-to: Fridolin Somers and Nick Clemens for the bases I built on.
Signed-off-by: Florian Bontemps <florian.bontemps@biblibre.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
installer/data/mysql/atomicupdate/bug_26247-add_RetainCatalogSearchTerms_syspref.pl [new file with mode: 0755]
installer/data/mysql/atomicupdate/bug_26247-add_RetainPatronsSearchTerms_syspref.pl [new file with mode: 0755]
installer/data/mysql/mandatory/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/includes/catalogue-search-box.inc
koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref