Bugzilla – Attachment 133751 Details for
Bug 21978
Add middle name field
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30576: Use DefaultPatronSearchFields in patron search
Bug-30576-Use-DefaultPatronSearchFields-in-patron-.patch (text/plain), 5.22 KB, created by
Martin Renvoize (ashimema)
on 2022-04-25 11:49:17 UTC
(
hide
)
Description:
Bug 30576: Use DefaultPatronSearchFields in patron search
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-04-25 11:49:17 UTC
Size:
5.22 KB
patch
obsolete
>From da72fa38bca9c0a4b22f684afeed3a2cd9276a05 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 21 Apr 2022 12:52:32 +0100 >Subject: [PATCH] Bug 30576: Use DefaultPatronSearchFields in patron search > >This patch corrects the handling of the 'Standard' search field in >patron searches such that it accurately reflects the contents of the >DefaultPatronSearchFields system preference and falls back to a hard >coded list instead of always using the hard coded list. > >To test: >1) Empty the contents of DefaultPatronSearchFields systempreference >2) Perform a patron search from the header search >3) Inspect the patrons API request and note that we search on the > default fallback fields of firstname, surname, othernames, > cardnumber and userid (and some extended attributes which are > historically hard coded). >4) Navigate to the memebers-home by clicking the 'Patrons' button from > the main page >5) Perform another search using the filters on the left with 'Standard' > selected. >6) Note the same list of search fields used as above in the patrons API > request. >7) Update the DefaultPatronSearchFields systempreference adding one or > more borrower fields in a comma delimited list. >8) Repeat steps 2 -> 6 but this time upon inspecting the API request you > should find that only the fields in your DefaultPatronSearchFields > list are searched (along with the hard coded extended attributes > list). >9) Signoff > >https://bugs.koha-community.org/show_bug.cgi?id=21978 >--- > .../intranet-tmpl/prog/en/includes/patron-search-header.inc | 5 ++--- > koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc | 5 ++--- > koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc | 2 +- > 3 files changed, 5 insertions(+), 7 deletions(-) > >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 e7368bd8d2..5a1df7600e 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 >@@ -23,9 +23,8 @@ > <div id="filters"> > <p><label for="searchfieldstype">Search fields:</label> > <select name="searchfieldstype" id="searchfieldstype"> >- [% pref_fields = Koha.Preference('DefaultPatronSearchFields').split(',') %] >- [% default_fields = [ 'firstname,surname,othernames,cardnumber,userid', 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %] >- [% search_options = default_fields.merge(pref_fields).unique %] >+ [% SET standard = Koha.Preference('DefaultPatronSearchFields') || 'firstname,surname,othernames,cardnumber,userid' %] >+ [% SET search_options = [ standard, 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %] > [% FOREACH s_o IN search_options %] > [% display_name = PROCESS patron_fields name=s_o %] > [% NEXT IF !display_name.length %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >index de738dab2b..07997bf945 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >@@ -60,9 +60,8 @@ > <li> > <label for="searchfieldstype_filter">Search field:</label> > <select name="searchfieldstype" id="searchfieldstype_filter"> >- [% pref_fields = Koha.Preference('DefaultPatronSearchFields').split(',') %] >- [% default_fields = [ 'firstname,surname,othernames,cardnumber,userid', 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %] >- [% search_options = default_fields.merge(pref_fields).unique %] >+ [% SET standard = Koha.Preference('DefaultPatronSearchFields') || 'firstname,surname,othernames,cardnumber,userid' %] >+ [% SET search_options = [ standard, 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %] > [% FOREACH s_o IN search_options %] > [% display_name = PROCESS patron_fields name=s_o %] > [% NEXT IF !display_name %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc >index 5e1c58f38e..416a5ae26c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc >@@ -1,6 +1,6 @@ > [%- BLOCK patron_fields -%] > [%- SWITCH name -%] >- [%- CASE 'firstname,surname,othernames,cardnumber,userid' -%]<span>Standard</span> >+ [%- CASE standard -%]<span>Standard</span> > [%- CASE 'borrowernumber' -%]<span>Borrowernumber</span> > [%- CASE 'cardnumber' -%]<span>Card number</span> > [%- CASE 'surname' -%]<span>Surname</span> >-- >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 21978
:
133431
|
133432
|
133433
|
133434
|
133435
|
133436
|
133437
|
133438
|
133453
|
133454
|
133455
|
133456
|
133534
|
133535
|
133536
|
133537
|
133544
|
133545
|
133546
|
133547
|
133751
|
133752
|
133753
|
133754
|
133755
|
133756
|
133757
|
134254
|
134255
|
134256
|
134257
|
134258
|
134259
|
134495
|
134497
|
134498
|
134499
|
134500
|
134501
|
134502
|
134503
|
134745
|
134746
|
134747
|
134748
|
134749
|
134750
|
134751
|
135147
|
135148
|
135149
|
135150
|
135151
|
135152
|
135153
|
135154
|
135155
|
135180
|
135181
|
135182
|
135183
|
135184
|
135185
|
135186
|
135187
|
135188
|
135189
|
136513
|
136514
|
136515
|
136516
|
136517
|
136518
|
136519
|
136520
|
136521
|
136522
|
137612