Bugzilla – Attachment 77264 Details for
Bug 20819
GDPR: Add a consent field for processing personal data in account menu and self-registration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20819: Dbrev for new table patron_consent and sysprefs
Bug-20819-Dbrev-for-new-table-patronconsent-and-sy.patch (text/plain), 7.06 KB, created by
Marcel de Rooy
on 2018-07-25 14:51:23 UTC
(
hide
)
Description:
Bug 20819: Dbrev for new table patron_consent and sysprefs
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-07-25 14:51:23 UTC
Size:
7.06 KB
patch
obsolete
>From 9420ea5ae553481539fd74471b20699fef19fc0c Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 4 Jun 2018 13:11:58 +0200 >Subject: [PATCH] Bug 20819: Dbrev for new table patron_consent and sysprefs >Content-Type: text/plain; charset=utf-8 > >[1] We add table patron_consent. >It allows for future extension. We could e.g. save consent for newsletter etc. >[2] Add one field to borrower_modifications >Datetime the patron who self-registered, gave consent. >[3] Syspref PrivacyPolicyURL >[4] Syspref GDPR_Policy: enforced, permissive or disabled. > >Test plan: >[1] Run the dbrev or do a new install. >[2] Look at the description of the new prefs in Administration. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > installer/data/mysql/atomicupdate/bug_20819.perl | 22 ++++++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 16 ++++++++++++++++ > installer/data/mysql/sysprefs.sql | 2 ++ > .../prog/en/modules/admin/preferences/patrons.pref | 13 +++++++++++++ > 4 files changed, 53 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_20819.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_20819.perl b/installer/data/mysql/atomicupdate/bug_20819.perl >new file mode 100644 >index 0000000..99ffc08 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_20819.perl >@@ -0,0 +1,22 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ >+ # Add table and add column >+ $dbh->do(q| >+CREATE TABLE patron_consent (id int AUTO_INCREMENT, borrowernumber int NOT NULL, type enum('GDPR_PROCESSING' ), given_on datetime, refused_on datetime, PRIMARY KEY (id), FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE ) >+ |); >+ $dbh->do(q| >+ALTER TABLE borrower_modifications ADD COLUMN gdpr_proc_consent datetime >+ |); >+ >+ # Add two sysprefs too >+ $dbh->do(q| >+INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) VALUES ('PrivacyPolicyURL','',NULL,'This URL is used in messages about GDPR consents.', 'Free') >+ |); >+ $dbh->do(q| >+INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) VALUES ('GDPR_Policy','','Enforced\|Permissive\|Disabled','General Data Protection Regulation - policy', 'Choice') >+ |); >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 20819: Add patron_consent)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 206959f..7779084 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -3475,6 +3475,7 @@ CREATE TABLE IF NOT EXISTS `borrower_modifications` ( > `smsalertnumber` varchar(50) DEFAULT NULL, > `privacy` int(11) DEFAULT NULL, > `extended_attributes` MEDIUMTEXT DEFAULT NULL, >+ `gdpr_proc_consent` datetime, -- data processing consent > PRIMARY KEY (`verification_token` (191),`borrowernumber`), > KEY `verification_token` (`verification_token` (191)), > KEY `borrowernumber` (`borrowernumber`) >@@ -3531,6 +3532,21 @@ CREATE TABLE IF NOT EXISTS plugin_data ( > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > > -- >+-- Table structure for table patron_consent >+-- >+ >+DROP TABLE IF EXISTS patron_consent; >+CREATE TABLE patron_consent ( >+ id int AUTO_INCREMENT, >+ borrowernumber int NOT NULL, >+ type enum('GDPR_PROCESSING' ), -- allows for future extension >+ given_on datetime, >+ refused_on datetime, >+ PRIMARY KEY (id), >+ FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE >+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+ >+-- > -- Table structure for table `patron_lists` > -- > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 4a62a26..a441996 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -175,6 +175,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('FinesLog','1',NULL,'If ON, log fines','YesNo'), > ('finesMode','test','off|test|production','Choose the fines mode, \'off\', \'test\' (emails admin report) or \'production\' (accrue overdue fines). Requires accruefines cronjob.','Choice'), > ('FRBRizeEditions','0','','If ON, Koha will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','YesNo'), >+('GDPR_Policy','','Enforced|Permissive|Disabled','General Data Protection Regulation - policy', 'Choice'), > ('gist','0','','Default Goods and Services tax rate NOT in %, but in numeric form (0.12 for 12%), set to 0 to disable GST','Integer'), > ('GoogleIndicTransliteration','0','','GoogleIndicTransliteration on the OPAC.','YesNo'), > ('GoogleJackets','0',NULL,'if ON, displays jacket covers from Google Books API','YesNo'), >@@ -442,6 +443,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'), > ('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'), > ('PrintNoticesMaxLines','0','','If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.','Integer'), >+('PrivacyPolicyURL','',NULL,'This URL is used in messages about GDPR consents.', 'Free'), > ('ProcessingFeeNote', '', NULL, 'Set the text to be recorded in the column note, table accountlines when the processing fee (defined in item type) is applied', 'textarea'), > ('ProtectSuperlibrarianPrivileges','1',NULL,'If enabled, non-superlibrarians cannot set superlibrarian privileges','YesNo'), > ('PurgeSuggestionsOlderThan', '', NULL, 'If this script is called without the days parameter', 'Integer'), >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 4adcf1b..1d0386e 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 >@@ -233,3 +233,16 @@ Patrons: > yes: Do > no: "Don't" > - search the Norwegian national patron database after a local search result was found. >+ Privacy: >+ - >+ - Use the following URL >+ - pref: PrivacyPolicyURL >+ - to refer to your local privacy policy in messages about privacy and data protection. (If you enforce GDPR policy, make sure that this page is not blocked.) >+ - >+ - Set GDPR policy to >+ - pref: GDPR_Policy >+ choices: >+ '': 'Disabled' >+ Enforced: 'Enforced' >+ Permissive: 'Permissive' >+ - "GDPR is the EU General Data Protection Regulation. When you enforce, patrons need to give consent before using the OPAC. If you set to permissive, Koha will warn but not enforce." >-- >2.1.4
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 20819
:
75765
|
75766
|
75767
|
75818
|
75819
|
75820
|
76781
|
76782
|
76783
|
76784
|
76785
|
77264
|
77265
|
77266
|
77267
|
77268
|
77269
|
78369
|
78370
|
78371
|
78372
|
78373
|
78374
|
78779
|
78781
|
78783
|
78784
|
78786
|
78788
|
79059
|
79062
|
79063
|
79064
|
79065
|
79066
|
79067
|
79129
|
79130
|
79131
|
79132
|
79133
|
79134
|
79135
|
79175
|
79190