Bugzilla – Attachment 133451 Details for
Bug 28633
Add a preferred name field to patrons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28633: (follow-up) Display effective name in JS search
Bug-28633-follow-up-Display-effective-name-in-JS-s.patch (text/plain), 3.63 KB, created by
Nick Clemens (kidclamp)
on 2022-04-20 10:38:33 UTC
(
hide
)
Description:
Bug 28633: (follow-up) Display effective name in JS search
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-04-20 10:38:33 UTC
Size:
3.63 KB
patch
obsolete
>From b1c18559eb3d94812e495ae59206a444dcd338bd Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 20 Apr 2022 10:37:08 +0000 >Subject: [PATCH] Bug 28633: (follow-up) Display effective name in JS search > >Also I fix the other header search, and ensure the 'Standard' option wil appear in dropdowns >--- > .../intranet-tmpl/prog/en/includes/js-patron-format.inc | 6 ++++-- > .../intranet-tmpl/prog/en/includes/patron-search-header.inc | 2 +- > koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc | 2 +- > 3 files changed, 6 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc >index 0c1daae17f..3c437ae193 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js-patron-format.inc >@@ -20,16 +20,18 @@ > > var name; > var firstname = escape_str(patron.firstname); >+ var preferred_name = escape_str(patron.preferred_name); > var surname = escape_str(patron.surname); >+ var effective_name = preferred_name || firstname; > > if ( patron.other_name != null && patron.other_name != '' ) { > firstname += ' (' + escape_str(patron.other_name) + ')'; > } > if ( config && config.invert_name ) { >- name = surname + ( firstname ? ', ' + firstname : '' ); >+ name = surname + ( effective_name ? ', ' + effective_name : '' ); > } > else { >- name = firstname + ' ' + surname; >+ name = effective_name + ' ' + surname; > } > > if ( config && config.display_cardnumber ) { >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 49f3852fa1..b6cda723cd 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 >@@ -24,7 +24,7 @@ > <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' ] %] >+ [% default_fields = [ 'firstname,surname,preferred_name,othernames,cardnumber,userid', 'surname', 'cardnumber', '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 %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc >index 57321f92c5..876c78be1a 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 'firstname,surname,preferred_name,othernames,cardnumber,userid' -%]<span>Standard</span> > [%- CASE 'borrowernumber' -%]<span>Borrowernumber</span> > [%- CASE 'cardnumber' -%]<span>Card number</span> > [%- CASE 'surname' -%]<span>Surname</span> >-- >2.30.2
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 28633
:
123008
|
123009
|
123010
|
123658
|
125497
|
125498
|
125499
|
125500
|
126591
|
128968
|
128969
|
128970
|
130000
|
130001
|
130002
|
133445
|
133446
|
133447
|
133448
|
133449
|
133450
|
133451
|
133958
|
133959
|
133960
|
133961
|
133962
|
133963
|
133964
|
133965
|
166792
|
166793
|
166794
|
166813
|
166814
|
166815
|
166816
|
166817
|
167163
|
167164
|
173628
|
173629
|
173630
|
173631
|
173632
|
173633
|
173634
|
173664
|
173665
|
173666
|
173667
|
173668
|
173669
|
173670
|
173717
|
173718
|
173719
|
173813
|
173814
|
173815
|
173816
|
173826
|
173827
|
173828
|
173829
|
173930
|
173931
|
173932
|
173933
|
173934
|
173935
|
173936
|
174419
|
174420
|
174472
|
175177