Bugzilla – Attachment 192310 Details for
Bug 41749
Add patron consent status display to staff patron detail page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41749: Display patron consents on staff patron detail page
edeb040.patch (text/plain), 4.94 KB, created by
Martin Renvoize (ashimema)
on 2026-02-02 12:01:16 UTC
(
hide
)
Description:
Bug 41749: Display patron consents on staff patron detail page
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2026-02-02 12:01:16 UTC
Size:
4.94 KB
patch
obsolete
>From edeb04063b739196e60a5c2fa51dbf9abc0f1011 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >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 >--- > .../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 6ac0d5fd485..cc59617307f 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> > [%# /div#patron-library-details %] > >+ [% IF consents.size %] >+ <div id="patron-consents" class="patroninfo-section"> >+ <div class="patroninfo-heading"> >+ <h3>Consents</h3> >+ </div> >+ <div class="rows"> >+ <ol> >+ [% FOREACH consent IN consents %] >+ <li> >+ <span class="label"> >+ [% 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 %] >+ </span> >+ [% IF consent.given_on %] >+ <span class="text-success"> <i class="fa fa-check"></i> Given on [% consent.given_on | $KohaDates with_hours => 1 %] </span> >+ [% ELSIF consent.refused_on %] >+ <span class="text-danger"> <i class="fa fa-times"></i> Refused on [% consent.refused_on | $KohaDates with_hours => 1 %] </span> >+ [% ELSE %] >+ <span class="text-muted">Not specified</span> >+ [% END %] >+ </li> >+ [% END %] >+ </ol> >+ </div> >+ </div> >+ [%# /div#patron-consents %] >+ [% END %] >+ > <div id="patron-alternate-address" class="patroninfo-section"> > [% IF ( patron.B_phone || patron.B_email || patron.contactnote || patron.B_address || patron.B_address2 || patron.B_city || patron.B_zipcode || patron.B_country ) %] > <div class="patroninfo-heading"> >diff --git a/members/moremember.pl b/members/moremember.pl >index 9cf8574e101..b64a58e3000 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.52.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 41749
:
192310
|
192342