diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 6ac0d5fd48..cc59617307 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -592,6 +592,41 @@ [%# /div#patron-library-details %] + [% IF consents.size %] +
+
+

Consents

+
+
+
    + [% FOREACH consent IN consents %] +
  1. + + [% IF consent.type == 'GDPR_PROCESSING' %] + Privacy policy consent: + [% ELSIF consent.title.title.${lang} %] + [% consent.title.title.${lang} | html %]: + [% ELSIF consent.title.title.en %] + [% consent.title.title.en | html %]: + [% ELSE %] + [% consent.type | html %]: + [% END %] + + [% IF consent.given_on %] + Given on [% consent.given_on | $KohaDates with_hours => 1 %] + [% ELSIF consent.refused_on %] + Refused on [% consent.refused_on | $KohaDates with_hours => 1 %] + [% ELSE %] + Not specified + [% END %] +
  2. + [% END %] +
+
+
+ [%# /div#patron-consents %] + [% END %] +
[% IF ( patron.B_phone || patron.B_email || patron.contactnote || patron.B_address || patron.B_address2 || patron.B_city || patron.B_zipcode || patron.B_country ) %]
diff --git a/members/moremember.pl b/members/moremember.pl index 9cf8574e10..b64a58e300 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -41,6 +41,7 @@ use Koha::Patron::Messages; use Koha::CsvProfiles; use Koha::Holds; use Koha::Patrons; +use Koha::Patron::Consents; use Koha::Patron::Files; use Koha::Token; use Koha::Checkouts; @@ -316,4 +317,23 @@ if ( C4::Context->preference('UseRecalls') ) { ); } +# Fetch available consent types and patron's consents +my $consent_types = Koha::Patron::Consents->available_types; +if ( keys %$consent_types ) { + my @consents_data; + for my $type ( sort keys %$consent_types ) { + my $consent = $patron->consent($type); + push @consents_data, { + type => $type, + title => $consent_types->{$type}, + given_on => $consent->given_on, + refused_on => $consent->refused_on, + }; + } + $template->param( + consents => \@consents_data, + consent_types => $consent_types, + ); +} + output_html_with_http_headers $input, $cookie, $template->output;