From 1c16c20da6e6b393884e99fdb57efbba5b2b4ee9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 4 Nov 2021 14:39:28 +0100 Subject: [PATCH] Bug 29180: Rename syspref RequestOnOpac with OPACHoldRequests It is a confusing name because we have 'Article Request' as a feature, and this does not follow Koha terminology. Test plan: `updatedatabase` and confirm that the syspref has been renamed `git grep RequestOnOpac` => No occurrence in the code QA: The syspref's value is always retrieved using Koha.Preference from .tt files, we don't need to send it from controllers or C4::Auth --- C4/Auth.pm | 1 - C4/UsageStats.pm | 2 +- installer/data/mysql/atomicupdate/bug_29180.pl | 15 +++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 2 +- installer/data/mysql/update22to30.pl | 2 +- installer/html-template-to-template-toolkit.pl | 2 +- .../prog/en/modules/admin/preferences/opac.pref | 2 +- .../bootstrap/en/includes/opac-detail-sidebar.inc | 2 +- .../bootstrap/en/includes/title-actions-menu.inc | 4 ++-- .../opac-tmpl/bootstrap/en/modules/opac-basket.tt | 2 +- .../bootstrap/en/modules/opac-opensearch.tt | 2 +- .../bootstrap/en/modules/opac-results.tt | 10 +++++----- .../bootstrap/en/modules/opac-sendbasketform.tt | 2 +- .../bootstrap/en/modules/opac-sendshelfform.tt | 2 +- .../bootstrap/en/modules/opac-shelves.tt | 6 +++--- .../bootstrap/en/modules/opac-topissues.tt | 2 +- opac/opac-ISBDdetail.pl | 1 - opac/opac-MARCdetail.pl | 6 ------ opac/opac-detail.pl | 1 - opac/opac-reserve.pl | 4 ++-- 20 files changed, 38 insertions(+), 32 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_29180.pl diff --git a/C4/Auth.pm b/C4/Auth.pm index b531ab4a6a5..8606e64bb86 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -597,7 +597,6 @@ sub get_template_and_user { OPACPrivacy => C4::Context->preference("OPACPrivacy"), OPACFinesTab => C4::Context->preference("OPACFinesTab"), OpacTopissue => C4::Context->preference("OpacTopissue"), - RequestOnOpac => C4::Context->preference("RequestOnOpac"), 'Version' => C4::Context->preference('Version'), hidelostitems => C4::Context->preference("hidelostitems"), mylibraryfirst => ( C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv ) ? C4::Context->userenv->{'branch'} : '', diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm index 2ff5303bcb9..ef610b76bd6 100644 --- a/C4/UsageStats.pm +++ b/C4/UsageStats.pm @@ -305,7 +305,7 @@ sub _shared_preferences { OpacTopissue opacuserlogin QuoteOfTheDay - RequestOnOpac + OPACHoldRequests OPACComments ShowReviewer ShowReviewerPhoto diff --git a/installer/data/mysql/atomicupdate/bug_29180.pl b/installer/data/mysql/atomicupdate/bug_29180.pl new file mode 100755 index 00000000000..82e7c3039cf --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_29180.pl @@ -0,0 +1,15 @@ +use Modern::Perl; + +return { + bug_number => "29180", + description => "Rename system preference RequestOnOpac with OPACHoldRequests", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + $dbh->do(q{ + UPDATE systempreferences + SET variable="OPACHoldRequests" + WHERE variable="RequestOnOpac" + }); + }, +} diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 9789af312e1..fdc383b2b3c 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -564,7 +564,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('RentalsInNoissuesCharge','1',NULL,'Rental charges block checkouts (added to noissuescharge).','YesNo'), ('ReplyToDefault','',NULL,'Use this email address as the replyto in emails','Free'), ('ReportsLog','0',NULL,'If ON, log information about reports.','YesNo'), -('RequestOnOpac','1',NULL,'If ON, globally enables patron holds on OPAC','YesNo'), +('OPACHoldRequests','1',NULL,'If ON, globally enables patron holds on OPAC','YesNo'), ('RequireStrongPassword','1','','Require a strong login password for staff and patrons','YesNo'), ('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'), ('ReservesMaxPickUpDelay','7','','Define the Maximum delay to pick up an item on hold','Integer'), diff --git a/installer/data/mysql/update22to30.pl b/installer/data/mysql/update22to30.pl index c5a183dae9d..7592c9b6267 100755 --- a/installer/data/mysql/update22to30.pl +++ b/installer/data/mysql/update22to30.pl @@ -414,7 +414,7 @@ my $DBversion = "3.00.00.000"; }, { uniquefieldrequired => 'variable', - variable => 'RequestOnOpac', + variable => 'OPACHoldRequests', value => '1', forceupdate => { 'explanation' => 1, 'type' => 1}, diff --git a/installer/html-template-to-template-toolkit.pl b/installer/html-template-to-template-toolkit.pl index c1ad8a4917a..f76c87c904e 100755 --- a/installer/html-template-to-template-toolkit.pl +++ b/installer/html-template-to-template-toolkit.pl @@ -27,7 +27,7 @@ my $tmpl_out_dir = 'koha-tt'; # template toolkit variables NOT to scope, in other words, variables that need to remain global (case sensitive) my @globals = ( "themelang","JacketImages","OPACAmazonCoverImages","GoogleJackets","BakerTaylorEnabled", "SyndeticsEnabled", "OpacRenewalAllowed", "item_level_itypes","noItemTypeImages", - "virtualshelves", "RequestOnOpac", "COinSinOPACResults", "OPACXSLTResultsDisplay", + "virtualshelves", "OPACHoldRequests", "COinSinOPACResults", "OPACXSLTResultsDisplay", "OPACItemsResultsDisplay", "LibraryThingForLibrariesID", "opacuserlogin", "TagsEnabled", "TagsShowOnList", "TagsInputOnList","loggedinusername","opacbookbag", "OPACAmazonEnabled", "SyndeticsCoverImages" ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index c3e793794cc..253cec7a06a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -474,7 +474,7 @@ OPAC: 0: Hide - reviewer's avatar beside comments in OPAC. The avatar will be searched on Libravatar using the patron's e-mail address. - - - pref: RequestOnOpac + - pref: OPACHoldRequests choices: 1: Allow 0: "Don't allow" diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc index a110d73a2af..09c4e49456d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc @@ -3,7 +3,7 @@