Bugzilla – Attachment 155784 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: Change usermenu condition, add preference
Bug-31503-Change-usermenu-condition-add-preference.patch (text/plain), 5.33 KB, created by
Martin Renvoize (ashimema)
on 2023-09-18 09:57:05 UTC
(
hide
)
Description:
Bug 31503: Change usermenu condition, add preference
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-09-18 09:57:05 UTC
Size:
5.33 KB
patch
obsolete
>From 0b33e39efe527c4d4368db75bdbf73ea07ba522f Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 30 Aug 2023 16:32:52 +0200 >Subject: [PATCH] Bug 31503: Change usermenu condition, add preference > >Adds preference OPACCustomConsentTypes. > >Test plan: >Run dbrev. >Toggle value of OPACCustomConsentTypes / PrivacyPolicyConsent. >Check user page for Consents tab. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > installer/data/mysql/atomicupdate/bug31503.pl | 9 +++++++-- > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../prog/en/modules/admin/preferences/opac.pref | 9 +++++++++ > koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc | 2 +- > 4 files changed, 18 insertions(+), 3 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug31503.pl b/installer/data/mysql/atomicupdate/bug31503.pl >index 25871e187f2..5be62e73b82 100755 >--- a/installer/data/mysql/atomicupdate/bug31503.pl >+++ b/installer/data/mysql/atomicupdate/bug31503.pl >@@ -2,7 +2,7 @@ use Modern::Perl; > > return { > bug_number => 31503, >- description => "Change patron_consent.type", >+ description => "Change patron_consent.type, add pref OPACCustomConsentTypes", > up => sub { > my ($args) = @_; > my ( $dbh, $out ) = @$args{qw(dbh out)}; >@@ -10,7 +10,12 @@ return { > $dbh->do( > q{ALTER TABLE `patron_consent` MODIFY `type` tinytext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'consent type, could be custom type'} > ); >- > say $out "Changed column 'patron_consent.type'"; >+ >+ $dbh->do( >+ q{INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >+('OPACCustomConsentTypes', '0', NULL, 'If enabled, custom consent types can be registered on account page', 'YesNo')} >+ ); >+ say $out "Addedd preference 'OPACCustomConsentTypes'"; > }, > }; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index fad32d896e5..50f49994552 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -445,6 +445,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OpacCloud','0',NULL,'If ON, enables subject cloud on OPAC','YesNo'), > ('OpacAdditionalStylesheet','','','Define an auxiliary stylesheet for OPAC use, to override specified settings from the primary opac.css stylesheet. Enter the filename (if the file is in the server\'s css directory) or a complete URL beginning with http (if the file lives on a remote server).','free'), > ('OpacCoce','0', NULL, 'If on, enables cover retrieval from the configured Coce server in the OPAC', 'YesNo'), >+('OPACCustomConsentTypes', '0', NULL, 'If enabled, custom consent types can be registered on account page', 'YesNo'), > ('OPACCustomCoverImages','0',NULL,'If enabled, the custom cover images will be displayed at the OPAC. CustomCoverImagesURL must be defined.','YesNo'), > ('OPACdefaultSortField','relevance','relevance|popularity|call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'), > ('OPACdefaultSortOrder','dsc','asc|dsc|za|az','Specify the default sort order','Choice'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 199a0615e18..b7d7fe5653f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -551,6 +551,15 @@ OPAC: > summary: "in user summary box on OPAC homepage (the system preference <em>OPACUserSummary</em> must be enabled)" > user: "on patron's 'your summary' page" > - ". Note that displayed savings may be inaccurate if checkout history is anonymized." >+ - >+ - pref: OPACCustomConsentTypes >+ default: 0 >+ choices: >+ 1: Allow >+ 0: "Don't allow" >+ - "users to register consents for custom (plugin based) consent types on the user account page." >+ - "<br>Note: The consents tab is also visible when you enabled PrivacyPolicyConsent." >+ > OpenURL: > - > - 'Complete URL of OpenURL resolver (starting with <code>http://</code> or <code>https://</code>):' >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc >index e53c087de00..5d594989e50 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc >@@ -24,7 +24,7 @@ > [% END %] > <a href="/cgi-bin/koha/opac-memberentry.pl">Personal details</a></li> > >- [% IF Koha.Preference('PrivacyPolicyConsent') || Koha.Preference('CookieConsent') # remove when extending %] >+ [% IF Koha.Preference('PrivacyPolicyConsent') || Koha.Preference('CookieConsent') || Koha.Preference('OPACCustomConsentTypes') %] > [% IF consentview %]<li class="active">[% ELSE %]<li>[% END %] > <a href="/cgi-bin/koha/opac-patron-consent.pl">Consents</a> > </li> >-- >2.41.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 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