Bugzilla – Attachment 75820 Details for
Bug 20819
GDPR: Add a consent field for processing personal data in account menu and self-registration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20819: Add consent to self-registration process
Bug-20819-Add-consent-to-self-registration-process.patch (text/plain), 5.18 KB, created by
Marcel de Rooy
on 2018-06-05 14:08:18 UTC
(
hide
)
Description:
Bug 20819: Add consent to self-registration process
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-06-05 14:08:18 UTC
Size:
5.18 KB
patch
obsolete
>From aae3e0b999d46fba895dfbd69cba9fdde4d30f4f Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 31 May 2018 12:29:59 +0200 >Subject: [PATCH] Bug 20819: Add consent to self-registration process >Content-Type: text/plain; charset=utf-8 > >We add a section for the GDPR consent in opac-memberentry (only for the >self-registration). Not when editing personal details. > >Test plan: >[1] Enable selfregistration (with confirm) and GDPR policy. >[2] Register a new account in OPAC. Verify that the GDPR checkbox is > required. >[3] After you submit, you should see a date in borrower_modifications > field gdpr_proc_consent. >[4] When you confirm, verify that the consent is visible on your consents. >[5] Enable selfregistration without confirmation mail. Register again. >[6] Check your consents tab again. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../opac-tmpl/bootstrap/en/modules/opac-memberentry.tt | 14 +++++++++++++- > opac/opac-memberentry.pl | 8 ++++++++ > opac/opac-registration-verify.pl | 3 +++ > 3 files changed, 24 insertions(+), 1 deletion(-) > >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 eacd423..c36cdbd 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >@@ -893,8 +893,20 @@ > [% END %] > [% END %] > >- [% UNLESS action == 'edit' %] >+ [% IF Koha.Preference('GDPR_Policy') && action != 'edit' %] >+ <fieldset class="rows" id="memberentry_gdpr_consent"> >+ <legend>GDPR consent</legend> >+ <ol> >+ <li> >+ <label></label><span><input type="checkbox" name="borrower_gdpr_proc_consent" value="agreed"> I agree with your processing of my personal data as outlined in the <a target="_blank" href="[% PrivacyPolicyURL %]">privacy policy</a>. <span class="required">Required</span></span> >+ </li> >+ </ol> >+ </fieldset> >+ [% END %] >+ >+ [% UNLESS action == 'edit' %] > <fieldset class="rows" id="memberentry_captcha"> >+ <legend>Verification</legend> > <ol> > > <li> >diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl >index 9d3bed8..2f5574a 100755 >--- a/opac/opac-memberentry.pl >+++ b/opac/opac-memberentry.pl >@@ -30,6 +30,7 @@ use C4::Members::Attributes qw( GetBorrowerAttributes ); > use C4::Form::MessagingPreferences; > use Koha::AuthUtils; > use Koha::Patrons; >+use Koha::Patron::Consent; > use Koha::Patron::Modification; > use Koha::Patron::Modifications; > use C4::Scrubber; >@@ -207,8 +208,11 @@ if ( $action eq 'create' ) { > $template->param( OpacPasswordChange => > C4::Context->preference('OpacPasswordChange') ); > >+ my $consent_dt = delete $borrower{gdpr_proc_consent}; > my ( $borrowernumber, $password ) = AddMember_Opac(%borrower); >+ Koha::Patron::Consent->new({ borrowernumber => $borrowernumber, type => 'GDPR_PROCESSING', given_on => $consent_dt })->store if $consent_dt; > C4::Members::Attributes::SetBorrowerAttributes( $borrowernumber, $attributes ); >+ > C4::Form::MessagingPreferences::handle_form_action($cgi, { borrowernumber => $borrowernumber }, $template, 1, C4::Context->preference('PatronSelfRegistrationDefaultCategory') ) if $borrowernumber && C4::Context->preference('EnhancedMessagingPreferences'); > > $template->param( password_cleartext => $password ); >@@ -353,6 +357,7 @@ sub GetMandatoryFields { > C4::Context->preference("PatronSelfRegistrationBorrowerMandatoryField"); > > my @fields = split( /\|/, $BorrowerMandatoryField ); >+ push @fields, 'gdpr_proc_consent' if C4::Context->preference('GDPR_Policy'); > > foreach (@fields) { > $mandatory_fields{$_} = 1; >@@ -459,6 +464,9 @@ sub ParseCgiForBorrower { > $borrower{'dateofbirth'} = undef; > } > >+ # Replace checkbox 'agreed' by datetime in gdpr_proc_consent >+ $borrower{gdpr_proc_consent} = dt_from_string if $borrower{gdpr_proc_consent} && $borrower{gdpr_proc_consent} eq 'agreed'; >+ > return %borrower; > } > >diff --git a/opac/opac-registration-verify.pl b/opac/opac-registration-verify.pl >index 2d9b9f7..5675eb0 100755 >--- a/opac/opac-registration-verify.pl >+++ b/opac/opac-registration-verify.pl >@@ -24,6 +24,7 @@ use C4::Output; > use C4::Members; > use C4::Form::MessagingPreferences; > use Koha::Patrons; >+use Koha::Patron::Consent; > use Koha::Patron::Modifications; > > my $cgi = new CGI; >@@ -61,8 +62,10 @@ if ( > > my $borrower = $m->unblessed(); > >+ my $consent_dt = delete $borrower->{gdpr_proc_consent}; > my $password; > ( $borrowernumber, $password ) = AddMember_Opac(%$borrower); >+ Koha::Patron::Consent->new({ borrowernumber => $borrowernumber, type => 'GDPR_PROCESSING', given_on => $consent_dt })->store if $consent_dt; > > if ($borrowernumber) { > $m->delete(); >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20819
:
75765
|
75766
|
75767
|
75818
|
75819
|
75820
|
76781
|
76782
|
76783
|
76784
|
76785
|
77264
|
77265
|
77266
|
77267
|
77268
|
77269
|
78369
|
78370
|
78371
|
78372
|
78373
|
78374
|
78779
|
78781
|
78783
|
78784
|
78786
|
78788
|
79059
|
79062
|
79063
|
79064
|
79065
|
79066
|
79067
|
79129
|
79130
|
79131
|
79132
|
79133
|
79134
|
79135
|
79175
|
79190