From dba5a73e9bfbd9687a47c4c4aa35e23f70bf9c54 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Sat, 21 Dec 2024 16:11:30 +0000 Subject: [PATCH] Bug 38769: Display plugin consents on self registration --- .../bootstrap/en/modules/opac-memberentry.tt | 27 +++++++++++++++++++ opac/opac-memberentry.pl | 7 ++++- 2 files changed, 33 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 6db0556cfdf..eeca4f9b690 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt @@ -1053,6 +1053,33 @@ [% END %] + [% USE Dumper %] + [% IF consent_types.size %] + [% FOREACH consent_type IN consent_types.keys %] + [% IF consent_type != 'GDPR_PROCESSING' %] + [% SET consent_title = ( consent_types.$consent_type.title.$lang || consent_type.title.en ) %] + [% SET consent_desc = ( consent_types.$consent_type.description.$lang || consent_type.description.en ) %] +
+
+ +
+
+ [% END %] + [% END %] + [% END %] + [% IF Koha.Preference('PrivacyPolicyConsent') && op != 'edit' %]
diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl index 399d31afa4b..8d62db8e477 100755 --- a/opac/opac-memberentry.pl +++ b/opac/opac-memberentry.pl @@ -33,6 +33,7 @@ use C4::Members::Messaging qw( SetMessagingPreferencesFromDefaults ); use Koha::AuthUtils; use Koha::Patrons; use Koha::Patron::Consent; +use Koha::Patron::Consents; use Koha::Patron::Modification; use Koha::Patron::Modifications; use C4::Scrubber; @@ -392,7 +393,11 @@ elsif ( $op eq 'edit' ) { #Display logged in borrower's data $template->param( patron_attribute_classes => GeneratePatronAttributesForm( $borrowernumber ) ); } else { # Render self-registration page - $template->param( patron_attribute_classes => GeneratePatronAttributesForm() ); + my $consent_types = Koha::Patron::Consents->available_types; + $template->param( + consent_types => $consent_types, + patron_attribute_classes => GeneratePatronAttributesForm() + ); } my $captcha = random_string("CCCCC"); -- 2.47.1