Bugzilla – Attachment 147435 Details for
Bug 29822
Use table column selection modal for DefaultPatronSearchFields preference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29822: Update code to reference by pipe
Bug-29822-Update-code-to-reference-by-pipe.patch (text/plain), 4.68 KB, created by
Martin Renvoize (ashimema)
on 2023-02-27 12:11:20 UTC
(
hide
)
Description:
Bug 29822: Update code to reference by pipe
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-02-27 12:11:20 UTC
Size:
4.68 KB
patch
obsolete
>From c24ffe36a35dc57642dc827970d18120f9a04ff5 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 10 Feb 2023 15:22:04 +0000 >Subject: [PATCH] Bug 29822: Update code to reference by pipe > >Moving to modalselect also has the effect of moving from comma delimited >to pipe delimitation for the preference contents >--- > koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc | 2 +- > koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc | 4 ++-- > koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc | 3 ++- > koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js | 2 +- > 4 files changed, 6 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc >index 2d1af01c4f..fc0913027b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc >@@ -71,7 +71,7 @@ > [% IF ( PatronAutoComplete ) %] > <script> > // PatronAutoComplete >- var defaultPatronSearchFields = "[% Koha.Preference('DefaultPatronSearchFields') || 'firstname,middle_name,surname,othernames,cardnumber,userid' | html %]"; >+ var defaultPatronSearchFields = "[% Koha.Preference('DefaultPatronSearchFields') || 'firstname|middle_name|surname|othernames|cardnumber|userid' | html %]"; > var loggedInLibrary = '[% Branches.GetLoggedInBranchcode | html %]'; > var singleBranchMode = '[% singleBranchMode | html %]'; > var loggedInClass = ""; >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 4078ebf65a..879ae28491 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >@@ -306,13 +306,13 @@ > let search_type = $("#searchtype_filter").val() || "contain"; > let search_fields = $("#searchfieldstype_filter").val(); > if ( !search_fields ) { >- search_fields = "[% Koha.Preference('DefaultPatronSearchFields') || 'firstname,middle_name,surname,othernames,cardnumber,userid' | html %]"; >+ search_fields = "[% Koha.Preference('DefaultPatronSearchFields') || 'firstname|middle_name|surname|othernames|cardnumber|userid' | html %]"; > } > > let subquery_and = []; > patterns.forEach(function(pattern,i){ > let sub_or = []; >- search_fields.split(',').forEach(function(attr,ii){ >+ search_fields.split('|').forEach(function(attr,ii){ > sub_or.push({["me."+attr]:{"like":(search_type == "contain" ? "%" : "" ) + pattern + "%"}}); > if ( attr == 'dateofbirth' ) { > try { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc >index c48fa6c28a..6db16a5ddf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc >@@ -86,7 +86,8 @@ > <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 standard = Koha.Preference('DefaultPatronSearchFields') || 'firstname|middle_name|surname|othernames|cardnumber|userid' %] >+ [% standard.replace('|', ',') > [% 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' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js b/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js >index 49ff14f84b..da7dac9dd7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js >@@ -20,7 +20,7 @@ function patron_autocomplete(node, options) { > .filter(function(s){ return s.length }) > .forEach(function(pattern,i){ > let subquery_or = []; >- defaultPatronSearchFields.split(',').forEach(function(field,i){ >+ defaultPatronSearchFields.split('|').forEach(function(field,i){ > subquery_or.push( > {["me."+field]: {'like': pattern + '%'}} > ); >-- >2.39.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 29822
:
144814
|
144831
|
146430
|
146445
|
146488
|
146489
|
146490
|
146491
|
146492
|
147433
|
147434
|
147435
|
147436
|
147437
|
149890
|
149891
|
149892
|
149893
|
149894
|
151058
|
151059
|
151060
|
151061
|
151062
|
151064
|
151233
|
151234
|
151235
|
151236
|
151237
|
151238
|
153373
|
153374
|
153375
|
153376
|
153377
|
153378
|
153379
|
153380
|
153381
|
153382
|
153383
|
153384
|
153442
|
153443
|
153444
|
153445
|
153446
|
153447
|
154361
|
154362
|
154363
|
154364
|
154365
|
154366