From f2aac9e594de7c3c7c5e80b397e7aa4eb4a94424 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Thu, 25 May 2023 15:40:08 +0000 Subject: [PATCH] Bug 27378: Change ConsentJS to CookieConsentedJS This patch updates the name of the ConsentJS syspref to CookieConsentedJS and amends the description to be more clear what the syspref is for Signed-off-by: Sam Lau --- Koha/Template/Plugin/JSConsents.pm | 4 ++-- installer/data/mysql/mandatory/sysprefs.sql | 2 +- koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss | 6 +++--- .../intranet-tmpl/prog/en/includes/intranet-bottom.inc | 8 ++++---- .../prog/en/modules/admin/preferences/patrons.pref | 8 ++++---- koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc | 4 ++-- koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc | 4 ++-- t/db_dependent/Koha/Template/Plugin/JSConsents.t | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Koha/Template/Plugin/JSConsents.pm b/Koha/Template/Plugin/JSConsents.pm index a21ae178c3..8a559904ad 100644 --- a/Koha/Template/Plugin/JSConsents.pm +++ b/Koha/Template/Plugin/JSConsents.pm @@ -26,7 +26,7 @@ use C4::Context; sub all { my ( $self ) = @_; - my $consents = C4::Context->preference( 'ConsentJS' ); + my $consents = C4::Context->preference( 'CookieConsentedJS' ); if (length $consents > 0) { my $decoded = decode_base64($consents); return decode_json $decoded; @@ -40,7 +40,7 @@ sub all { =head1 NAME Koha::Template::Plugin::JSConsents - TT Plugin for Javascript consents -Provided by ConsentJS syspref +Provided by CookieConsentedJS syspref =head1 SYNOPSIS diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 461621a785..80a464d67d 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -157,7 +157,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('ComponentSortField','title','call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'), ('ComponentSortOrder','asc','asc|dsc|az|za','Specify the default sort order','Choice'), ('ConfirmFutureHolds','0','','Number of days for confirming future holds','Integer'), -('ConsentJS', '', NULL, 'Specify Javascript that requires user consent to run (e.g. tracking code)', 'Free'), +('CookieConsentedJS', '', NULL, 'Add Javascript code that will run if cookie consent is provided (e.g. tracking code).', 'Free'), ('ConsiderOnSiteCheckoutsAsNormalCheckouts','1',NULL,'Consider on-site checkouts as normal checkouts','YesNo'), ('ContentWarningField', '', NULL, 'MARC field to use for content warnings', 'Free'), ('CookieConsent', '0', NULL, 'Require cookie consent to be displayed', 'YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index 047e01ccd8..c021bd0e4f 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -4330,14 +4330,14 @@ div .suggestion_note { } } -#consentJSItems { - #consentJSWarning { +#cookieConsentedJSItems { + #cookieConsentedJSWarning { margin: 20px 0; text-align: center; font-weight: 800; font-size: 120%; } - .consentJSItem { + .cookieConsentedJSItem { margin-bottom: 30px; padding: 10px; border: 1px solid #ccc; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc index cf7fb3150d..3178c30fdc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc @@ -85,7 +85,7 @@ [% Koha.Preference( 'CookieConsentBar' ) | $raw %]
- [% IF ( Koha.Preference( 'ConsentJS' ).length > 0 ) %] + [% IF ( Koha.Preference( 'CookieConsentedJS' ).length > 0 ) %] [% END %] @@ -122,7 +122,7 @@ [% END %] - - [% IF Koha.Preference( 'CookieConsent' ) && Koha.Preference( 'ConsentJS' ).length > 0 %] + + [% IF Koha.Preference( 'CookieConsent' ) && Koha.Preference( 'CookieConsentedJS' ).length > 0 %] [% consents = JSConsents.all() %] [% FOREACH consent IN consents %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index 55e8e10476..4bdb52f3e6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -389,11 +389,11 @@ Patrons: no: "Don't require" - cookie consent to be displayed - - - Specify Javascript that requires user consent to run (e.g. tracking code) - - pref: ConsentJS + - Add Javascript code that will run if cookie consent is provided (e.g. tracking code). + - pref: CookieConsentedJS type: modaljs - initiator: populateConsentJS - processor: prepareConsentJS + initiator: populateCookieConsentedJS + processor: prepareCookieConsentedJS - - Show the following HTML in the cookie consent bar that is displayed at the bottom of the screen - pref: CookieConsentBar diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc index 0609fee5bc..8844023d3d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc @@ -451,7 +451,7 @@ [% Koha.Preference( 'CookieConsentBar' ) | $raw %]
- [% IF ( Koha.Preference( 'ConsentJS' ).length > 0 ) %] + [% IF ( Koha.Preference( 'CookieConsentedJS' ).length > 0 ) %] [% END %] @@ -488,7 +488,7 @@