Bugzilla – Attachment 56931 Details for
Bug 17374
Make use of fields from syspref 'DefaultPatronSearchFields' in patron search fields dropdown
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17374 - Make use of fields from syspref 'DefaultPatronSearchFields' in patron search fields dropdown
Bug-17374---Make-use-of-fields-from-syspref-Defaul.patch (text/plain), 8.59 KB, created by
Nick Clemens (kidclamp)
on 2016-10-27 16:28:39 UTC
(
hide
)
Description:
Bug 17374 - Make use of fields from syspref 'DefaultPatronSearchFields' in patron search fields dropdown
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2016-10-27 16:28:39 UTC
Size:
8.59 KB
patch
obsolete
>From 01b553d9751dfb54ea44464eae51eb41ff30d052 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 27 Oct 2016 14:21:02 +0000 >Subject: [PATCH] Bug 17374 - Make use of fields from syspref > 'DefaultPatronSearchFields' in patron search fields dropdown > >This patch preserves the current dropdown choices for patron search and adds fields from >the DefaultPatronSearchFields system preference > >To test: >1 - View the regular patron search and note fields in dropdown >2 - Apply patch, ensure dropdown has not changed >3 - Add fields to DefaultPatronSearchFields, note they are available in >dropdown >4 - Ensure existing and new fields search properly >--- > .../prog/en/includes/patron-search.inc | 62 ++++-------------- > .../prog/en/includes/patronfields.inc | 74 ++++++++++++++++++++++ > 2 files changed, 86 insertions(+), 50 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc > >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 337f550..3edae08 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >@@ -1,6 +1,7 @@ > [% USE Koha %] > [% USE Branches %] > [% USE Categories %] >+[% PROCESS 'patronfields.inc' %] > <div class="gradient"> > <h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Patrons Resident Search Box --> > <div id="header_search"> >@@ -14,62 +15,23 @@ > > <input value="Search" class="submit" type="submit" /> > >+ > <div id="filters"> > <p><label for="searchfieldstype">Search fields:</label> > <select name="searchfieldstype" id="searchfieldstype"> >- [% IF searchfieldstype == "standard" %] >- <option selected="selected" value='standard'>Standard</option> >- [% ELSE %] >- <option value='standard'>Standard</option> >- [% END %] >- [% IF searchfieldstype == "surname" %] >- <option selected="selected" value='surname'>Surname</option> >- [% ELSE %] >- <option value='surname'>Surname</option> >- [% END %] >- [% IF searchfieldstype == "email" %] >- <option selected="selected" value='email'>Email</option> >- [% ELSE %] >- <option value='email'>Email</option> >- [% END %] >- [% IF searchfieldstype == "borrowernumber" %] >- <option selected="selected" value='borrowernumber'>Borrower number</option> >- [% ELSE %] >- <option value='borrowernumber'>Borrower number</option> >- [% END %] >- [% IF searchfieldstype == "userid" %] >- <option selected="selected" value='userid'>Username</option> >- [% ELSE %] >- <option value='userid'>Username</option> >- [% END %] >- [% IF searchfieldstype == "phone" %] >- <option selected="selected" value='phone'>Phone number</option> >- [% ELSE %] >- <option value='phone'>Phone number</option> >- [% END %] >- [% IF searchfieldstype == "address" %] >- <option selected="selected" value='address'>Street Address</option> >- [% ELSE %] >- <option value='address'>Street Address</option> >- [% END %] >- [% IF searchfieldstype == "dateofbirth" %] >- <option selected="selected" value='dateofbirth'>Date of birth</option> >- [% ELSE %] >- <option value='dateofbirth'>Date of birth</option> >- [% END %] >- [% IF searchfieldstype == "sort1" %] >- <option selected="selected" value='sort1'>Sort field 1</option> >- [% ELSE %] >- <option value='sort1'>Sort field 1</option> >- [% END %] >- [% IF searchfieldstype == "sort2" %] >- <option selected="selected" value='sort2'>Sort field 2</option> >- [% ELSE %] >- <option value='sort2'>Sort field 2</option> >+ [% pref_fields = Koha.Preference('DefaultPatronSearchFields').split(',') %] >+ [% default_fields = [ 'standard', 'surname', 'email', 'borrowernumber', 'userid', 'phone', 'address', 'dateofbirth', 'sort1', 'sort2' ] %] >+ [% search_options = default_fields.merge(pref_fields).unique %] >+ [% FOREACH s_o IN search_options %] >+ [% display_name = PROCESS patron_fields name=s_o %] >+ [% IF searchfieldstype == s_o %] >+ <option selected="selected" value=[% s_o %]>[% display_name %]</option> >+ [% ELSE %] >+ <option value=[% s_o %]>[% display_name %]</option> >+ [% END %] > [% END %] > </select> > </p> >- > <p> > <label for="searchtype">Search type:</label> > <select name="searchtype" id="searchtype"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc >new file mode 100644 >index 0000000..3720af7 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc >@@ -0,0 +1,74 @@ >+[% BLOCK patron_fields -%] >+ [% SWITCH name %] >+ [%- CASE 'standard' -%]Standard >+ [%- CASE 'borrowernumber' -%]Borrower number >+ [%- CASE 'cardnumber' -%]Card number >+ [%- CASE 'surname' -%]Surname >+ [%- CASE 'firstname' -%]First name >+ [%- CASE 'title' -%]Title >+ [%- CASE 'othernames' -%]Other names >+ [%- CASE 'initials' -%]Initials >+ [%- CASE 'streetnumber' -%]Street number >+ [%- CASE 'streettype' -%]Street type >+ [%- CASE 'address' -%]Address >+ [%- CASE 'address2' -%]Address line 2 >+ [%- CASE 'city' -%]City >+ [%- CASE 'state' -%]State >+ [%- CASE 'zipcode' -%]Zip code >+ [%- CASE 'country' -%]Country >+ [%- CASE 'email' -%]Email >+ [%- CASE 'phone' -%]Phone >+ [%- CASE 'mobile' -%]Mobile phone >+ [%- CASE 'fax' -%]Fax >+ [%- CASE 'emailpro' -%]Secondary email >+ [%- CASE 'phonepro' -%]Secondary phone >+ [%- CASE 'B_streetnumber' -%]Alternate street number >+ [%- CASE 'B_streettype' -%]Alternate street type >+ [%- CASE 'B_address' -%]Alternate address >+ [%- CASE 'B_address2' -%]Alternate address line 2 >+ [%- CASE 'B_city' -%]Alternate city >+ [%- CASE 'B_state' -%]Alternate state >+ [%- CASE 'B_zipcode' -%]Alternate zip code >+ [%- CASE 'B_country' -%]Alternate Country >+ [%- CASE 'B_email' -%]Alternate email >+ [%- CASE 'B_phone' -%]Alternate phone >+ [%- CASE 'dateofbirth' -%]Date of birth >+ [%- CASE 'branchcode' -%]Branch code >+ [%- CASE 'categorycode' -%]Category code >+ [%- CASE 'dateenrolled' -%]Registration date >+ [%- CASE 'dateexpiry' -%]Expiration date >+ [%- CASE 'gonenoaddress' -%]Gone no address >+ [%- CASE 'lost' -%]Lost card >+ [%- CASE 'debarred' -%]Restricted >+ [%- CASE 'debarredcomment' -%]Restriction reason >+ [%- CASE 'contactname' -%]Guarantor surname >+ [%- CASE 'contactfirstname' -%]Guarantor firstname >+ [%- CASE 'contacttitle' -%]Guarantor title >+ [%- CASE 'guarantorid' -%]Guarantor ID >+ [%- CASE 'borrowernotes' -%]Circulation Note >+ [%- CASE 'relationship' -%]Guarantor relationship >+ [%- CASE 'sex' -%]Sex >+ [%- CASE 'flags' -%]Permissions (code) >+ [%- CASE 'userid' -%]User name >+ [%- CASE 'opacnote' -%]OPAC note >+ [%- CASE 'contactnote' -%]Contact note >+ [%- CASE 'sort1' -%]Sort field 1 >+ [%- CASE 'sort2' -%]Sort field 2 >+ [%- CASE 'altcontactfirstname' -%]Alternate contact first name >+ [%- CASE 'altcontactsurname' -%]Alternate contact surname >+ [%- CASE 'altcontactaddress1' -%]Alternate contact address >+ [%- CASE 'altcontactaddress2' -%]Alternate contact address line 2 >+ [%- CASE 'altcontactaddress3' -%]Alternate contact city >+ [%- CASE 'altcontactstate' -%]Alternate contact state >+ [%- CASE 'altcontactzipcode' -%]Alternate contact zip code >+ [%- CASE 'altcontactcountry' -%]Alternate contact country >+ [%- CASE 'altcontactphone' -%]Alternate contact phone >+ [%- CASE 'smsalertnumber' -%]SMS alert number >+ [%- CASE 'sms_provider_id' -%]SMS provider >+ [%- CASE 'privacy' -%]Privacy (code) >+ [%- CASE 'privacy_guarantor_checkouts' -%]Guarantor can view checkouts >+ [%- CASE 'updated_on' -%]Last updated >+ [%- CASE 'lastseen' -%]Last seen >+ [%- CASE 'checkprevcheckout' -%]Check previous checkout >+ [%- END -%] >+[%- END -%] >-- >2.1.4
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 17374
:
56921
|
56931
|
56958
|
58239
|
66400
|
70226
|
71536
|
71597
|
71598
|
71599
|
71600
|
74828
|
93226
|
94831
|
94876
|
94890
|
94891
|
94892
|
96341
|
96342
|
96343
|
96679
|
98106
|
98478
|
100436
|
100437
|
100438
|
100439