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 3452-3457 CREATE TABLE IF NOT EXISTS `borrower_modifications` ( Link Here
3452
  `smsalertnumber` varchar(50) DEFAULT NULL,
3452
  `smsalertnumber` varchar(50) DEFAULT NULL,
3453
  `privacy` int(11) DEFAULT NULL,
3453
  `privacy` int(11) DEFAULT NULL,
3454
  `extended_attributes` MEDIUMTEXT DEFAULT NULL,
3454
  `extended_attributes` MEDIUMTEXT DEFAULT NULL,
3455
  `gdpr_proc_consent` datetime, -- data processing consent
3455
  PRIMARY KEY (`verification_token` (191),`borrowernumber`),
3456
  PRIMARY KEY (`verification_token` (191),`borrowernumber`),
3456
  KEY `verification_token` (`verification_token` (191)),
3457
  KEY `verification_token` (`verification_token` (191)),
3457
  KEY `borrowernumber` (`borrowernumber`)
3458
  KEY `borrowernumber` (`borrowernumber`)
Lines 3508-3513 CREATE TABLE IF NOT EXISTS plugin_data ( Link Here
3508
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
3509
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
3509
3510
3510
--
3511
--
3512
-- Table structure for table patron_consent
3513
--
3514
3515
DROP TABLE IF EXISTS patron_consent;
3516
CREATE TABLE patron_consent (
3517
  id int AUTO_INCREMENT,
3518
  borrowernumber int NOT NULL,
3519
  type enum('GDPR_PROCESSING' ), -- allows for future extension
3520
  given_on datetime,
3521
  refused_on datetime,
3522
  PRIMARY KEY (id),
3523
  FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE
3524
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
3525
3526
--
3511
-- Table structure for table `patron_lists`
3527
-- Table structure for table `patron_lists`
3512
--
3528
--
3513
3529
(-)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 227-229 Patrons: Link Here
227
               yes: Do
227
               yes: Do
228
               no: "Don't"
228
               no: "Don't"
229
         - search the Norwegian national patron database after a local search result was found.
229
         - search the Norwegian national patron database after a local search result was found.
230
- 
230
    Privacy:
231
     -
232
         - Use the following URL
233
         - pref: PrivacyPolicyURL
234
         - 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.)
235
     -
236
         - Set GDPR policy to
237
         - pref: GDPR_Policy
238
           choices:
239
               '': 'Disabled'
240
               Enforced: 'Enforced'
241
               Permissive: 'Permissive'
242
         - "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