Bugzilla – Attachment 121996 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: Add sysprefs
Bug-27378-Add-sysprefs.patch (text/plain), 7.74 KB, created by
Andrew Isherwood
on 2021-06-15 12:52:48 UTC
(
hide
)
Description:
Bug 27378: Add sysprefs
Filename:
MIME Type:
Creator:
Andrew Isherwood
Created:
2021-06-15 12:52:48 UTC
Size:
7.74 KB
patch
obsolete
>From 041d6b695572dcb8848cc5dc6a9f00155026458f Mon Sep 17 00:00:00 2001 >From: Andrew Isherwood <andrew.isherwood@ptfs-europe.com> >Date: Tue, 12 Jan 2021 13:49:52 +0000 >Subject: [PATCH] Bug 27378: Add sysprefs > >This commit adds 4 new sysprefs: > >- CookieConsent - the master on/off for this functionality >- ConsentJS - The configuration for JS code that requires consent prior to running. >- CookieConsentBar: Allows the admin to specify the HTML that will be >displayed in the consent bar that appears at the bottom of the page >- CookieConsentPopup: Allows the admin to specify the HTML that will be >displayed in the cookie consent popup >--- > .../bug_27378_add_ConsentJS_syspref.perl | 8 +++++++ > ...ug_27378_add_CookieConsentBar_syspref.perl | 8 +++++++ > ..._27378_add_CookieConsentPopup_syspref.perl | 8 +++++++ > .../bug_27378_add_CookieConsent_syspref.perl | 8 +++++++ > installer/data/mysql/mandatory/sysprefs.sql | 4 ++++ > .../en/modules/admin/preferences/patrons.pref | 24 +++++++++++++++++++ > 6 files changed, 60 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_27378_add_ConsentJS_syspref.perl > create mode 100644 installer/data/mysql/atomicupdate/bug_27378_add_CookieConsentBar_syspref.perl > create mode 100644 installer/data/mysql/atomicupdate/bug_27378_add_CookieConsentPopup_syspref.perl > create mode 100644 installer/data/mysql/atomicupdate/bug_27378_add_CookieConsent_syspref.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_27378_add_ConsentJS_syspref.perl b/installer/data/mysql/atomicupdate/bug_27378_add_ConsentJS_syspref.perl >new file mode 100644 >index 0000000000..b219ead1e7 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_27378_add_ConsentJS_syspref.perl >@@ -0,0 +1,8 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('ConsentJS', '', 'Specify Javascript that requires user consent to run (e.g. tracking code)', '', 'Free'); | ); >+ >+ # Always end with this (adjust the bug info) >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 27378 - Add ConsentJS syspref)\n"; >+} >diff --git a/installer/data/mysql/atomicupdate/bug_27378_add_CookieConsentBar_syspref.perl b/installer/data/mysql/atomicupdate/bug_27378_add_CookieConsentBar_syspref.perl >new file mode 100644 >index 0000000000..c1f2f82cf6 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_27378_add_CookieConsentBar_syspref.perl >@@ -0,0 +1,8 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $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'); } ); >+ >+ # Always end with this (adjust the bug info) >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 27378 - Add CookieConsentBar syspref)\n"; >+} >diff --git a/installer/data/mysql/atomicupdate/bug_27378_add_CookieConsentPopup_syspref.perl b/installer/data/mysql/atomicupdate/bug_27378_add_CookieConsentPopup_syspref.perl >new file mode 100644 >index 0000000000..b7217c2800 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_27378_add_CookieConsentPopup_syspref.perl >@@ -0,0 +1,8 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $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'); | ); >+ >+ # Always end with this (adjust the bug info) >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 27378 - Add CookieConsentPopup syspref)\n"; >+} >diff --git a/installer/data/mysql/atomicupdate/bug_27378_add_CookieConsent_syspref.perl b/installer/data/mysql/atomicupdate/bug_27378_add_CookieConsent_syspref.perl >new file mode 100644 >index 0000000000..3592a64248 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_27378_add_CookieConsent_syspref.perl >@@ -0,0 +1,8 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do( q| INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('CookieConsent', '0', 'Require cookie consent to be displayed', '', 'YesNo'); | ); >+ >+ # Always end with this (adjust the bug info) >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 27378 - Add CookieConsent syspref)\n"; >+} >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index ef7d4561fb..caa9c220a9 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -140,7 +140,11 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page. NOTE: this can slow down search response time significantly','YesNo'), > ('CollapseFieldsPatronAddForm','',NULL,'Collapse these fields by default when adding a new patron. These fields can still be expanded.','Multiple'), > ('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'), > ('ConsiderOnSiteCheckoutsAsNormalCheckouts','1',NULL,'Consider on-site checkouts as normal checkouts','YesNo'), >+('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'), > ('CronjobLog','0',NULL,'If ON, log information from cron jobs.','YesNo'), > ('CumulativeRestrictionPeriods',0,NULL,'Cumulate the restriction periods instead of keeping the highest','YesNo'), > ('CurrencyFormat','US','US|FR|CH','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\' in \'FR\' or \'360,000.00\' in \'US\'.','Choice'), >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 8954ad2847..928ceeb0a2 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 >@@ -349,6 +349,30 @@ Patrons: > - days and remove anonymized patron accounts after > - pref: PatronRemovalDelay > - "days.<br>IMPORTANT: No action is performed when these delays are empty (no text). But a zero value ('0') is interpreted as no delay (do it now)! The actions are performed by the cleanup database cron job." >+ - >+ - pref: CookieConsent >+ choices: >+ yes: Require >+ no: "Don't require" >+ - cookie consent to be displayed >+ - >+ - Specify Javascript that requires user consent to run (e.g. tracking code) >+ - pref: ConsentJS >+ type: modaljs >+ initiator: populateConsentJS >+ processor: prepareConsentJS >+ - >+ - 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 >-- >2.20.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