View | Details | Raw Unified | Return to bug 20819
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_20819.perl (+22 lines)
Line 0 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
4
    # Add table and add column
5
    $dbh->do(q|
6
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 )
7
    |);
8
    $dbh->do(q|
9
ALTER TABLE borrower_modifications ADD COLUMN gdpr_proc_consent datetime
10
    |);
11
12
    # Add two sysprefs too
13
    $dbh->do(q|
14
INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) VALUES ('PrivacyPolicyURL','',NULL,'This URL is used in messages about GDPR consents.', 'Free')
15
    |);
16
    $dbh->do(q|
17
INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) VALUES ('GDPR_Policy','','Enforced\|Permissive\|Disabled','General Data Protection Regulation - policy', 'Choice')
18
    |);
19
20
    SetVersion( $DBversion );
21
    print "Upgrade to $DBversion done (Bug 20819: Add patron_consent)\n";
22
}
(-)a/installer/data/mysql/kohastructure.sql (+16 lines)
Lines 3475-3480 CREATE TABLE IF NOT EXISTS `borrower_modifications` ( Link Here
3475
  `smsalertnumber` varchar(50) DEFAULT NULL,
3475
  `smsalertnumber` varchar(50) DEFAULT NULL,
3476
  `privacy` int(11) DEFAULT NULL,
3476
  `privacy` int(11) DEFAULT NULL,
3477
  `extended_attributes` MEDIUMTEXT DEFAULT NULL,
3477
  `extended_attributes` MEDIUMTEXT DEFAULT NULL,
3478
  `gdpr_proc_consent` datetime, -- data processing consent
3478
  PRIMARY KEY (`verification_token` (191),`borrowernumber`),
3479
  PRIMARY KEY (`verification_token` (191),`borrowernumber`),
3479
  KEY `verification_token` (`verification_token` (191)),
3480
  KEY `verification_token` (`verification_token` (191)),
3480
  KEY `borrowernumber` (`borrowernumber`)
3481
  KEY `borrowernumber` (`borrowernumber`)
Lines 3531-3536 CREATE TABLE IF NOT EXISTS plugin_data ( Link Here
3531
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
3532
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
3532
3533
3533
--
3534
--
3535
-- Table structure for table patron_consent
3536
--
3537
3538
DROP TABLE IF EXISTS patron_consent;
3539
CREATE TABLE patron_consent (
3540
  id int AUTO_INCREMENT,
3541
  borrowernumber int NOT NULL,
3542
  type enum('GDPR_PROCESSING' ), -- allows for future extension
3543
  given_on datetime,
3544
  refused_on datetime,
3545
  PRIMARY KEY (id),
3546
  FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE
3547
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
3548
3549
--
3534
-- Table structure for table `patron_lists`
3550
-- Table structure for table `patron_lists`
3535
--
3551
--
3536
3552
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 175-180 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
175
('FinesLog','1',NULL,'If ON, log fines','YesNo'),
175
('FinesLog','1',NULL,'If ON, log fines','YesNo'),
176
('finesMode','test','off|test|production','Choose the fines mode, \'off\', \'test\' (emails admin report) or \'production\' (accrue overdue fines).  Requires accruefines cronjob.','Choice'),
176
('finesMode','test','off|test|production','Choose the fines mode, \'off\', \'test\' (emails admin report) or \'production\' (accrue overdue fines).  Requires accruefines cronjob.','Choice'),
177
('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'),
177
('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'),
178
('GDPR_Policy','','Enforced|Permissive|Disabled','General Data Protection Regulation - policy', 'Choice'),
178
('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'),
179
('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'),
179
('GoogleIndicTransliteration','0','','GoogleIndicTransliteration on the OPAC.','YesNo'),
180
('GoogleIndicTransliteration','0','','GoogleIndicTransliteration on the OPAC.','YesNo'),
180
('GoogleJackets','0',NULL,'if ON, displays jacket covers from Google Books API','YesNo'),
181
('GoogleJackets','0',NULL,'if ON, displays jacket covers from Google Books API','YesNo'),
Lines 442-447 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
442
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
443
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
443
('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'),
444
('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'),
444
('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'),
445
('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'),
446
('PrivacyPolicyURL','',NULL,'This URL is used in messages about GDPR consents.', 'Free'),
445
('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'),
447
('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'),
446
('ProtectSuperlibrarianPrivileges','1',NULL,'If enabled, non-superlibrarians cannot set superlibrarian privileges','YesNo'),
448
('ProtectSuperlibrarianPrivileges','1',NULL,'If enabled, non-superlibrarians cannot set superlibrarian privileges','YesNo'),
447
('PurgeSuggestionsOlderThan', '', NULL, 'If this script is called without the days parameter', 'Integer'),
449
('PurgeSuggestionsOlderThan', '', NULL, 'If this script is called without the days parameter', 'Integer'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-1 / +13 lines)
Lines 233-235 Patrons: Link Here
233
               yes: Do
233
               yes: Do
234
               no: "Don't"
234
               no: "Don't"
235
         - search the Norwegian national patron database after a local search result was found.
235
         - search the Norwegian national patron database after a local search result was found.
236
- 
236
    Privacy:
237
     -
238
         - Use the following URL
239
         - pref: PrivacyPolicyURL
240
         - 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.)
241
     -
242
         - Set GDPR policy to
243
         - pref: GDPR_Policy
244
           choices:
245
               '': 'Disabled'
246
               Enforced: 'Enforced'
247
               Permissive: 'Permissive'
248
         - "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."

Return to bug 20819