From 33fe0a3d30888870c7090446c829f4ef285a5b58 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Fri, 17 Mar 2023 22:06:40 +0000 Subject: [PATCH] Bug 33197: Rename GDPR_Policy system preference GDPR is a European Union (and, at time of writing, UK) law. The GDPR_Policy system preference is about a patron giving consent to their personal data being processed in line with the library's privacy policy. The name of the preference is vague: there could be many policies implemented by libraries to comply with GDPR. It also makes the preference look irrelevant for libraries outside the areas where GDPR applies, while it may be useful for libraries anywhere. This renames GDPR_Policy to PrivacyPolicyConsent and adjusts the system preference descriptions. To test: * Apply the patch * Run database update * Search for GDPR_Policy in the system preference - you should not find anything. * Search for DataPrivacyConsent in the system preferences - you should find it and be able to activate it * Verify the feature works as expected - If the preference is set to "enforced", you will be asked to give consent to the data privacy agreement in the OPAC when you log in * Verify the page is now phrased neutrally using 'privacy policy' Bonus: Consent date is now formatted according to DateFormat system preference. --- C4/Auth.pm | 2 +- .../atomicupdate/bug_33179_rename_gdpr_policy.pl | 12 ++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 2 +- .../prog/en/modules/admin/preferences/patrons.pref | 10 +++++----- .../opac-tmpl/bootstrap/en/includes/usermenu.inc | 2 +- .../bootstrap/en/modules/opac-memberentry.tt | 4 ++-- .../bootstrap/en/modules/opac-patron-consent.tt | 11 ++++++----- opac/opac-memberentry.pl | 2 +- opac/opac-patron-consent.pl | 4 ++-- t/db_dependent/Auth.t | 2 +- 10 files changed, 32 insertions(+), 19 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_33179_rename_gdpr_policy.pl diff --git a/C4/Auth.pm b/C4/Auth.pm index adc1b5dd0d..ba074bab46 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -193,7 +193,7 @@ sub get_template_and_user { # Exceptions for consent page itself and SCI/SCO system if( $in->{type} eq 'opac' && $user && $in->{'template_name'} !~ /^(opac-page|opac-patron-consent|sc[io]\/)/ && - C4::Context->preference('GDPR_Policy') eq 'Enforced' ) + C4::Context->preference('PrivacyPolicyConsent') eq 'Enforced' ) { my $consent = Koha::Patron::Consents->search({ borrowernumber => getborrowernumber($user), diff --git a/installer/data/mysql/atomicupdate/bug_33179_rename_gdpr_policy.pl b/installer/data/mysql/atomicupdate/bug_33179_rename_gdpr_policy.pl new file mode 100755 index 0000000000..811a161bf4 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_33179_rename_gdpr_policy.pl @@ -0,0 +1,12 @@ +use Modern::Perl; + +return { + bug_number => "33197", + description => "Rename GDPR_Policy system preference", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + $dbh->do(q{UPDATE systempreferences set variable = "PrivacyPolicyConsent" WHERE variable = "GDPR_Policy"}); + say $out "Rename system preference GDPR_Policy to PrivacyPolicyConsent"; + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 98eced6bc0..54f7152892 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -253,7 +253,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('FinesLog','1',NULL,'If ON, log fines','YesNo'), ('finesMode','off','off|production','Choose the fines mode, \'off\' (no charges), \'production\' (accrue overdue fines). Requires accruefines cronjob.','Choice'), ('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'), -('GDPR_Policy','','Enforced|Permissive|Disabled','General Data Protection Regulation - policy', 'Choice'), +('PrivacyPolicyConsent','','Enforced|Permissive|Disabled','Data privacy policy consent in the OPAC', 'Choice'), ('GenerateAuthorityField667', 'Machine generated authority record', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 667$a field of MARC21 records', 'free'), ('GenerateAuthorityField670', 'Work cat.', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 670$a field of MARC21 records', 'free'), ('GoogleJackets','0',NULL,'if ON, displays jacket covers from Google Books API','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 b0638195a8..7c250de9b1 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 @@ -355,16 +355,16 @@ Patrons: - Use the following URL - pref: PrivacyPolicyURL class: url - - 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.) - - '
NOTE: The URL will only be displayed if GDPR_Policy is set.' + - to refer to your local privacy policy in messages about privacy and data protection. (If you enforce a data privacy policy, make sure that this page is not blocked.) + - '
NOTE: The URL will only be displayed if PrivacyPolicyConsent is set.' - - - "Set GDPR policy to:" - - pref: GDPR_Policy + - "Set data privacy policy consent to:" + - pref: PrivacyPolicyConsent choices: '': 'disabled' Enforced: 'enforced' Permissive: 'permissive' - - ". 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." + - ". When you enforce a data privacy policy, patrons need to give consent before using the OPAC. If you set to permissive, Koha will warn but not enforce." - '
NOTE: If you enable this you will also have to set the URL of your public privacy policy with the PrivacyPolicyURL setting.' - - Lock/expire patrons that submitted an unsubscribe request (refused consent) after diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc index c8bd1669ab..5f8b48cda8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc @@ -24,7 +24,7 @@ [% END %] Personal details - [% IF Koha.Preference('GDPR_Policy') # remove when extending %] + [% IF Koha.Preference('PrivacyPolicyConsent') # remove when extending %] [% IF consentview %]
  • [% ELSE %]
  • [% END %] Consents
  • diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt index b051a14c02..f9f3c4b81a 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -970,11 +970,11 @@ [% END %] - [% IF Koha.Preference('GDPR_Policy') && action != 'edit' %] + [% IF Koha.Preference('PrivacyPolicyConsent') && action != 'edit' %]