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 893-900 Link Here
893
                    [% END %]
893
                    [% END %]
894
                [% END %]
894
                [% END %]
895
895
896
                [% UNLESS action == 'edit' %]
896
                [% IF Koha.Preference('GDPR_Policy') && action != 'edit' %]
897
                    <fieldset class="rows" id="memberentry_gdpr_consent">
898
                        <legend>GDPR consent</legend>
899
                        <ol>
900
                        <li>
901
                            <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>
902
                        </li>
903
                        </ol>
904
                    </fieldset>
905
               [% END %]
906
907
               [% UNLESS action == 'edit' %]
897
                    <fieldset class="rows" id="memberentry_captcha">
908
                    <fieldset class="rows" id="memberentry_captcha">
909
                        <legend>Verification</legend>
898
                        <ol>
910
                        <ol>
899
911
900
                            <li>
912
                            <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-71 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
    my $patron = Koha::Patron->new( $patron_attrs )->store;
68
    my $patron = Koha::Patron->new( $patron_attrs )->store;
68
69
70
    Koha::Patron::Consent->new({ borrowernumber => $patron->borrowernumber, type => 'GDPR_PROCESSING', given_on => $consent_dt })->store if $consent_dt;
71
69
    if ($patron) {
72
    if ($patron) {
70
        $m->delete();
73
        $m->delete();
71
        C4::Form::MessagingPreferences::handle_form_action($cgi, { borrowernumber => $patron->borrowernumber }, $template, 1, C4::Context->preference('PatronSelfRegistrationDefaultCategory') ) if C4::Context->preference('EnhancedMessagingPreferences');
74
        C4::Form::MessagingPreferences::handle_form_action($cgi, { borrowernumber => $patron->borrowernumber }, $template, 1, C4::Context->preference('PatronSelfRegistrationDefaultCategory') ) if C4::Context->preference('EnhancedMessagingPreferences');
72
- 

Return to bug 20819