Bugzilla – Attachment 115623 Details for
Bug 27487
Rename system preference reviewson to OPACComments
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27487: Rename system preference reviewson to OPACComments
Bug-27487-Rename-system-preference-reviewson-to-OP.patch (text/plain), 7.67 KB, created by
James O'Keeffe
on 2021-01-21 21:40:37 UTC
(
hide
)
Description:
Bug 27487: Rename system preference reviewson to OPACComments
Filename:
MIME Type:
Creator:
James O'Keeffe
Created:
2021-01-21 21:40:37 UTC
Size:
7.67 KB
patch
obsolete
>From eae98bd48bc1f875d2d0497ebfc4c5dcb30be883 Mon Sep 17 00:00:00 2001 >From: James O'Keeffe <jamespfk@gmail.com> >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 >--- > 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 7f0afaa594..3c4d95eb4b 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 c0fc56e502..15a687c4b8 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 @@ > <a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a> > </li> > [% 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 ) ) %] > <li class="nav-item"> > <a href="/cgi-bin/koha/opac-showreviews.pl">Recent comments</a> > </li> >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 1f0d336a73..05ad88be3a 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 @@ > </li> > [% END %] > >- [% IF Koha.Preference( 'reviewson' ) == 1 %] >+ [% IF Koha.Preference( 'OPACComments' ) == 1 %] > <li id="tab_comments"><a href="#comments">Comments[% ' ( ' _ (reviews.size || 0) _ ' )' | html %]</a></li> > [% END %] > >@@ -881,7 +881,7 @@ > </div> > [% END # / IF LibraryThingForLibrariesID && LibraryThingForLibrariesTabbedView %] > >- [% IF Koha.Preference( 'reviewson' ) == 1 %] >+ [% IF Koha.Preference( 'OPACComments' ) == 1 %] > <div id="comments"> > <div id="newcomment"></div> > [% IF ( reviews ) %] >@@ -954,7 +954,7 @@ > </div> > [% END # / IF loggedinusername %] > </div> <!-- / #comments --> >- [% END # / IF reviewson %] >+ [% END # / IF OPACComments %] > > [% IF ( OPACFRBRizeEditions && XISBNS ) %] > <div id="editions"> >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
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 27487
:
115623
|
115713
|
115995