View | Details | Raw Unified | Return to bug 20819
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt (-1 / +13 lines)
Lines 894-901 Link Here
894
                    [% END %]
894
                    [% END %]
895
                [% END %]
895
                [% END %]
896
896
897
                [% UNLESS action == 'edit' %]
897
                [% IF Koha.Preference('GDPR_Policy') && action != 'edit' %]
898
                    <fieldset class="rows" id="memberentry_gdpr_consent">
899
                        <legend>GDPR consent</legend>
900
                        <ol>
901
                        <li>
902
                            <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>
903
                        </li>
904
                        </ol>
905
                    </fieldset>
906
               [% END %]
907
908
               [% UNLESS action == 'edit' %]
898
                    <fieldset class="rows" id="memberentry_captcha">
909
                    <fieldset class="rows" id="memberentry_captcha">
910
                        <legend>Verification</legend>
899
                        <ol>
911
                        <ol>
900
912
901
                            <li>
913
                            <li>
(-)a/opac/opac-memberentry.pl (+7 lines)
Lines 30-35 use C4::Members::Attributes qw( GetBorrowerAttributes ); Link Here
30
use C4::Form::MessagingPreferences;
30
use C4::Form::MessagingPreferences;
31
use Koha::AuthUtils;
31
use Koha::AuthUtils;
32
use Koha::Patrons;
32
use Koha::Patrons;
33
use Koha::Patron::Consent;
33
use Koha::Patron::Modification;
34
use Koha::Patron::Modification;
34
use Koha::Patron::Modifications;
35
use Koha::Patron::Modifications;
35
use C4::Scrubber;
36
use C4::Scrubber;
Lines 209-215 if ( $action eq 'create' ) { Link Here
209
210
210
            $borrower{categorycode}     ||= C4::Context->preference('PatronSelfRegistrationDefaultCategory');
211
            $borrower{categorycode}     ||= C4::Context->preference('PatronSelfRegistrationDefaultCategory');
211
            $borrower{password}         ||= Koha::AuthUtils::generate_password;
212
            $borrower{password}         ||= Koha::AuthUtils::generate_password;
213
            my $consent_dt = delete $borrower{gdpr_proc_consent};
212
            my $patron = Koha::Patron->new( \%borrower )->store;
214
            my $patron = Koha::Patron->new( \%borrower )->store;
215
            Koha::Patron::Consent->new({ borrowernumber => $patron->borrowernumber, type => 'GDPR_PROCESSING', given_on => $consent_dt })->store if $consent_dt;
213
            if ( $patron ) {
216
            if ( $patron ) {
214
                C4::Members::Attributes::SetBorrowerAttributes( $patron->borrowernumber, $attributes );
217
                C4::Members::Attributes::SetBorrowerAttributes( $patron->borrowernumber, $attributes );
215
                if ( C4::Context->preference('EnhancedMessagingPreferences') ) {
218
                if ( C4::Context->preference('EnhancedMessagingPreferences') ) {
Lines 366-371 sub GetMandatoryFields { Link Here
366
      C4::Context->preference("PatronSelfRegistrationBorrowerMandatoryField");
369
      C4::Context->preference("PatronSelfRegistrationBorrowerMandatoryField");
367
370
368
    my @fields = split( /\|/, $BorrowerMandatoryField );
371
    my @fields = split( /\|/, $BorrowerMandatoryField );
372
    push @fields, 'gdpr_proc_consent' if C4::Context->preference('GDPR_Policy');
369
373
370
    foreach (@fields) {
374
    foreach (@fields) {
371
        $mandatory_fields{$_} = 1;
375
        $mandatory_fields{$_} = 1;
Lines 472-477 sub ParseCgiForBorrower { Link Here
472
        $borrower{'dateofbirth'} = undef;
476
        $borrower{'dateofbirth'} = undef;
473
    }
477
    }
474
478
479
    # Replace checkbox 'agreed' by datetime in gdpr_proc_consent
480
    $borrower{gdpr_proc_consent} = dt_from_string if  $borrower{gdpr_proc_consent} && $borrower{gdpr_proc_consent} eq 'agreed';
481
475
    return %borrower;
482
    return %borrower;
476
}
483
}
477
484
(-)a/opac/opac-registration-verify.pl (-2 / +4 lines)
Lines 25-30 use C4::Members; Link Here
25
use C4::Form::MessagingPreferences;
25
use C4::Form::MessagingPreferences;
26
use Koha::AuthUtils;
26
use Koha::AuthUtils;
27
use Koha::Patrons;
27
use Koha::Patrons;
28
use Koha::Patron::Consent;
28
use Koha::Patron::Modifications;
29
use Koha::Patron::Modifications;
29
30
30
my $cgi = new CGI;
31
my $cgi = new CGI;
Lines 62-73 if ( Link Here
62
63
63
    my $patron_attrs = $m->unblessed;
64
    my $patron_attrs = $m->unblessed;
64
    $patron_attrs->{password} ||= Koha::AuthUtils::generate_password;
65
    $patron_attrs->{password} ||= Koha::AuthUtils::generate_password;
65
66
    my $consent_dt = delete $patron_attrs->{gdpr_proc_consent};
66
    $patron_attrs->{categorycode} ||= C4::Context->preference('PatronSelfRegistrationDefaultCategory');
67
    $patron_attrs->{categorycode} ||= C4::Context->preference('PatronSelfRegistrationDefaultCategory');
67
    delete $patron_attrs->{timestamp};
68
    delete $patron_attrs->{timestamp};
68
    delete $patron_attrs->{verification_token};
69
    delete $patron_attrs->{verification_token};
69
    my $patron = Koha::Patron->new( $patron_attrs )->store;
70
    my $patron = Koha::Patron->new( $patron_attrs )->store;
70
71
72
    Koha::Patron::Consent->new({ borrowernumber => $patron->borrowernumber, type => 'GDPR_PROCESSING', given_on => $consent_dt })->store if $consent_dt;
73
71
    if ($patron) {
74
    if ($patron) {
72
        $m->delete();
75
        $m->delete();
73
        C4::Form::MessagingPreferences::handle_form_action($cgi, { borrowernumber => $patron->borrowernumber }, $template, 1, C4::Context->preference('PatronSelfRegistrationDefaultCategory') ) if C4::Context->preference('EnhancedMessagingPreferences');
76
        C4::Form::MessagingPreferences::handle_form_action($cgi, { borrowernumber => $patron->borrowernumber }, $template, 1, C4::Context->preference('PatronSelfRegistrationDefaultCategory') ) if C4::Context->preference('EnhancedMessagingPreferences');
74
- 

Return to bug 20819