Bugzilla – Attachment 153332 Details for
Bug 27378
Enable compliance with EU Cookie Legislation via cookie consent
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27378: Remove two sysprefs and replace with html customisations
Bug-27378-Remove-two-sysprefs-and-replace-with-htm.patch (text/plain), 12.27 KB, created by
Matt Blenkinsop
on 2023-07-11 16:49:27 UTC
(
hide
)
Description:
Bug 27378: Remove two sysprefs and replace with html customisations
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2023-07-11 16:49:27 UTC
Size:
12.27 KB
patch
obsolete
>From 2c581a1545ca3dc4966300dbcc945782dd4ae825 Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >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 504f055abf..d496d25559 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 %] > </div> >@@ -82,7 +85,13 @@ > [% IF Koha.Preference( 'CookieConsent' ) %] > <!-- Cookie consent bar --> > <div id="cookieConsentBar" aria-hidden="true"> >- [% Koha.Preference( 'CookieConsentBar' ) | $raw %] >+ [% IF ( CookieConsentBar && CookieConsentBar.content && CookieConsentBar.content.count >0 ) %] >+ <div id="cookieConsentBarText"> >+ [%- FOREACH item IN CookieConsentBar.content -%] >+ [%- item.content | $raw -%] >+ [%- END -%] >+ </div> >+ [% END %] > <div id="consentButtons"> > <button type="button" class="btn btn-primary consentAcceptAll">Accept all cookies</button> > [% IF ( Koha.Preference( 'CookieConsentedJS' ).length > 0 ) %] >@@ -99,9 +108,11 @@ > <h2 class="modal-title" id="cookieConsentModalLabel">Cookie consent</h2> > </div> > <div class="modal-body"> >- [% IF Koha.Preference( 'CookieConsentPopup' ) %] >+ [% IF ( CookieConsentPopup && CookieConsentPopup.content && CookieConsentPopup.content.count >0 ) %] > <div id="cookieConsentPopupText"> >- [% Koha.Preference( 'CookieConsentPopup' ) | $raw %] >+ [%- FOREACH item IN CookieConsentPopup.content -%] >+ [%- item.content | $raw -%] >+ [%- END -%] > </div> > [% END %] > <div id="consentCookieList"> >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 dc335fbfc3..8692e5e9e8 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 >@@ -400,18 +400,6 @@ Patrons: > type: modaljs > initiator: populateCookieConsentedJS > processor: prepareCookieConsentedJS >- - >- - Show the following HTML in the cookie consent bar that is displayed at the bottom of the screen >- - pref: CookieConsentBar >- type: textarea >- syntax: text/html >- class: code >- - >- - Show the following HTML in the cookie consent popup >- - pref: CookieConsentPopup >- type: textarea >- syntax: text/html >- class: code > Security: > - > - Login passwords for staff and patrons must be at least >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >index 94cf527b3c..a5e3ce41e2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >@@ -492,7 +492,7 @@ > [% END %] > [% END %] > [% ELSE %] >- [% SET available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'CatalogConcernHelp', 'CatalogConcernTemplate' ] %] >+ [% SET available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup' ] %] > [% FOREACH l IN available_options.sort %] > [% IF l == location %] > <option value="[% l | html %]" selected="selected">[% l | html %]</option> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index ab29d53043..440c4b1dbf 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -13,6 +13,8 @@ > [% SET OpacCustomSearch = AdditionalContents.get( location => "OpacCustomSearch", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] > [% SET OpacLoginInstructions = AdditionalContents.get( location => "OpacLoginInstructions", lang => lang, library => branchcode || default_branch ) %] > [% SET OpacMoreSearches = AdditionalContents.get( location => "OpacMoreSearches", lang => lang, library => branchcode || default_branch ) %] >+[% SET CookieConsentBar = AdditionalContents.get( location => "CookieConsentBar", lang => lang, library => branchcode || default_branch ) %] >+[% SET CookieConsentPopup = AdditionalContents.get( location => "CookieConsentPopup", lang => lang, library => branchcode || default_branch ) %] > > <button id="scrolltocontent">Skip to main content</button> > <div id="wrapper"> >@@ -446,17 +448,19 @@ > </div> <!-- /.modal-dialog --> > </div> <!-- /#modalAuth --> > [% IF Koha.Preference( 'CookieConsent' ) %] >- <!-- Cookie consent bar --> >- <div id="cookieConsentBar" aria-hidden="true"> >- [% Koha.Preference( 'CookieConsentBar' ) | $raw %] >- <div id="consentButtons"> >- <button type="button" class="btn btn-primary consentAcceptAll">Accept all cookies</button> >- [% IF ( Koha.Preference( 'CookieConsentedJS' ).length > 0 ) %] >- <button type="button" class="btn btn-primary consentAcceptEssential">Accept only essential cookies</button> >- <button type="button" class="btn btn-info" id="consentMoreInfo" aria-label="Click to view more information about your cookie consents">More information</button> >+ <!-- Cookie consent bar --> >+ <div id="cookieConsentBar" aria-hidden="true"> >+ [% IF ( CookieConsentBar ) %] >+ [% PROCESS koha_news_block news => CookieConsentBar %] > [% END %] >- </div> >- </div> <!-- /#cookieConsentBar --> >+ <div id="consentButtons"> >+ <button type="button" class="btn btn-primary consentAcceptAll">Accept all cookies</button> >+ [% IF ( Koha.Preference( 'CookieConsentedJS' ).length > 0 ) %] >+ <button type="button" class="btn btn-primary consentAcceptEssential">Accept only essential cookies</button> >+ <button type="button" class="btn btn-info" id="consentMoreInfo" aria-label="Click to view more information about your cookie consents">More information</button> >+ [% END %] >+ </div> >+ </div> <!-- /#cookieConsentBar --> > <!-- Cookie consent modal --> > <div id="cookieConsentModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="cookieConsentModalLabel" aria-hidden="true"> > <div class="modal-dialog"> >@@ -465,9 +469,9 @@ > <h2 class="modal-title" id="cookieConsentModalLabel">Cookie consent</h2> > </div> > <div class="modal-body"> >- [% IF Koha.Preference( 'CookieConsentPopup' ) %] >+ [% IF ( CookieConsentPopup ) %] > <div id="cookieConsentPopupText"> >- [% Koha.Preference( 'CookieConsentPopup' ) | $raw %] >+ [% PROCESS koha_news_block news => CookieConsentPopup %] > </div> > [% END %] > <div id="consentCookieList"> >-- >2.37.1 (Apple Git-137.1)
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 27378
:
115544
|
115545
|
115546
|
115547
|
115548
|
115756
|
116397
|
116398
|
116399
|
116400
|
116401
|
116402
|
116403
|
116416
|
116417
|
116418
|
116419
|
116420
|
116421
|
116422
|
116423
|
116978
|
116979
|
116980
|
116981
|
116982
|
116983
|
116984
|
116985
|
116986
|
121728
|
121729
|
121730
|
121731
|
121732
|
121733
|
121734
|
121735
|
121995
|
121996
|
121997
|
121998
|
121999
|
122000
|
122001
|
122002
|
122635
|
122636
|
122637
|
122638
|
122639
|
122640
|
122641
|
122642
|
124957
|
124958
|
124959
|
124960
|
124961
|
124962
|
124963
|
124964
|
124965
|
130072
|
130073
|
130074
|
130075
|
130076
|
130077
|
130078
|
130079
|
130080
|
135309
|
135310
|
135311
|
135312
|
135313
|
135314
|
135315
|
135316
|
135317
|
135318
|
151735
|
151736
|
151737
|
151738
|
151739
|
151740
|
151741
|
151742
|
151743
|
151744
|
151745
|
151746
|
151747
|
151748
|
151749
|
151750
|
151751
|
151752
|
151753
|
151826
|
151827
|
151828
|
151829
|
151830
|
151831
|
151832
|
151833
|
151834
|
151835
|
151836
|
151837
|
151838
|
151839
|
151840
|
151841
|
151842
|
151843
|
151844
|
153326
|
153327
|
153328
|
153329
|
153330
|
153331
|
153332
|
153333
|
153334
|
153335
|
153336
|
154015
|
154016
|
154017
|
154018
|
154019
|
154020
|
154021
|
154022
|
154023
|
154024
|
154025
|
154093
|
154264
|
154265
|
154266
|
154267
|
154268
|
154269
|
154270
|
154271
|
154272
|
154273
|
154274
|
154275
|
154276