Bugzilla – Attachment 140090 Details for
Bug 31503
Allow several consent types on the consents tab of OPAC account page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31503: (Experimental) Configurable consent text
Bug-31503-Experimental-Configurable-consent-text.patch (text/plain), 7.00 KB, created by
Marcel de Rooy
on 2022-09-02 08:59:29 UTC
(
hide
)
Description:
Bug 31503: (Experimental) Configurable consent text
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-09-02 08:59:29 UTC
Size:
7.00 KB
patch
obsolete
>From fd85c30ff158e6b2b3e7f0c47e4ce50f5394f08c Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 2 Sep 2022 07:41:27 +0000 >Subject: [PATCH] Bug 31503: (Experimental) Configurable consent text >Content-Type: text/plain; charset=utf-8 > >This patch allows you to add title and content from the >Additional Contents module but it is still slightly >experimental since we depend on setting the code column >to a value that is not yet supported. Will open a report >for that. > >Note however that the template contains a fallback in >case you might not be able to add contents yet. > >Test plan: >[1] Add a NEWSLETTER value under AV category PATRON_CONSENT. >[2] Add a PatronConsent record under html customizations. Only >add title and content for Default. >[3] Change code via SQL (awaiting further AC development): > update additional_contents > set code='PatronConsent_NEWSLETTER' > where location='PatronConsent' and idnew=[YOUR_ID] >Note: YOUR_ID refers to the record you added. After this >change, you will be able to add translations under Additional >contents. The code will be copied. >[4] Finally, check patron consent page for your text. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../en/modules/tools/additional-contents.tt | 2 +- > .../en/modules/opac-patron-consent.tt | 18 ++++++++++++++---- > opac/opac-patron-consent.pl | 12 +++++++++++- > 3 files changed, 26 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >index 070b3063d5..051debbbf6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt >@@ -484,7 +484,7 @@ > [% END %] > [% END %] > [% ELSE %] >- [% FOREACH l IN [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote' ] %] >+ [% FOREACH l IN [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'PatronConsent' ] %] > [% IF l == location %] > <option value="[% l | html %]" selected="selected">[% l | html %]</option> > [% ELSE %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-patron-consent.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-patron-consent.tt >index 512a0a8078..f64706fde1 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-patron-consent.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-patron-consent.tt >@@ -1,5 +1,6 @@ > [% USE Koha %] > [% USE AdditionalContents %] >+[% USE raw %] > [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] > [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] > [% SET consentview = 1 %] >@@ -41,15 +42,24 @@ > <input type="hidden" name="op" value="save"/> > <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]"/> > [% FOREACH consent IN consents %] >- <legend><h2>Consent for [% consent.type | html %]</h2></legend> >+ [% SET ac_key = 'PatronConsent_' _ consent.type %] >+ <legend><h2> >+ [% IF additional_contents.$ac_key && additional_contents.$ac_key.title %] >+ [% additional_contents.$ac_key.title | html %] >+ [% ELSE %] >+ Consent for [% consent.type | html %] >+ [% END %] >+ </h2></legend> > <fieldset> > <ul><li> >- [% IF consent.type == 'GDPR_PROCESSING' %] >+ [% IF additional_contents.$ac_key && additional_contents.$ac_key.content %] >+ [% additional_contents.$ac_key.content | $raw %] >+ [% ELSIF consent.type == 'GDPR_PROCESSING' # Backward compatbility ;) %] > <p>Please read the <a target="_blank" href="[% Koha.Preference('PrivacyPolicyURL') | url %]">privacy policy</a>.</p> > <p>In order to keep you logged in, we need your consent to process personal data as specified in the EU General Data Protection Regulation of May 25, 2018. If you would not agree, we will need to <strong>remove</strong> your account within a reasonable time.</p> > <p>Do you agree with our processing of your personal data as outlined in the policy?</p> >- [% ELSE %] >- <p>Description for [% consent.type | html #TODO %]. Do you agree?</p> >+ [% ELSE # Fallback only %] >+ <p>Description for [% consent.type | html %]. Do you agree?</p> > [% END %] > <p> > <input type="radio" name="check_[% consent.type | html %]" value="1"> Yes<br> >diff --git a/opac/opac-patron-consent.pl b/opac/opac-patron-consent.pl >index fdf0aa90b0..0072d596f7 100755 >--- a/opac/opac-patron-consent.pl >+++ b/opac/opac-patron-consent.pl >@@ -22,6 +22,7 @@ use CGI qw/-utf8/; > > use C4::Auth qw( get_template_and_user ); > use C4::Output qw( output_html_with_http_headers ); >+use Koha::AdditionalContents; > use Koha::AuthorisedValueCategories; > use Koha::DateUtils qw( dt_from_string ); > use Koha::Patrons; >@@ -72,6 +73,15 @@ if( C4::Context->preference('GDPR_Policy') eq 'Enforced' && $needs_redirect ) { > exit; > } > >-$template->param( patron => $patron, consents => $consents ); >+my $rs = Koha::AdditionalContents->search({ >+ # This could be moved to the template some day when both AC and TT plugin allow for it >+ category => 'html_customizations', >+ location => 'PatronConsent', >+ branchcode => undef, # TODO Branch limits >+}); >+my $additional_contents = { map { ( $_->code => { title => $_->title, content => $_->content } ) } $rs->as_list }; >+ #FIXME This assumes that the code contains PatronConsent_{CONTENT_TYPE}. This still needs AC adjustments. >+ >+$template->param( patron => $patron, consents => $consents, additional_contents => $additional_contents ); > > output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; >-- >2.20.1
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 31503
:
140047
|
140048
|
140049
|
140050
|
140080
|
140081
|
140082
|
140083
|
140084
|
140085
|
140087
|
140088
|
140089
|
140090
|
140666
|
140667
|
140668
|
140669
|
140670
|
140671
|
140672
|
141216
|
141217
|
141218
|
141219
|
141220
|
141221
|
141222
|
141263
|
141264
|
141265
|
141266
|
141267
|
141268
|
141269
|
141302
|
141570
|
155000
|
155001
|
155002
|
155003
|
155177
|
155178
|
155179
|
155180
|
155189
|
155190
|
155191
|
155656
|
155657
|
155658
|
155659
|
155660
|
155661
|
155691
|
155694
|
155783
|
155784
|
155785
|
155786
|
155787
|
155788
|
155789
|
155790
|
155791
|
157117
|
157118
|
157119
|
157120
|
157121
|
157122
|
157123
|
157124
|
157125
|
157126
|
157773
|
157774
|
157775
|
157776
|
157777
|
157778
|
157779
|
157780
|
157781
|
157782
|
157783