Bugzilla – Attachment 146490 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), 6.22 KB, created by
Martin Renvoize (ashimema)
on 2023-02-10 16:08:44 UTC
(
hide
)
Description:
Bug 29822: Update code to reference by pipe
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-02-10 16:08:44 UTC
Size:
6.22 KB
patch
obsolete
>From eb91aaa6c0a0f74da88943ccd2bce59f231db58a 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 +- > .../intranet-tmpl/prog/en/includes/member-search-box.inc | 4 ++-- > .../intranet-tmpl/prog/en/includes/patron-search.inc | 8 ++++---- > koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js | 2 +- > 4 files changed, 8 insertions(+), 8 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/member-search-box.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc >index 5d791a9093..e81961c106 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 >@@ -27,9 +27,9 @@ > <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' %] >+ [% 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 %] >+ [% 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 %] >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 b4589b1201..b7c4116585 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc >@@ -60,9 +60,9 @@ > <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' %] >+ [% 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 %] >+ [% 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 %] >@@ -320,13 +320,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/js/patron-autocomplete.js b/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js >index f4620896ce..c93f1de461 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.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 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