Bugzilla – Attachment 150781 Details for
Bug 33117
Patron checkout search not working if searching with second surname
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33117: New System Preference PatronAutoCompleteSearchMethod
Bug-33117-New-System-Preference-PatronAutoComplete.patch (text/plain), 4.96 KB, created by
Laura Escamilla
on 2023-05-05 17:28:09 UTC
(
hide
)
Description:
Bug 33117: New System Preference PatronAutoCompleteSearchMethod
Filename:
MIME Type:
Creator:
Laura Escamilla
Created:
2023-05-05 17:28:09 UTC
Size:
4.96 KB
patch
obsolete
>From b3b7ddd80a190d5d36d032a38cad78639d9254ff Mon Sep 17 00:00:00 2001 >From: John Doe <you@example.com> >Date: Fri, 5 May 2023 15:32:50 +0000 >Subject: [PATCH] Bug 33117: New System Preference > PatronAutoCompleteSearchMethod > >--- > installer/data/mysql/atomicupdate/skeleton.pl | 22 +++++-------------- > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../prog/en/includes/js_includes.inc | 1 + > .../prog/js/patron-autocomplete.js | 3 ++- > 4 files changed, 10 insertions(+), 17 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/skeleton.pl b/installer/data/mysql/atomicupdate/skeleton.pl >index c253039c5c..5136eb1fd7 100755 >--- a/installer/data/mysql/atomicupdate/skeleton.pl >+++ b/installer/data/mysql/atomicupdate/skeleton.pl >@@ -1,24 +1,14 @@ > use Modern::Perl; > > return { >- bug_number => "BUG_NUMBER", >- description => "A single line description", >+ bug_number => "33117", >+ description => "Patron checkout is not able to find patrons if using a second surname during the search", > up => sub { > my ($args) = @_; > my ($dbh, $out) = @$args{qw(dbh out)}; >- # Do you stuffs here >- $dbh->do(q{}); >- # Print useful stuff here >- # tables >- say $out "Added new table 'XXX'"; >- say $out "Added column 'XXX.YYY'"; >- # sysprefs >- say $out "Added new system preference 'XXX'"; >- say $out "Updated system preference 'XXX'"; >- say $out "Removed system preference 'XXX'"; >- # permissions >- say $out "Added new permission 'XXX'"; >- # letters >- say $out "Added new letter 'XXX' (TRANSPORT)"; >+ >+ $dbh->do(q{INSERT INTO systempreferences ('variable', 'value', 'explanation', 'options', 'type',) VALUES ('PatronAutoCompleteSearchMethod', '1', 'Allows staff to search for patrons using the method', 'Starts with|Contains', "YesNo')}); >+ >+ say $out "Added new system preference 'PatronAutoCompleteSearchMethod'"; > }, > }; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index b12f1ce170..5eeb6c1f89 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -551,6 +551,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('PassItemMarcToXSLT','0',NULL,'If enabled, item fields in the MARC record will be made avaiable to XSLT sheets. Otherwise they will be removed.','YesNo'), > ('PatronAnonymizeDelay','',NULL,'Delay for anonymizing patrons', 'Integer'), > ('PatronAutoComplete','1','Try|Don\'t try','to guess the patron being entered while typing a patron search for circulation or patron search. Only returns the first 10 results at a time.','YesNo'), >+('PatronAutoCompleteSearchMethod', '1', 'Allows staff to search for patrons using the method 'Starts with|Contains', 'YesNo'), > ('PatronDuplicateMatchingAddFields','surname|firstname|dateofbirth', NULL,'A list of fields separated by "|" to deduplicate patrons when created','Free'), > ('patronimages','0',NULL,'Enable patron images for the staff interface','YesNo'), > ('PatronRemovalDelay','',NULL,'Delay for removing anonymized patrons', 'Integer'), >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..1cffcc7102 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc >@@ -72,6 +72,7 @@ > <script> > // PatronAutoComplete > var defaultPatronSearchFields = "[% Koha.Preference('DefaultPatronSearchFields') || 'firstname,middle_name,surname,othernames,cardnumber,userid' | html %]"; >+ var patronAutoCompleteSearchMethods = "[% Koha.Preference('PatronAutoCompleteSearchMethods') | html %]"; > var loggedInLibrary = '[% Branches.GetLoggedInBranchcode | html %]'; > var singleBranchMode = '[% singleBranchMode | html %]'; > var loggedInClass = ""; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js b/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js >index 49ff14f84b..c0264b6728 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js >@@ -2,6 +2,7 @@ function patron_autocomplete(node, options) { > let link_to; > let url_params; > let on_select_callback; >+ let leading_wildcard = search_type > 0 ? "" : "%"; > if ( options ) { > if ( options['link-to'] ) { > link_to = options['link-to']; >@@ -22,7 +23,7 @@ function patron_autocomplete(node, options) { > let subquery_or = []; > defaultPatronSearchFields.split(',').forEach(function(field,i){ > subquery_or.push( >- {["me."+field]: {'like': pattern + '%'}} >+ {["me."+field]: {'like': leading_wildcard + pattern + '%'}} > ); > }); > subquery_and.push(subquery_or); >-- >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 33117
:
148018
|
148027
|
148095
|
148131
|
148138
|
148278
|
148279
|
148280
|
148282
|
148336
|
148383
|
148384
|
148443
|
148445
|
148467
|
148481
|
150781
|
150896
|
150897
|
150898
|
151090
|
151091
|
151302
|
151314
|
151317
|
151769
|
151771
|
151825
|
151845
|
152549
|
152552
|
152554
|
152555
|
152556
|
152562
|
152563
|
152564
|
152565
|
154309