Bugzilla – Attachment 133965 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: Fix ysearch sorting
Bug-28633-Fix-ysearch-sorting.patch (text/plain), 3.13 KB, created by
Nick Clemens (kidclamp)
on 2022-04-26 16:34:12 UTC
(
hide
)
Description:
Bug 28633: Fix ysearch sorting
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-04-26 16:34:12 UTC
Size:
3.13 KB
patch
obsolete
>From 6c963746000a971719ba172c3c731ed8683131b7 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 26 Apr 2022 16:31:42 +0000 >Subject: [PATCH] Bug 28633: Fix ysearch sorting > >This adds an IF conditional to the sorting to sort by preferred name or firstname > >I add the colmns to data for main patron searhc, but I cannot solve sorting there >--- > circ/ysearch.pl | 2 +- > koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc | 6 +++--- > 2 files changed, 4 insertions(+), 4 deletions(-) > >diff --git a/circ/ysearch.pl b/circ/ysearch.pl >index bb440d7e58..a9982ffd8f 100755 >--- a/circ/ysearch.pl >+++ b/circ/ysearch.pl >@@ -75,7 +75,7 @@ my $borrowers_rs = Koha::Patrons->search_limited( > # Get the first 10 results > page => 1, > rows => 10, >- order_by => [ 'surname', 'firstname' ], >+ order_by => [ 'surname', \'IF(preferred_name != "" AND preferred_name IS NOT NULL, preferred_name, firstname)' ], > prefetch => 'branchcode', > }, > ); >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 fafe0613f0..a2fcde30c0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >@@ -440,7 +440,7 @@ > } > [% CASE 'name-address' %] > { >- "data": "me.surname:me.firstname:me.othernames:me.street_number:me.address:me.address2:me.city:me.state:me.postal_code:me.country", >+ "data": "me.surname:me.preferred_name:me.firstname:me.othernames:me.street_number:me.address:me.address2:me.city:me.state:me.postal_code:me.country", > "searchable": true, > "orderable": true, > "render": function( data, type, row, meta ) { >@@ -465,7 +465,7 @@ > } > [% CASE 'name-address' %] > { >- "data": "me.surname:me.firstname:me.othernames:me.street_number:me.address:me.address2:me.city:me.state:me.postal_code:me.country", >+ "data": "me.surname:me.preferred_name:me.firstname:me.othernames:me.street_number:me.address:me.address2:me.city:me.state:me.postal_code:me.country", > "searchable": true, > "orderable": true, > "render": function( data, type, row, meta ) { >@@ -490,7 +490,7 @@ > } > [% CASE 'name' %] > { >- "data": "me.surname:me.firstname:me.othernames", >+ "data": "me.surname:me.preferred_name:me.firstname:me.othernames", > "searchable": true, > "orderable": true, > "render": function( data, type, row, meta ) { >-- >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