From 11e3c80438e2db0940dedf1d091bbe3aa7333aad Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 22 Nov 2019 15:38:34 +0100 Subject: [PATCH] Bug 24151: Add sysprefs 3 new sysprefs: * Pseudonymization * PseudonymizationPatronFields * PseudonymizationTransactionFields Sponsored-by: Association KohaLa - https://koha-fr.org/ --- installer/data/mysql/atomicupdate/bug_XXXXX.perl | 13 +++++++++ installer/data/mysql/sysprefs.sql | 3 ++ .../prog/en/modules/admin/preferences/patrons.pref | 33 ++++++++++++++++++++++ 3 files changed, 49 insertions(+) diff --git a/installer/data/mysql/atomicupdate/bug_XXXXX.perl b/installer/data/mysql/atomicupdate/bug_XXXXX.perl index 0704ce0af9..1a9118f9fe 100644 --- a/installer/data/mysql/atomicupdate/bug_XXXXX.perl +++ b/installer/data/mysql/atomicupdate/bug_XXXXX.perl @@ -40,6 +40,19 @@ if( CheckVersion( $DBversion ) ) { |); } + $dbh->do(q| + INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) + VALUES ('Pseudonymization','1',NULL,'If enabled patrons and transactions will be copied in a separate table for statistics purpose','YesNo') + |); + $dbh->do(q| + INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) + ('PseudonymizationPatronFields','','title,city,state,zipcode,country,branchcode,categorycode,dateenrolled,sex,sort1,sort2','Patron fields to copy to the anonymized_borrowers table','multiple'), + |); + $dbh->do(q| + INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) + ('PseudonymizationTransactionFields','','datetime,branchcode,transaction_type,itemnumber,itemtype,holdingbranch,location,itemcallnumber,ccode','Transaction fields to copy to the anonymized_transactions table','multiple'), + |); + # Always end with this (adjust the bug info) SetVersion( $DBversion ); print "Upgrade to $DBversion done (Bug XXXXX - description)\n"; diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 9fc3d5821e..984d35ed8d 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -503,6 +503,9 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('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'), +('Pseudonymization','1',NULL,'If enabled patrons and transactions will be copied in a separate table for statistics purpose','YesNo'), +('PseudonymizationPatronFields','','title,city,state,zipcode,country,branchcode,categorycode,dateenrolled,sex,sort1,sort2','Patron fields to copy to the anonymized_borrowers table','multiple'), +('PseudonymizationTransactionFields','','datetime,branchcode,transaction_type,itemnumber,itemtype,holdingbranch,location,itemcallnumber,ccode','Transaction fields to copy to the anonymized_transactions table','multiple'), ('PurgeSuggestionsOlderThan', '', NULL, 'If this script is called without the days parameter', 'Integer'), ('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'), ('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index 14f1ef910c..0f8c8f8b28 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -257,3 +257,36 @@ Patrons: - days and remove anonymized patron accounts after - pref: PatronRemovalDelay - "days.
IMPORTANT: No action is performed when these delays are empty (no text). But a zero value ('0') is interpreted as no delay (do it now)! The actions are performed by the cleanup database cron job." + - + - pref: Pseudonymization + choices: + yes: Enable + no: Disable + - "pseudonymization to comply with GDPR for personal information." + - "Patrons and transactions will be copied to a separate table for statistics purpose." + - "
Use the following fields for patrons:" + - pref: PseudonymizationPatronFields + multiple: + title: "Patron's title" + city: "City" + state: "State" + zipcode: "Zipcode" + country: "Country" + branchcode: "Patron's library" + categorycode: "Patron's category" + dateenrolled: "Date the patron was added to Koha" + sex: "Patron's gender" + sort1: "Sort1" + sort2: "Sort2" + - "
And the following fields for the transactions:" + - pref: PseudonymizationTransactionFields + multiple: + datetime: "Date and time of the transaction" + branchcode: "Library where the transaction occurred" + transaction_type: "Transaction type" + itemnumber: "Itemnumber" + itemtype: "Item type" + holdingbranch: "Holding branch" + location: "Location" + itemcallnumber: "Item's callnumber" + ccode: "Collection code" -- 2.11.0