From e5bf67135726fde4dfa349d36348cbeadd30b3c7 Mon Sep 17 00:00:00 2001 From: Matthias Meusburger Date: Fri, 4 Oct 2019 11:16:08 +0200 Subject: [PATCH] Bug 23697: (follow-up) Add autocompletion search in patron module MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - Rename CircAutocompl system preference to PatronAutocompletion - Take this system preference into consideration for patron search Signed-off-by: Séverine QUEUNE Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- C4/Auth.pm | 2 +- C4/UsageStats.pm | 2 +- circ/branchtransfers.pl | 2 +- circ/circulation.pl | 2 +- .../data/mysql/atomicupdate/bug_23697.perl | 6 ++++ installer/data/mysql/sysprefs.sql | 2 +- .../prog/en/includes/js_includes.inc | 29 ++++++++++++++++++- .../prog/en/includes/patron-search-box.inc | 2 +- .../admin/preferences/circulation.pref | 4 +-- .../prog/en/modules/reserve/request.tt | 2 +- .../intranet-tmpl/prog/js/members-menu.js | 21 -------------- members/members-home.pl | 1 + t/db_dependent/UsageStats.t | 2 +- 13 files changed, 45 insertions(+), 32 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_23697.perl diff --git a/C4/Auth.pm b/C4/Auth.pm index 24296c5996..7a7d9f5768 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -480,7 +480,7 @@ sub get_template_and_user { AmazonCoverImages => C4::Context->preference("AmazonCoverImages"), AutoLocation => C4::Context->preference("AutoLocation"), "BiblioDefaultView" . C4::Context->preference("IntranetBiblioDefaultView") => 1, - CircAutocompl => C4::Context->preference("CircAutocompl"), + PatronAutocompletion => C4::Context->preference("PatronAutocompletion"), FRBRizeEditions => C4::Context->preference("FRBRizeEditions"), IndependentBranches => C4::Context->preference("IndependentBranches"), IntranetNav => C4::Context->preference("IntranetNav"), diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm index f205767273..268f72f8ba 100644 --- a/C4/UsageStats.pm +++ b/C4/UsageStats.pm @@ -182,7 +182,7 @@ sub BuildReport { TransferWhenCancelAllWaitingHolds AllowAllMessageDeletion AllowOfflineCirculation - CircAutocompl + PatronAutocompletion CircAutoPrintQuickSlip DisplayClearScreenButton FilterBeforeOverdueReport diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl index d5b8e9e726..d14fc3d59c 100755 --- a/circ/branchtransfers.pl +++ b/circ/branchtransfers.pl @@ -241,7 +241,7 @@ $template->param( setwaiting => $setwaiting, trsfitemloop => \@trsfitemloop, errmsgloop => \@errmsgloop, - CircAutocompl => C4::Context->preference("CircAutocompl"), + PatronAutocompletion => C4::Context->preference("PatronAutocompletion"), ); # Checking if there is a Fast Cataloging Framework diff --git a/circ/circulation.pl b/circ/circulation.pl index c90b2ba553..294c8a7ffd 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -636,7 +636,7 @@ my $has_modifications = Koha::Patron::Modifications->search( { borrowernumber => $template->param( debt_confirmed => $debt_confirmed, SpecifyDueDate => $duedatespec_allow, - CircAutocompl => C4::Context->preference("CircAutocompl"), + PatronAutocompletion => C4::Context->preference("PatronAutocompletion"), debarments => scalar GetDebarments({ borrowernumber => $borrowernumber }), todaysdate => output_pref( { dt => dt_from_string()->set(hour => 23)->set(minute => 59), dateformat => 'sql' } ), has_modifications => $has_modifications, diff --git a/installer/data/mysql/atomicupdate/bug_23697.perl b/installer/data/mysql/atomicupdate/bug_23697.perl new file mode 100644 index 0000000000..84655c3633 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_23697.perl @@ -0,0 +1,6 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "UPDATE systempreferences SET variable="PatronAutocompletion" WHERE variable="CircAutocompl" LIMIT 1" ); + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 23697 - Rename CircAutocompl system preference to PatronAutocompletion)\n"; +} diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index bb6618f3ff..f25b0d44a7 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -116,7 +116,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('CatalogModuleRelink','0',NULL,'If OFF the linker will never replace the authids that are set in the cataloging module.','YesNo'), ('CataloguingLog','1',NULL,'If ON, log edit/create/delete actions on bibliographic data. WARNING: this feature is very resource consuming.','YesNo'), ('CheckPrevCheckout','hardno','hardyes|softyes|softno|hardno','By default, for every item checked out, should we warn if the patron has borrowed that item in the past?','Choice'), -('CircAutocompl','1',NULL,'If ON, autocompletion is enabled for the Circulation input','YesNo'), ('CircAutoPrintQuickSlip','qslip',NULL,'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window, Display a print slip window or Clear the screen.','Choice'), ('CircControl','ItemHomeLibrary','PickupLibrary|PatronLibrary|ItemHomeLibrary','Specify the agency that controls the circulation and fines policy','Choice'), ('CircSidebar','0',NULL,'Activate or deactivate the navigation sidebar on all Circulation pages','YesNo'), @@ -464,6 +463,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OverduesBlockCirc','noblock','noblock|confirmation|block','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','Choice'), ('OverduesBlockRenewing','allow','allow|blockitem|block','If any of patron checked out documents is late, should renewal be allowed, blocked only on overdue items or blocked on whatever checked out document','Choice'), ('PatronAnonymizeDelay','',NULL,'Delay for anonymizing patrons', 'Integer'), +('PatronAutocompletion','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'), ('patronimages','0',NULL,'Enable patron images for the Staff Client','YesNo'), ('PatronRemovalDelay','',NULL,'Delay for removing anonymized patrons', 'Integer'), ('PatronSelfModificationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when a patron is editing their information via the OPAC.','free'), 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 7bff27a22d..a6bf7b77f5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js_includes.inc @@ -81,7 +81,7 @@ [% END %] [% IF ( CAN_user_circulate_circulate_remaining_permissions ) %] - [% IF ( CircAutocompl ) %] + [% IF ( PatronAutocompletion ) %] [% END %] [% END %] +[% IF ( PatronAutocompletion ) %] + +[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc index aec60d975e..f1b0de0fd7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search-box.inc @@ -2,7 +2,7 @@