Bugzilla – Attachment 174888 Details for
Bug 30300
Add patron expiration email to patron messaging preferences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30300: (QA follow-up) Prevent regression and improve clarity
Bug-30300-QA-follow-up-Prevent-regression-and-impr.patch (text/plain), 5.27 KB, created by
Matt Blenkinsop
on 2024-11-21 14:46:33 UTC
(
hide
)
Description:
Bug 30300: (QA follow-up) Prevent regression and improve clarity
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-11-21 14:46:33 UTC
Size:
5.27 KB
patch
obsolete
>From fd70d6289bc61680f83206ccd64346028e38c2fa Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Thu, 14 Nov 2024 11:28:05 +0000 >Subject: [PATCH] Bug 30300: (QA follow-up) Prevent regression and improve > clarity > >This patch amends the DB update to check the MembershipExpiryDaysNotice syspref and sets the flag for all patrons if the syspref is set > >It also improves the UI visiblity by hiding the messaging preference if the syspref isn't set and adding more clarity to the syspref definition >--- > ...00-add_expiration_to_messaging_preferences.pl | 16 ++++++++++++++++ > .../en/includes/messaging-preference-form.inc | 1 + > .../en/modules/admin/preferences/patrons.pref | 1 + > .../bootstrap/en/modules/opac-messaging.tt | 1 + > 4 files changed, 19 insertions(+) > >diff --git a/installer/data/mysql/atomicupdate/bug_30300-add_expiration_to_messaging_preferences.pl b/installer/data/mysql/atomicupdate/bug_30300-add_expiration_to_messaging_preferences.pl >index db212f19b26..d8f37cd236b 100755 >--- a/installer/data/mysql/atomicupdate/bug_30300-add_expiration_to_messaging_preferences.pl >+++ b/installer/data/mysql/atomicupdate/bug_30300-add_expiration_to_messaging_preferences.pl >@@ -1,5 +1,7 @@ > use Modern::Perl; > >+use Koha::Patrons; >+ > return { > bug_number => "30300", > description => "Add Patron expiry to messaging preference", >@@ -44,6 +46,20 @@ return { > > ); > say $out "MEMBERSHIP_EXPIRY added to message_transports"; >+ >+ my $days_notice = C4::Context->preference('MembershipExpiryDaysNotice'); >+ if($days_notice) { >+ my $patrons = Koha::Patrons->search(); >+ while ( my $patron = $patrons->next ) { >+ C4::Members::Messaging::SetMessagingPreference( >+ { >+ borrowernumber => $patron->borrowernumber, >+ message_attribute_id => $message_attribute_id, >+ message_transport_types => ['email'], >+ } >+ ); >+ } >+ } > } else { > say $out "Patron_Expiry message attribute exists, skipping update"; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc >index 9a0d4f5886c..b7c0c63d9d0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc >@@ -17,6 +17,7 @@ > <tbody> > [% FOREACH messaging_preference IN messaging_preferences %] > [% NEXT IF !Koha.Preference( 'ILLModule' ) && messaging_preference.message_name.match('^Ill_') %] >+ [% NEXT IF !Koha.Preference('MembershipExpiryDaysNotice') && messaging_preference.Patron_Expiry %] > [% NEXT IF messaging_preference.Auto_Renewals && Koha.Preference('AutoRenewalNotices') != 'preferences' %] > [% NEXT IF !Koha.Preference('UseRecalls') && messaging_preference.message_name.match('^Recall_') %] > <tr id="[% messaging_preference.message_name _ "_message" | lower | html %]"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >index dac646d44db..05eca7662d9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >@@ -156,6 +156,7 @@ Patrons: > class: integer > - days. > - "<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/membership_expiry.pl</code> cronjob. Ask your system administrator to schedule it." >+ - "<br><strong>NOTE:</strong> The parameters you use to select patrons when running the cronjob will supersede a user's messaging preferences. For example, a user may have opted to receive the expiry notice but if they are not included in the search parameters on the cronjob then they will not receive the notice." > Notices and notifications: > - > - pref: EnhancedMessagingPreferences >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt >index 5e45443173a..38a88151d22 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt >@@ -59,6 +59,7 @@ > <tbody> > [% FOREACH messaging_preference IN messaging_preferences %] > [% NEXT IF !Koha.Preference( 'ILLModule' ) && messaging_preference.message_name.match('^Ill_') %] >+ [% NEXT IF !Koha.Preference('MembershipExpiryDaysNotice') && messaging_preference.Patron_Expiry %] > [% NEXT IF messaging_preference.Auto_Renewals && Koha.Preference('AutoRenewalNotices') != 'preferences' %] > [% NEXT IF !Koha.Preference('UseRecalls') && messaging_preference.message_name.match('^Recall_') %] > <tr id="[% messaging_preference.message_name _ "_message" | lower | html %]"> >-- >2.39.3 (Apple Git-146)
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 30300
:
169860
|
169861
|
169870
|
169871
|
173810
|
173811
|
173812
|
173820
|
173821
|
173822
|
173823
|
174713
|
174714
|
174715
|
174716
|
174717
| 174888