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 3450-3455 CREATE TABLE IF NOT EXISTS `borrower_modifications` ( Link Here
3450
  `smsalertnumber` varchar(50) DEFAULT NULL,
3450
  `smsalertnumber` varchar(50) DEFAULT NULL,
3451
  `privacy` int(11) DEFAULT NULL,
3451
  `privacy` int(11) DEFAULT NULL,
3452
  `extended_attributes` MEDIUMTEXT DEFAULT NULL,
3452
  `extended_attributes` MEDIUMTEXT DEFAULT NULL,
3453
  `gdpr_proc_consent` datetime, -- data processing consent
3453
  PRIMARY KEY (`verification_token` (191),`borrowernumber`),
3454
  PRIMARY KEY (`verification_token` (191),`borrowernumber`),
3454
  KEY `verification_token` (`verification_token` (191)),
3455
  KEY `verification_token` (`verification_token` (191)),
3455
  KEY `borrowernumber` (`borrowernumber`)
3456
  KEY `borrowernumber` (`borrowernumber`)
Lines 3506-3511 CREATE TABLE IF NOT EXISTS plugin_data ( Link Here
3506
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
3507
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
3507
3508
3508
--
3509
--
3510
-- Table structure for table patron_consent
3511
--
3512
3513
DROP TABLE IF EXISTS patron_consent;
3514
CREATE TABLE patron_consent (
3515
  id int AUTO_INCREMENT,
3516
  borrowernumber int NOT NULL,
3517
  type enum('GDPR_PROCESSING' ), -- allows for future extension
3518
  given_on datetime,
3519
  refused_on datetime,
3520
  PRIMARY KEY (id),
3521
  FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE
3522
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
3523
3524
--
3509
-- Table structure for table `patron_lists`
3525
-- Table structure for table `patron_lists`
3510
--
3526
--
3511
3527
(-)a/installer/data/mysql/sysprefs.sql (+2 lines)
Lines 176-181 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
176
('FinesLog','1',NULL,'If ON, log fines','YesNo'),
176
('FinesLog','1',NULL,'If ON, log fines','YesNo'),
177
('finesMode','test','off|test|production','Choose the fines mode, \'off\', \'test\' (emails admin report) or \'production\' (accrue overdue fines).  Requires accruefines cronjob.','Choice'),
177
('finesMode','test','off|test|production','Choose the fines mode, \'off\', \'test\' (emails admin report) or \'production\' (accrue overdue fines).  Requires accruefines cronjob.','Choice'),
178
('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
('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'),
179
('GDPR_Policy','','Enforced|Permissive|Disabled','General Data Protection Regulation - policy', 'Choice'),
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'),
180
('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'),
180
('GoogleIndicTransliteration','0','','GoogleIndicTransliteration on the OPAC.','YesNo'),
181
('GoogleIndicTransliteration','0','','GoogleIndicTransliteration on the OPAC.','YesNo'),
181
('GoogleJackets','0',NULL,'if ON, displays jacket covers from Google Books API','YesNo'),
182
('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 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