From d75072966935dd9c98703395cfeba3c13d0dc538 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Fri, 26 May 2023 11:16:25 +0000 Subject: [PATCH] Bug 27378: Remove two sysprefs and replace with html customisations Currently there are two sysprefs - CookieConsentBar and CookieConsentPopup. These allow the user to select what text they would like to see in the consent bar and modal. These have been removed and replaced with HTML customisations to allow more flexible customisations and different languages. Sponsored by: PTFS-Europe --- Koha/AdditionalContents.pm | 2 ++ .../bug_27378-add_cookie_consents.pl | 6 ---- installer/data/mysql/mandatory/sysprefs.sql | 2 -- .../prog/en/includes/intranet-bottom.inc | 17 +++++++++-- .../en/modules/admin/preferences/patrons.pref | 12 -------- .../en/modules/tools/additional-contents.tt | 2 +- .../bootstrap/en/includes/masthead.inc | 28 +++++++++++-------- 7 files changed, 33 insertions(+), 36 deletions(-) diff --git a/Koha/AdditionalContents.pm b/Koha/AdditionalContents.pm index 3ed9f42f41..430ff53934 100644 --- a/Koha/AdditionalContents.pm +++ b/Koha/AdditionalContents.pm @@ -63,6 +63,8 @@ location is one of this: - OpacLoginInstructions - OpacSuggestionInstructions - ArticleRequestsDisclaimerText +- CookieConsentBar +- CookieConsentPopup =cut diff --git a/installer/data/mysql/atomicupdate/bug_27378-add_cookie_consents.pl b/installer/data/mysql/atomicupdate/bug_27378-add_cookie_consents.pl index 00c8bf0967..ca2205f35e 100644 --- a/installer/data/mysql/atomicupdate/bug_27378-add_cookie_consents.pl +++ b/installer/data/mysql/atomicupdate/bug_27378-add_cookie_consents.pl @@ -12,11 +12,5 @@ return { $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('CookieConsent', '0', 'Require cookie consent to be displayed', '', 'YesNo'); | ); say $out "Added new system preference 'CookieConsent'"; - - $dbh->do( q{ INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('CookieConsentBar', '', 'Show the following HTML in the cookie consent bar that is displayed at the bottom of the screen', '70|10', 'Textarea'); } ); - say $out "Added new system preference 'CookieConsentBar'"; - - $dbh->do( q{INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('CookieConsentPopup', '', 'Show the following HTML in the cookie consent popup', '70|10', 'Textarea');} ); - say $out "Added new system preference 'CookieConsentPopup'"; }, }; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index d9435ae67f..72cdcdcfc1 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -160,8 +160,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('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'), -('CookieConsentBar', '', '70|10', 'Show the following HTML in the cookie consent bar that is displayed at the bottom of the screen', 'Textarea'), -('CookieConsentPopup', '', '70|10', 'Show the following HTML in the cookie consent popup', 'Textarea'), ('CreateAVFromCataloguing', '1', '', 'Ability to create authorized values from the cataloguing module', 'YesNo'), ('CronjobLog','0',NULL,'If ON, log information from cron jobs.','YesNo'), ('CumulativeRestrictionPeriods',0,NULL,'Cumulate the restriction periods instead of keeping the highest','YesNo'), 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 3178c30fdc..f9e1a27bc0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc @@ -2,7 +2,10 @@ [% USE Koha %] [% USE KohaPlugins %] [% USE Asset %] +[% USE AdditionalContents %] [% IF Koha.Preference( 'CookieConsent' ) %] + [% SET CookieConsentBar = AdditionalContents.get( location => "CookieConsentBar", lang => lang, library => branchcode || default_branch ) %] + [% SET CookieConsentPopup = AdditionalContents.get( location => "CookieConsentPopup", lang => lang, library => branchcode || default_branch ) %] [% USE JSConsents %] [% END %] @@ -82,7 +85,13 @@ [% IF Koha.Preference( 'CookieConsent' ) %]