Summary: | Patron autocomplete should respect DefaultPatronSearchFields | ||
---|---|---|---|
Product: | Koha | Reporter: | Martin Renvoize (ashimema) <martin.renvoize> |
Component: | Staff interface | Assignee: | Martin Renvoize (ashimema) <martin.renvoize> |
Status: | CLOSED FIXED | QA Contact: | Katrin Fischer <katrin.fischer> |
Severity: | minor | ||
Priority: | P5 - low | CC: | barbara.johnson, gmcharlt |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
23.05.00,22.11.03
|
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 32772 | ||
Attachments: |
Bug 32520: Iterate search_fields
Bug 32520: Use DefaultPatronSearchFields in patron_autocomplete Bug 32520: Use DefaultPatronSearchFields in patron_autocomplete Bug 32520: Use DefaultPatronSearchFields in patron_autocomplete Bug 32520: Amend DefaultPatronSearchFields system preference description |
Description
Martin Renvoize (ashimema)
2022-12-23 10:13:39 UTC
Created attachment 144816 [details] [review] Bug 32520: Iterate search_fields This pretty much matches the iterators in koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc. Now we need to work out the best way to pass the DefaultPatronSearchFields preference into the search_fields variable.. Perhaps pass it as part of the options at function call time? Created attachment 144862 [details] [review] 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. Created attachment 144868 [details] [review] 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 <barbara.johnson@bedfordtx.gov> I am not sure if the change from 'starts with' to 'contains' will cause any issues, but this works as described now. :) Created attachment 144878 [details] [review] 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 <barbara.johnson@bedfordtx.gov> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 144879 [details] [review] Bug 32520: Amend DefaultPatronSearchFields system preference description Tries to clarify that the preference is not only used for the search in the patrons module, but also in circulation. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Pushed to master for 23.05. Nice work everyone, thanks! Nice work everyone! Pushed to stable for 22.11.x |