From 6ea0111ef80636e90a390bc788113a561ea581e8 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 22 Jun 2023 12:38:04 +0100 Subject: [PATCH] Bug 33117: (follow-up) Rename preference As it's been requested that we keep the search defaults consistent, I think this preference is better names DefaultPatronSearchMethod and appear next to DefaultPatronSearchFields. This patch makes that change, though actually applying it to the other search area's (outside of autocomplete) has been left for another bug. Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi (cherry picked from commit c50fab16b50850589017c4902138eee74c482caf) Signed-off-by: Martin Renvoize --- installer/data/mysql/atomicupdate/bug_33117.pl | 4 ++-- installer/data/mysql/mandatory/sysprefs.sql | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc | 2 +- .../prog/en/modules/admin/preferences/circulation.pref | 6 ------ .../prog/en/modules/admin/preferences/patrons.pref | 6 ++++++ koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_33117.pl b/installer/data/mysql/atomicupdate/bug_33117.pl index 03e9ab6787..4d1eac19c5 100644 --- a/installer/data/mysql/atomicupdate/bug_33117.pl +++ b/installer/data/mysql/atomicupdate/bug_33117.pl @@ -9,9 +9,9 @@ return { $dbh->do(q{ INSERT INTO systempreferences (`variable`,`value`,`explanation`,`options`,`type`) - VALUES ('PatronAutoCompleteSearchMethod','starts_with','Allows staff to set a default method when searching for patrons with autocomplete','starts_with|contains','Choice'); + VALUES ('DefaultPatronSearchMethod','starts_with','Allows staff to set a default method when searching for patrons with autocomplete','starts_with|contains','Choice'); }); - say $out "Added new system preference 'PatronAutoCompleteSearchMethod'"; + say $out "Added new system preference 'DefaultPatronSearchMethod'"; }, }; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 5902301ee1..713beb5f85 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -184,6 +184,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('DefaultLongOverdueDays', '', NULL, "Set the LOST value of an item when the item has been overdue for more than n days.", 'integer'), ('DefaultLongOverdueLostValue', '', NULL, "Set the LOST value of an item to n when the item has been overdue for more than defaultlongoverduedays days.", 'integer'), ('DefaultPatronSearchFields', 'firstname,middle_name,surname,othernames,cardnumber,userid',NULL,'Comma separated list defining the default fields to be used during a patron search using the "standard" option. If empty Koha will default to "firstname,surname,othernames,cardnumber,userid". Additional fields added to this preference will be added as search options in the dropdown menu on the patron search page.','free'), +('DefaultPatronSearchMethod','starts_with','Choose which search method to use by default when searching with PatronAutoComplete','starts_with|contains','Choice'), ('DefaultSaveRecordFileID','biblionumber','biblionumber|controlnumber','Defines whether the advanced cataloging editor will use the bibliographic record number or control number field to populate the name of the save file','Choice'), ('defaultSortField','relevance','relevance|popularity|call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'), ('defaultSortOrder','dsc','asc|dsc|az|za','Specify the default sort order','Choice'), @@ -551,7 +552,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('PassItemMarcToXSLT','0',NULL,'If enabled, item fields in the MARC record will be made avaiable to XSLT sheets. Otherwise they will be removed.','YesNo'), ('PatronAnonymizeDelay','',NULL,'Delay for anonymizing patrons', 'Integer'), ('PatronAutoComplete','1','Try|Don\'t try','to guess the patron being entered while typing a patron search for circulation or patron search. Only returns the first 10 results at a time.','YesNo'), -('PatronAutoCompleteSearchMethod','starts_with','Choose which search method to use by default when searching with PatronAutoComplete','starts_with|choice','Choice'), ('PatronDuplicateMatchingAddFields','surname|firstname|dateofbirth', NULL,'A list of fields separated by "|" to deduplicate patrons when created','Free'), ('patronimages','0',NULL,'Enable patron images for the staff interface','YesNo'), ('PatronRemovalDelay','',NULL,'Delay for removing anonymized patrons', 'Integer'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc index 3ea7f705ff..a5159b0150 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc @@ -71,7 +71,7 @@ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index a00ebdcc5b..523d5279d5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -26,12 +26,6 @@ Circulation: 0: "Don't try" - to guess the patron being entered while typing a patron search for circulation or patron search. - Only returns the first 10 results at a time. - - - - pref: PatronAutoCompleteSearchMethod - choices: - starts_with: "Starts with" - contains: "Contains" - - Enable this search method to determine whether to use Starts with or Contains for autocomplete patron searches. - - pref: itemBarcodeInputFilter choices: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index fa71e787e7..32cd34f706 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -60,6 +60,12 @@ Patrons: - pref: DefaultPatronSearchFields class: multi - "If empty Koha will default to \"firstname,middle_name,surname,othernames,cardnumber,userid\". Additional fields added to this preference will be added as search options in the dropdown menu on the patron search page." + - + - pref: DefaultPatronSearchMethod + choices: + starts_with: "Starts with" + contains: "Contains" + - Enable this search method to determine whether to use Starts with or Contains for autocomplete patron searches. - - "Show the following fields from the items database table as columns on the statistics tab on the patron record: " - pref: StatisticsFields diff --git a/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js b/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js index 167928dd3f..caed62ba8e 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js +++ b/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js @@ -2,7 +2,7 @@ function patron_autocomplete(node, options) { let link_to; let url_params; let on_select_callback; - let leading_wildcard = patronAutoCompleteSearchMethod === 'contains' ? '%' : ''; + let leading_wildcard = defaultPatronSearchMethod === 'contains' ? '%' : ''; if ( options ) { if ( options['link-to'] ) { link_to = options['link-to']; -- 2.39.5