From ea6658e1610ad69e5d72836727c1de69495cdbcf Mon Sep 17 00:00:00 2001 From: James O'Keeffe Date: Thu, 21 Jan 2021 05:23:31 +0000 Subject: [PATCH] Bug 27487: Rename system preference reviewson to OPACComments This patch renames the reviewson system pref to OPACComments Test Plan: 1. In Koha Administration, search for the reviewson system preferance 2. Note the presence of the reviewson system preferance 3. Apply the patch and run updatedatabase.pl 4. Repeat steps 1 and 2. The reviewson preferenace should be gone 5. Seach for and note the OPACComments system preferance 6. Ensure that the OPACComments system preferance operates correctly, as if it were reviewson Signed-off-by: Lucas Gass Signed-off-by: Katrin Fischer https://bugs.koha-community.org/show_bug.cgi?id=27484 --- C4/UsageStats.pm | 2 +- installer/data/mysql/atomicupdate/bug_27487-add_syspref.perl | 5 +++++ installer/data/mysql/mandatory/sysprefs.sql | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref | 2 +- koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc | 2 +- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 6 +++--- opac/opac-detail.pl | 2 +- t/db_dependent/UsageStats.t | 2 +- 8 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_27487-add_syspref.perl diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm index 6f9b27c20f..2eb854cba6 100644 --- a/C4/UsageStats.pm +++ b/C4/UsageStats.pm @@ -261,7 +261,7 @@ sub BuildReport { opacuserlogin QuoteOfTheDay RequestOnOpac - reviewson + OPACComments ShowReviewer ShowReviewerPhoto SocialNetworks diff --git a/installer/data/mysql/atomicupdate/bug_27487-add_syspref.perl b/installer/data/mysql/atomicupdate/bug_27487-add_syspref.perl new file mode 100644 index 0000000000..76cacb4485 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_27487-add_syspref.perl @@ -0,0 +1,5 @@ +$DBversion = 'XXX'; +if( CheckVersion( $DBversion ) ) { + $dbh->do(q{UPDATE systempreferences SET variable="OPACComments" WHERE variable="reviewson" }); + NewVersion( $DBversion, 27847, "Rename 'reviewson' to 'OPACComments"); +} diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 3157830c19..089a082754 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -570,7 +570,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('ReturnBeforeExpiry','0',NULL,'If ON, checkout will be prevented if returndate is after patron card expiry','YesNo'), ('ReturnLog','1',NULL,'If ON, enables the circulation (returns) log','YesNo'), ('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'), -('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'), +('OPACComments','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'), ('RisExportAdditionalFields', '', NULL , 'Define additional RIS tags to export from MARC records in YAML format as an associative array with either a marc tag/subfield combination as the value, or a list of tag/subfield combinations.', 'textarea'), ('RoundFinesAtPayment','0', NULL,'If enabled any fines with fractions of a cent will be rounded to the nearest cent when payments are coll ected. e.g. 1.004 will be paid off by a 1.00 payment','YesNo'), ('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'), 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 145fb0e06b..fd708d1332 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 @@ -445,7 +445,7 @@ OPAC: no: "Don't allow" - patrons to make purchase suggestions on the OPAC. - - - pref: reviewson + - pref: OPACComments choices: yes: Allow no: "Don't allow" diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc index 85cbb9a4b0..9436d99e49 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc @@ -310,7 +310,7 @@ Authority search [% END %] - [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'reviewson' ) == 1 ) && ( Koha.Preference( 'OpacShowRecentComments' ) == 1 ) ) %] + [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'OPACComments' ) == 1 ) && ( Koha.Preference( 'OpacShowRecentComments' ) == 1 ) ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index e93adabd27..8c2cbacff9 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -561,7 +561,7 @@ [% END %] - [% IF Koha.Preference( 'reviewson' ) == 1 %] + [% IF Koha.Preference( 'OPACComments' ) == 1 %]
  • Comments[% ' ( ' _ (reviews.size || 0) _ ' )' | html %]
  • [% END %] @@ -881,7 +881,7 @@ [% END # / IF LibraryThingForLibrariesID && LibraryThingForLibrariesTabbedView %] - [% IF Koha.Preference( 'reviewson' ) == 1 %] + [% IF Koha.Preference( 'OPACComments' ) == 1 %]
    [% IF ( reviews ) %] @@ -954,7 +954,7 @@
    [% END # / IF loggedinusername %] - [% END # / IF reviewson %] + [% END # / IF OPACComments %] [% IF ( OPACFRBRizeEditions && XISBNS ) %]
    diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 8b935af155..0f32e2fc8c 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -900,7 +900,7 @@ my $coins = eval { $biblio->get_coins }; $template->param( ocoins => $coins ); my ( $loggedincommenter, $reviews ); -if ( C4::Context->preference('reviewson') ) { +if ( C4::Context->preference('OPACComments') ) { $reviews = Koha::Reviews->search( { biblionumber => $biblionumber, diff --git a/t/db_dependent/UsageStats.t b/t/db_dependent/UsageStats.t index a71b160ac6..aae2e7d593 100755 --- a/t/db_dependent/UsageStats.t +++ b/t/db_dependent/UsageStats.t @@ -522,7 +522,7 @@ sub mocking_systempreferences_to_a_set_value { opacuserlogin QuoteOfTheDay RequestOnOpac - reviewson + OPACComments ShowReviewer ShowReviewerPhoto SocialNetworks -- 2.11.0