Bugzilla – Attachment 140473 Details for
Bug 26247
Search terms retained in header search creates UX inconsistency
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26247: Adding 2 Sysprefs for Search Terms
Bug-26247-Adding-2-Sysprefs-for-Search-Terms.patch (text/plain), 9.33 KB, created by
Martin Renvoize
on 2022-09-12 16:10:27 UTC
(
hide
)
Description:
Bug 26247: Adding 2 Sysprefs for Search Terms
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2022-09-12 16:10:27 UTC
Size:
9.33 KB
patch
obsolete
>From bbf03889b0e2f04763c9d30ed3de3aa6183af717 Mon Sep 17 00:00:00 2001 >From: Florian Bontemps <florian.bontemps@biblibre.com> >Date: Tue, 28 Jun 2022 13:42:46 +0000 >Subject: [PATCH] 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> >--- > ...ug_26247-add_RetainCatalogSearchTerms_syspref.pl | 12 ++++++++++++ > ...ug_26247-add_RetainPatronsSearchTerms_syspref.pl | 12 ++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 2 ++ > .../prog/en/includes/catalogue-search-box.inc | 13 ++++++++----- > .../prog/en/includes/patron-search-header.inc | 4 ++++ > .../en/modules/admin/preferences/searching.pref | 12 ++++++++++++ > 6 files changed, 50 insertions(+), 5 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_26247-add_RetainCatalogSearchTerms_syspref.pl > create mode 100755 installer/data/mysql/atomicupdate/bug_26247-add_RetainPatronsSearchTerms_syspref.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_26247-add_RetainCatalogSearchTerms_syspref.pl b/installer/data/mysql/atomicupdate/bug_26247-add_RetainCatalogSearchTerms_syspref.pl >new file mode 100755 >index 0000000000..44637ca774 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_26247-add_RetainCatalogSearchTerms_syspref.pl >@@ -0,0 +1,12 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "26247", >+ description => "Add new system preference RetainCatalogSearchTerms", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('RetainCatalogSearchTerms', '1', NULL, 'If enabled, searches entered into the catalog search bar will be retained', 'YesNo') }); >+ }, >+}; >diff --git a/installer/data/mysql/atomicupdate/bug_26247-add_RetainPatronsSearchTerms_syspref.pl b/installer/data/mysql/atomicupdate/bug_26247-add_RetainPatronsSearchTerms_syspref.pl >new file mode 100755 >index 0000000000..dd6d842fa6 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_26247-add_RetainPatronsSearchTerms_syspref.pl >@@ -0,0 +1,12 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "26247", >+ description => "Add new system preference RetainPatronsSearchTerms", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('RetainPatronSearchTerms', '1', NULL, 'If enabled, searches entered into the checkout and patrons search bars will be retained', 'YesNo') }); >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 3ee50c6d93..67612e2288 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -605,6 +605,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('RestrictionBlockRenewing','0',NULL,'If patron is restricted, should renewal be allowed or blocked','YesNo'), > ('OPACResultsMaxItems','1','','Maximum number of available items displayed in search results','Integer'), > ('OPACResultsMaxItemsUnavailable','0','','Maximum number of unavailable items displayed in search results','Integer'), >+('RetainCatalogSearchTerms', '1', NULL, 'If enabled, searches entered into the catalog search bar will be retained', 'YesNo'), >+('RetainPatronsSearchTerms', '1', NULL, 'If enabled, searches entered into the checkout and patrons search bar will be retained', 'YesNo'), > ('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'), > ('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'), > ('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue-search-box.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue-search-box.inc >index aac61e803f..d960898c45 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue-search-box.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/catalogue-search-box.inc >@@ -3,10 +3,14 @@ > <div id="catalog_search" class="residentsearch"> > <form action="/cgi-bin/koha/catalogue/search.pl" method="get" id="cat-search-block"> > <label class="tip" for="search-form">Enter search keywords:</label> >- [% IF ( Koha.Preference('IntranetCatalogSearchPulldown') ) %] >- [% INCLUDE 'search_indexes.inc' $header_pulldown = 1 %] >- [% END %] >- <input type="text" name="q" id="search-form" size="40" value="[% ms_value | html %]" title="Enter the terms you wish to search for." class="query form-text head-searchbox" /> >+ [% IF ( Koha.Preference('IntranetCatalogSearchPulldown') ) %] >+ [% INCLUDE 'search_indexes.inc' $header_pulldown = 1 %] >+ [% END %] >+ [% IF ( Koha.Preference('RetainCatalogSearchTerms') ) %] >+ <input type="text" name="q" id="search-form" size="40" value="[% ms_value | html %]" title="Enter the terms you wish to search for." class="query form-text head-searchbox" /> >+ [% ELSE %] >+ <input type="text" name="q" id="search-form" size="40" title="Enter the terms you wish to search for." class="query form-text head-searchbox" /> >+ [% END %] > [% IF ( Koha.Preference('IntranetAddMastheadLibraryPulldown') ) %] > <select id="select_library" name="limit" style="margin-left:5px;"> > <option value="">All libraries</option> >@@ -14,7 +18,6 @@ > </select> > [% END %] > <input type="submit" value="Submit" class="submit" /> >- > </form> > </div> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc >index d800b9c239..12db22dfc6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-header.inc >@@ -11,7 +11,11 @@ > <form action="/cgi-bin/koha/members/member.pl" method="post"> > <label class="tip" for="searchmember">Enter patron card number or partial name:</label> > <div class="autocomplete"> >+ [% IF ( Koha.Preference('RetainPatronsSearchTerms') ) %] > <input id="searchmember" data-toggle="tooltip" size="25" class="head-searchbox" name="searchmember" type="text" value="[% searchmember | html %]" autocomplete="off" /> >+ [% ELSE %] >+ <input id="searchmember" data-toggle="tooltip" size="25" class="head-searchbox" name="searchmember" type="text" autocomplete="off" /> >+ [% END %] > <input type="hidden" name="quicksearch" value="1" /> > <span class="filteraction" id="filteraction_off"> <a href="#">[-]</a></span> > <span class="filteraction" id="filteraction_on"> <a href="#">[+]</a></span> >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 0997740dc0..71a7f64006 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 >@@ -276,6 +276,18 @@ Searching: > 1: "search" > 0: "don't search" > - on all variations of the ISSN. >+ - >+ - pref: RetainCatalogSearchTerms >+ choices: >+ 0: "Don't retain" >+ 1: "Retain" >+ - search terms between searches when searching from the 'search the catalog' tab in the staff interface header. >+ - >+ - pref: RetainPatronsSearchTerms >+ choices: >+ 0: "Don't retain" >+ 1: "Retain" >+ - search terms between searches when searching from the 'checkout' and 'search patrons' tab in the staff interface header. > - > - pref: BiblioItemtypeInfo > choices: >-- >2.20.1
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 26247
:
117408
|
117409
|
117410
|
117411
|
117461
|
117535
|
117536
|
117537
|
117538
|
117539
|
120353
|
120354
|
120355
|
120356
|
120357
|
120358
|
120359
|
120360
|
136683
|
136767
|
137310
|
138478
| 140473 |
140474