From 27de9146daa31c644cb98e7b698ce71357cdb792 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 2 Feb 2026 11:58:32 +0000 Subject: [PATCH] Bug 41749: Display patron consents on staff patron detail page Adds a read-only "Consents" section to the staff patron detail page showing the patron's consent status for GDPR (when PrivacyPolicyConsent is enabled) and any plugin-defined consent types. Each consent displays with visual status indicators: - Green checkmark with timestamp when consent was given - Red X with timestamp when consent was refused - Gray "Not specified" when no consent recorded Test plan: 1. Enable PrivacyPolicyConsent system preference 2. As patron in OPAC: give/refuse consent at "Your consents" 3. As staff: view patron detail page 4. Verify "Consents" section shows correct status and timestamp 5. Test with no consent recorded (should show "Not specified") 6. If available, test with plugin-defined consent types Signed-off-by: David Nind --- .../prog/en/modules/members/moremember.tt | 35 +++++++++++++++++++ members/moremember.pl | 20 +++++++++++ 2 files changed, 55 insertions(+) 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; -- 2.39.5