Bugzilla – Attachment 98078 Details for
Bug 18532
Messaging preferences for auto renewals
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18532: Add new letter AUTO_RENEWALS_DGST, new Auto_Renewals in message_attributes, and configured message_transports
Bug-18532-Add-new-letter-AUTORENEWALSDGST-new-Auto.patch (text/plain), 5.76 KB, created by
Agustín Moyano
on 2020-01-29 13:34:48 UTC
(
hide
)
Description:
Bug 18532: Add new letter AUTO_RENEWALS_DGST, new Auto_Renewals in message_attributes, and configured message_transports
Filename:
MIME Type:
Creator:
Agustín Moyano
Created:
2020-01-29 13:34:48 UTC
Size:
5.76 KB
patch
obsolete
>From 42e50d291272ce3332c39b118f167d8c1cee1342 Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Tue, 29 Oct 2019 15:27:37 -0300 >Subject: [PATCH] Bug 18532: Add new letter AUTO_RENEWALS_DGST, new > Auto_Renewals in message_attributes, and configured message_transports > >Signed-off-by: tgoat <tgoatley@gmail.com> > >Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> > >Signed-off-by: Marti Fuerst <mfuerst@hmcpl.org> >--- > .../data/mysql/atomicupdate/bug-18532.perl | 34 +++++++++++++++++++ > .../mysql/en/mandatory/sample_notices.sql | 31 +++++++++++++++++ > .../sample_notices_message_attributes.sql | 3 +- > .../sample_notices_message_transports.sql | 6 +++- > 4 files changed, 72 insertions(+), 2 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug-18532.perl > >diff --git a/installer/data/mysql/atomicupdate/bug-18532.perl b/installer/data/mysql/atomicupdate/bug-18532.perl >new file mode 100644 >index 0000000000..ed7336a08c >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug-18532.perl >@@ -0,0 +1,34 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ # you can use $dbh here like: >+ $dbh->do( qq{ >+ INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS_DGST', 'notification on auto renewing', 'Auto renewals (Digest)', >+ "Dear [% borrower.firstname %] [% borrower.surname %], >+ [% IF checkout.auto_renew_errors %] >+ There were [% checkout.auto_renew_errors %] items that where not correctly renewed. >+ [% END %] >+ [% IF checkout.auto_renew %] >+ There were [% checkout.auto_renew %] items that where correctly renewed. >+ [% END %] >+ ", 'email'); >+ }); >+ >+ $dbh->do( qq{ >+ INSERT IGNORE INTO `message_attributes` >+ (`message_attribute_id`, message_name, `takes_days`) >+ VALUES (7, 'Auto_Renewals', 0) >+ }); >+ >+ $dbh->do( qq{ >+ INSERT IGNORE INTO `message_transports` >+ (`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`) >+ VALUES (7, 'email', 0, 'circulation', 'AUTO_RENEWALS'), >+ (7, 'sms', 0, 'circulation', 'AUTO_RENEWALS'), >+ (7, 'email', 1, 'circulation', 'AUTO_RENEWALS_DGST'), >+ (7, 'sms', 1, 'circulation', 'AUTO_RENEWALS_DGST') >+ }); >+ >+ # Always end with this (adjust the bug info) >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 18532 - Add AUTO_RENEWALS in message_attributes and add AUTO_RENEWALS_DGST letter)\n"; >+} >diff --git a/installer/data/mysql/en/mandatory/sample_notices.sql b/installer/data/mysql/en/mandatory/sample_notices.sql >index 1fea0039ad..10631f2e87 100644 >--- a/installer/data/mysql/en/mandatory/sample_notices.sql >+++ b/installer/data/mysql/en/mandatory/sample_notices.sql >@@ -382,3 +382,34 @@ INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, > </tr> > </tfoot> > </table>', 'print', 'default'); >+ >+INSERT INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS', 'notification on auto renewing', 'Auto renewals', >+"Dear [% borrower.firstname %] [% borrower.surname %], >+[% IF checkout.auto_renew_error %] >+The following item [% biblio.title %] has not been correctly renewed >+[% IF checkout.auto_renew_error == 'too_many' %] >+You have reach the maximum of checkouts possible. >+[% ELSIF checkout.auto_renew_error == 'on_reserve' %] >+This item is on hold for another patron. >+[% ELSIF checkout.auto_renew_error == 'restriction' %] >+You are currently restricted. >+[% ELSIF checkout.auto_renew_error == 'overdue' %] >+You have overdues. >+[% ELSIF checkout.auto_renew_error == 'auto_too_late' %] >+It\'s too late to renew this checkout. >+[% ELSIF checkout.auto_renew_error == 'auto_too_much_oweing' %] >+You have too much unpaid fines. >+[% END %] >+[% ELSE %] >+The following item [% biblio.title %] has correctly been renewed and is now due [% checkout.date_due %] >+[% END %]", 'email'); >+ >+INSERT INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS_DGST', 'notification on auto renewing', 'Auto renewals (Digest)', >+"Dear [% borrower.firstname %] [% borrower.surname %], >+[% IF <<error>> %] >+There were <<error>> items that where not correctly renewed. >+[% END %] >+[% IF <<success>> %] >+There were <<success>> items that where correctly renewed. >+[% END %] >+", 'email'); >diff --git a/installer/data/mysql/mandatory/sample_notices_message_attributes.sql b/installer/data/mysql/mandatory/sample_notices_message_attributes.sql >index a7a6032cc7..32ab818d03 100644 >--- a/installer/data/mysql/mandatory/sample_notices_message_attributes.sql >+++ b/installer/data/mysql/mandatory/sample_notices_message_attributes.sql >@@ -5,5 +5,6 @@ values > (2, 'Advance_Notice', 1), > (4, 'Hold_Filled', 0), > (5, 'Item_Check_in', 0), >-(6, 'Item_Checkout', 0); >+(6, 'Item_Checkout', 0), >+(7, 'Auto_Renewals', 0); > >diff --git a/installer/data/mysql/mandatory/sample_notices_message_transports.sql b/installer/data/mysql/mandatory/sample_notices_message_transports.sql >index 5954bafc7b..eecdbdf16a 100644 >--- a/installer/data/mysql/mandatory/sample_notices_message_transports.sql >+++ b/installer/data/mysql/mandatory/sample_notices_message_transports.sql >@@ -17,4 +17,8 @@ values > (5, 'email', 0, 'circulation', 'CHECKIN'), > (5, 'sms', 0, 'circulation', 'CHECKIN'), > (6, 'email', 0, 'circulation', 'CHECKOUT'), >-(6, 'sms', 0, 'circulation', 'CHECKOUT'); >+(6, 'sms', 0, 'circulation', 'CHECKOUT'), >+(7, 'email', 0, 'circulation', 'AUTO_RENEWALS'), >+(7, 'sms', 0, 'circulation', 'AUTO_RENEWALS'), >+(7, 'email', 1, 'circulation', 'AUTO_RENEWALS_DGST'), >+(7, 'sms', 1, 'circulation', 'AUTO_RENEWALS_DGST'); >-- >2.17.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 18532
:
95030
|
95031
|
95337
|
95338
|
95456
|
96049
|
96050
|
96487
|
96494
|
96495
|
98078
|
98079
|
99193
|
99194
|
104880
|
104881
|
104882
|
104883
|
105500
|
105501
|
105502
|
105503
|
114316
|
115798
|
115799
|
115800
|
115801
|
115802
|
115829
|
115830
|
115831
|
115832
|
115833
|
118198
|
118199
|
118205
|
118318
|
118329
|
118330
|
118331
|
118356