From d0ba3669903f29d2cfa0adaa2981ed5a5970f9b1 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 23 Dec 2022 11:32:12 +0000 Subject: [PATCH] Bug 32520: Use DefaultPatronSearchFields in patron_autocomplete This patch updates js_includes.inc to set a new global js variable `defaultPatronSearchFields` with the content of the corresponding system preference. We then update the patron_autocomplete function to use this new global variable and iterate in the same way as koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc. NOTE: This changes the behaviour of the autocomplete from always searching using contains on surname or firstname or starts with on cardnumber to searching using 'contains' on any of the fields listed in the DefaultPatronSearchFields system preference of defaulting to 'firstname,middle_name,surname,othernames,cardnumber,userid'. Test plan 1. Ensure autocomplete still works everywhere 2. Confirm the system preference fields are being used. Signed-off-by: Barbara Johnson Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 6898f1f132b5a01eb4c406fa711b3d13324ef538) Signed-off-by: Matt Blenkinsop --- .../prog/en/includes/js_includes.inc | 1 + .../intranet-tmpl/prog/js/patron-autocomplete.js | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) 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 f040b6ac11..2d1af01c4f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc @@ -71,6 +71,7 @@ [% IF ( PatronAutoComplete ) %]