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 3460-3465 CREATE TABLE IF NOT EXISTS `borrower_modifications` ( Link Here
3460
  `smsalertnumber` varchar(50) DEFAULT NULL,
3460
  `smsalertnumber` varchar(50) DEFAULT NULL,
3461
  `privacy` int(11) DEFAULT NULL,
3461
  `privacy` int(11) DEFAULT NULL,
3462
  `extended_attributes` MEDIUMTEXT DEFAULT NULL,
3462
  `extended_attributes` MEDIUMTEXT DEFAULT NULL,
3463
  `gdpr_proc_consent` datetime, -- data processing consent
3463
  PRIMARY KEY (`verification_token` (191),`borrowernumber`),
3464
  PRIMARY KEY (`verification_token` (191),`borrowernumber`),
3464
  KEY `verification_token` (`verification_token` (191)),
3465
  KEY `verification_token` (`verification_token` (191)),
3465
  KEY `borrowernumber` (`borrowernumber`)
3466
  KEY `borrowernumber` (`borrowernumber`)
Lines 3516-3521 CREATE TABLE IF NOT EXISTS plugin_data ( Link Here
3516
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
3517
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
3517
3518
3518
--
3519
--
3520
-- Table structure for table patron_consent
3521
--
3522
3523
DROP TABLE IF EXISTS patron_consent;
3524
CREATE TABLE patron_consent (
3525
  id int AUTO_INCREMENT,
3526
  borrowernumber int NOT NULL,
3527
  type enum('GDPR_PROCESSING' ), -- allows for future extension
3528
  given_on datetime,
3529
  refused_on datetime,
3530
  PRIMARY KEY (id),
3531
  FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE
3532
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
3533
3534
--
3519
-- Table structure for table `patron_lists`
3535
-- Table structure for table `patron_lists`
3520
--
3536
--
3521
3537
(-)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 438-443 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
438
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
439
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
439
('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'),
440
('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'),
440
('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'),
441
('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'),
442
('PrivacyPolicyURL','',NULL,'This URL is used in messages about GDPR consents.', 'Free'),
441
('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'),
443
('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'),
442
('ProtectSuperlibrarianPrivileges','1',NULL,'If enabled, non-superlibrarians cannot set superlibrarian privileges','YesNo'),
444
('ProtectSuperlibrarianPrivileges','1',NULL,'If enabled, non-superlibrarians cannot set superlibrarian privileges','YesNo'),
443
('PurgeSuggestionsOlderThan', '', NULL, 'If this script is called without the days parameter', 'Integer'),
445
('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 211-213 Patrons: Link Here
211
               yes: Allow only superlibrarians
211
               yes: Allow only superlibrarians
212
               no: Allow all permitted users
212
               no: Allow all permitted users
213
         - "to access/change superlibrarian privileges. Note: A permitted user needs to have the 'permissions' flag (if no superlibrarian)."
213
         - "to access/change superlibrarian privileges. Note: A permitted user needs to have the 'permissions' flag (if no superlibrarian)."
214
- 
214
    Privacy:
215
     -
216
         - Use the following URL
217
         - pref: PrivacyPolicyURL
218
         - 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.)
219
     -
220
         - Set GDPR policy to
221
         - pref: GDPR_Policy
222
           choices:
223
               '': 'Disabled'
224
               Enforced: 'Enforced'
225
               Permissive: 'Permissive'
226
         - "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