@@ -, +, @@ --- 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 --- a/installer/data/mysql/atomicupdate/bug_20819.perl +++ a/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"; +} --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -3452,6 +3452,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`) @@ -3508,6 +3509,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` -- --- a/installer/data/mysql/sysprefs.sql +++ a/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'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -227,3 +227,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." --