Bugzilla – Attachment 146711 Details for
Bug 32770
Patron search field groups no longer exist
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32770: Restore patron search on all emails, phones, and addresses
Bug-32770-Restore-patron-search-on-all-emails-phon.patch (text/plain), 7.56 KB, created by
Jonathan Druart
on 2023-02-16 08:02:42 UTC
(
hide
)
Description:
Bug 32770: Restore patron search on all emails, phones, and addresses
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-02-16 08:02:42 UTC
Size:
7.56 KB
patch
obsolete
>From 8e8d84075a4850fdb2df4f2dfe1b74dc4951c062 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 1 Feb 2023 12:26:15 +0000 >Subject: [PATCH] Bug 32770: Restore patron search on all emails, phones, and > addresses > >Prior to bug 30063 we had "Email", "Phone", and "Address" in the search field list >that allowed a search on all email, phone, or address attributes. > >This patron restores these and makes sure the search box and the patron search filters use >the same block to keep them consistent > >The fields are now labelled 'All emails', 'All phones', and 'Full address' to make it clear >that they search multiple - including any single field in the DefaultPatronSearchFields will >additionally add that to the dropdowns > >To test: > 1 - define 'test@email.pro' as 'Secondary email' for a patron > 2 - Search from 'Search patrons' address bar (visible at top of moremember.pl) > 3 - Nothing is found using 'Standard' or 'Email fields' > 4 - Apply patch > 5 - Refresh page and repeat > 6 - Nothing is found for standard, Patron is found for 'All emails' > 7 - Define a unique value for patron in 'Address 2' > 8 - Confirm 'Full address' search returns the patron > 9 - Test with 'Secondary phone' and 'All phones' as well >10 - Repeat test from 'Patrons' module using the search on the left > >Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../prog/en/includes/member-search-box.inc | 16 +---------- > .../prog/en/includes/patron-search.inc | 16 +---------- > .../prog/en/includes/patronfields.inc | 28 +++++++++++++++++++ > 3 files changed, 30 insertions(+), 30 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc >index 5d791a90933..4c2d6669959 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc >@@ -25,21 +25,7 @@ > > <div class="form-extra-content"> > <div> >- <label for="searchfieldstype" class="control-label">Search fields</label> >- <select name="searchfieldstype" id="searchfieldstype" class="form-control"> >- [% SET standard = Koha.Preference('DefaultPatronSearchFields') || 'firstname,middle_name,surname,othernames,cardnumber,userid' %] >- [% default_fields = [ standard, 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %] >- [% search_options = default_fields.merge(standard.split(',')).unique %] >- [% FOREACH s_o IN search_options %] >- [% display_name = PROCESS patron_fields name=s_o %] >- [% NEXT IF !display_name.length %] >- [% IF searchfieldstype == s_o %] >- <option value="[% s_o | html %]">[% display_name | $raw %]</option> >- [% ELSE %] >- <option value="[% s_o | html %]">[% display_name | $raw %]</option> >- [% END %] >- [% END %] >- </select> >+ [% INCLUDE patron_fields_dropdown search_box=1 %] > </div> > > <div> >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 b4589b12019..4078ebf65ac 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >@@ -58,21 +58,7 @@ > </li> > [% CASE 'search_field' %] > <li> >- <label for="searchfieldstype_filter">Search field:</label> >- <select name="searchfieldstype" id="searchfieldstype_filter"> >- [% SET standard = Koha.Preference('DefaultPatronSearchFields') || 'firstname,middle_name,surname,othernames,cardnumber,userid' %] >- [% default_fields = [ standard, 'surname', 'cardnumber', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %] >- [% search_options = default_fields.merge(standard.split(',')).unique %] >- [% FOREACH s_o IN search_options %] >- [% display_name = PROCESS patron_fields name=s_o %] >- [% NEXT IF !display_name %] >- [% IF searchfieldstype == s_o %] >- <option selected="selected" value=[% s_o | html %]>[% display_name | $raw %]</option> >- [% ELSE %] >- <option value=[% s_o | html %]>[% display_name | $raw %]</option> >- [% END %] >- [% END %] >- </select> >+ [% INCLUDE patron_fields_dropdown %] > </li> > [% CASE 'search_type' %] > <li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc >index 821b7d0b7f5..089f8c76b6c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc >@@ -1,6 +1,9 @@ > [%- BLOCK patron_fields -%] > [%- SWITCH name -%] > [%- CASE standard -%]<span>Standard</span> >+ [%- CASE full_address -%]<span>Full address</span> >+ [%- CASE all_emails -%]<span>All emails</span> >+ [%- CASE all_phones -%]<span>All phones</span> > [%- CASE 'borrowernumber' -%]<span>Borrowernumber</span> > [%- CASE 'cardnumber' -%]<span>Card number</span> > [%- CASE 'surname' -%]<span>Surname</span> >@@ -75,3 +78,28 @@ > [%- CASE DEFAULT -%] > [%- END -%] > [%- END -%] >+[%- BLOCK patron_fields_dropdown -%] >+ [% IF search_box %] >+ <label for="searchfieldstype" class="control-label">Search field:</label> >+ <select name="searchfieldstype" id="searchfieldstype" class="form-control"> >+ [% ELSE %] >+ <label for="searchfieldstype_filter">Search field:</label> >+ <select name="searchfieldstype" id="searchfieldstype_filter"> >+ [% END %] >+ [% SET standard = Koha.Preference('DefaultPatronSearchFields') || 'firstname,middle_name,surname,othernames,cardnumber,userid' %] >+ [% SET full_address = 'streetnumber,streettype,address,address2,city,state,zipcode,country' %] >+ [% SET all_emails = 'email,emailpro,B_email' %] >+ [% SET all_phones = 'phone,phonepro,B_phone,altcontactphone,mobile' %] >+ [% default_fields = [ standard, 'surname', 'cardnumber', all_emails, 'borrowernumber', 'userid', all_phone, full_address, 'dateofbirth', 'sort1', 'sort2' ] %] >+ [% search_options = default_fields.merge(standard.split(',')).unique %] >+ [% FOREACH s_o IN search_options %] >+ [% display_name = PROCESS patron_fields name=s_o %] >+ [% NEXT IF !display_name %] >+ [% IF searchfieldstype == s_o %] >+ <option selected="selected" value=[% s_o | html %]>[% display_name | $raw %]</option> >+ [% ELSE %] >+ <option value=[% s_o | html %]>[% display_name | $raw %]</option> >+ [% END %] >+ [% END %] >+ </select> >+[%- END -%] >-- >2.25.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 32770
:
145921
|
145928
|
145935
|
146331
| 146711 |
147147
|
147696