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 |
|