Bugzilla – Attachment 169870 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: Add a patron expiry messaging preference
Bug-30300-Add-a-patron-expiry-messaging-preference.patch (text/plain), 7.27 KB, created by
Roman Dolny
on 2024-07-30 17:32:03 UTC
(
hide
)
Description:
Bug 30300: Add a patron expiry messaging preference
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2024-07-30 17:32:03 UTC
Size:
7.27 KB
patch
obsolete
>From b89edee422debd8d72f7f0f4712ce45e503f0a7b Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Mon, 29 Jul 2024 10:58:48 +0000 >Subject: [PATCH] Bug 30300: Add a patron expiry messaging preference > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > ...add_expiration_to_messaging_preferences.pl | 51 +++++++++++++++++++ > .../sample_notices_message_attributes.sql | 3 +- > .../sample_notices_message_transports.sql | 5 +- > .../en/includes/messaging-preference-form.inc | 1 + > .../prog/en/modules/admin/categories.tt | 1 + > .../bootstrap/en/modules/opac-messaging.tt | 1 + > 6 files changed, 60 insertions(+), 2 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_30300-add_expiration_to_messaging_preferences.pl > >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 >new file mode 100755 >index 0000000000..db212f19b2 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_30300-add_expiration_to_messaging_preferences.pl >@@ -0,0 +1,51 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "30300", >+ description => "Add Patron expiry to messaging preference", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ my $attribute = $dbh->do( >+ q{ >+ SELECT message_attribute_id >+ FROM message_attributes >+ WHERE message_name = "Patron_Expiry" >+ } >+ ); >+ unless ( $attribute == 1 ) { >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO `message_attributes` >+ (message_name, `takes_days`) >+ VALUES ('Patron_Expiry', 0) >+ } >+ ); >+ say $out "Message attribute added"; >+ my $query = q{ >+ SELECT message_attribute_id >+ FROM message_attributes >+ WHERE message_name = "Patron_Expiry" >+ }; >+ my $sth = $dbh->prepare($query); >+ $sth->execute(); >+ my $results = $sth->fetchrow_hashref; >+ my $message_attribute_id = $results->{message_attribute_id}; >+ >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO `message_transports` >+ (`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`) >+ VALUES (?, 'email', 0, 'circulation', 'MEMBERSHIP_EXPIRY'), >+ (?, 'sms', 0, 'circulation', 'MEMBERSHIP_EXPIRY'), >+ (?, 'phone', 0, 'circulation', 'MEMBERSHIP_EXPIRY'), >+ ( ?, 'itiva', 0, 'circulation', 'MEMBERSHIP_EXPIRY' ) >+ }, {}, $message_attribute_id, $message_attribute_id, $message_attribute_id, $message_attribute_id >+ >+ ); >+ say $out "MEMBERSHIP_EXPIRY added to message_transports"; >+ } else { >+ say $out "Patron_Expiry message attribute exists, skipping update"; >+ } >+ }, >+ } >diff --git a/installer/data/mysql/mandatory/sample_notices_message_attributes.sql b/installer/data/mysql/mandatory/sample_notices_message_attributes.sql >index 31bf6d0b37..1b1659a67e 100644 >--- a/installer/data/mysql/mandatory/sample_notices_message_attributes.sql >+++ b/installer/data/mysql/mandatory/sample_notices_message_attributes.sql >@@ -12,4 +12,5 @@ values > (10, 'Hold_Reminder', 0), > (11, 'Ill_update', 0), > (12, 'Recall_Waiting', 0), >-(13, 'Recall_Requested', 0); >+(13, 'Recall_Requested', 0), >+(14, 'Patron_Expiry', 0); >diff --git a/installer/data/mysql/mandatory/sample_notices_message_transports.sql b/installer/data/mysql/mandatory/sample_notices_message_transports.sql >index 977e59f5ea..3c26cf30ce 100644 >--- a/installer/data/mysql/mandatory/sample_notices_message_transports.sql >+++ b/installer/data/mysql/mandatory/sample_notices_message_transports.sql >@@ -50,4 +50,7 @@ values > (12, "phone", 0, "circulation", "PICKUP_RECALLED_ITEM"), > (13, "email", 0, "circulation", "RETURN_RECALLED_ITEM"), > (13, "sms", 0, "circulation", "RETURN_RECALLED_ITEM"), >-(13, "phone", 0, "circulation", "RETURN_RECALLED_ITEM"); >+(13, "phone", 0, "circulation", "RETURN_RECALLED_ITEM"), >+(14, "email", 0, "members", "MEMBERSHIP_EXPIRY"), >+(14, "sms", 0, "members", "MEMBERSHIP_EXPIRY"), >+(14, "phone", 0, "members", "MEMBERSHIP_EXPIRY"); >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 b3cadaa435..23a59e9ac7 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 >@@ -31,6 +31,7 @@ > [% ELSE %] > <span>Item checkout</span> > [% END %] >+ [% ELSIF ( messaging_preference.Patron_Expiry ) %]<span>Patron expiry</span> > [% ELSIF ( messaging_preference.Ill_ready ) %]<span>Interlibrary loan ready</span> > [% ELSIF ( messaging_preference.Ill_unavailable ) %]<span>Interlibrary loan unavailable</span> > [% ELSIF ( messaging_preference.Ill_update ) %]<span>Interlibrary loan updated</span> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >index b2151134af..64ea958fab 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt >@@ -680,6 +680,7 @@ > [% ELSIF ( prefs.Ill_update ) %]<span>Interlibrary loan updated</span> > [% ELSIF ( prefs.Auto_Renewals ) %]<span>Auto renewal</span> > [% ELSIF ( prefs.Hold_Reminder ) %]<span>Hold reminder</span> >+ [% ELSIF ( prefs.Patron_Expiry ) %]<span>Patron expiry</span> > [% ELSE %]<span>Unknown</span> > [% END %]: > <strong>[% transport.transport | html %]</strong><br /> >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 4a34272063..18d330718b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt >@@ -73,6 +73,7 @@ > [% ELSE %] > <span>Item checkout</span> > [% END %] >+ [% ELSIF ( messaging_preference.Patron_Expiry ) %]<span>Patron expiry</span> > [% ELSIF ( messaging_preference.Ill_ready ) %]<span>Interlibrary loan ready</span> > [% ELSIF ( messaging_preference.Ill_unavailable ) %]<span>Interlibrary loan unavailable</span> > [% ELSIF ( messaging_preference.Ill_update ) %]<span>Interlibrary loan updated</span> >-- >2.39.2
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