Bugzilla – Attachment 178550 Details for
Bug 30515
Move Overdue transports to patron messaging preferences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30515: Fix messaging options order and add database changes
Bug-30515-Fix-messaging-options-order-and-add-data.patch (text/plain), 10.89 KB, created by
David Gustafsson
on 2025-02-24 12:59:54 UTC
(
hide
)
Description:
Bug 30515: Fix messaging options order and add database changes
Filename:
MIME Type:
Creator:
David Gustafsson
Created:
2025-02-24 12:59:54 UTC
Size:
10.89 KB
patch
obsolete
>From b5274e043b7ddeeb691ab8914f2b6994a52f24b0 Mon Sep 17 00:00:00 2001 >From: David Gustafsson <david.gustafsson@ub.gu.se> >Date: Mon, 24 Feb 2025 13:32:19 +0100 >Subject: [PATCH] Bug 30515: Fix messaging options order and add database > changes > >--- > C4/Members/Messaging.pm | 5 +- > .../bug_30515-add_system_preferences.pl | 16 ----- > ...nsports_to_patron_messaging_preferences.pl | 66 +++++++++++++++++++ > .../mysql/en/mandatory/sample_notices.yml | 64 +++++++++++++++++- > .../sample_notices_message_attributes.sql | 5 +- > .../sample_notices_message_transports.sql | 8 ++- > 6 files changed, 144 insertions(+), 20 deletions(-) > delete mode 100644 installer/data/mysql/atomicupdate/bug_30515-add_system_preferences.pl > create mode 100644 installer/data/mysql/atomicupdate/bug_30515-move_overdue_transports_to_patron_messaging_preferences.pl > >diff --git a/C4/Members/Messaging.pm b/C4/Members/Messaging.pm >index a92801f1089..b2b8ebbaec8 100644 >--- a/C4/Members/Messaging.pm >+++ b/C4/Members/Messaging.pm >@@ -230,7 +230,10 @@ END_SQL > 'Auto_Renewals' => 9, > 'Advance_Notice' => 10, > 'Item_Due' => 11, >- 'Item_Check_in' => 12 >+ 'Item_Check_in' => 12, >+ 'Overdue1' => 13, >+ 'Overdue2' => 14, >+ 'Overdue3' => 15, > ); > > @return = >diff --git a/installer/data/mysql/atomicupdate/bug_30515-add_system_preferences.pl b/installer/data/mysql/atomicupdate/bug_30515-add_system_preferences.pl >deleted file mode 100644 >index 202c211d2e3..00000000000 >--- a/installer/data/mysql/atomicupdate/bug_30515-add_system_preferences.pl >+++ /dev/null >@@ -1,16 +0,0 @@ >-use Modern::Perl; >- >-return { >- bug_number => "30515", >- description => "Add system preferences for patron specific overdue notice preferences", >- up => sub { >- my ($args) = @_; >- my ($dbh, $out) = @$args{qw(dbh out)}; >- >- $dbh->do(q{INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('UsePatronPreferencesForOverdueNotices', '0', NULL, 'Use patron specific messaging preferences for overdue notices if available', 'YesNo')}); >- say $out "UsePatronPreferencesForOverdueNotices system preference added"; >- >- $dbh->do(q{INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('UsePatronPreferencesForOverdueNoticesPrint', 'always', 'always|fallback|never', 'When to send print notices when using patron specific messaging preferences for overdue notices', 'Choice')}); >- say $out "UsePatronPreferencesForOverdueNoticesPrint system preference added"; >- }, >-}; >diff --git a/installer/data/mysql/atomicupdate/bug_30515-move_overdue_transports_to_patron_messaging_preferences.pl b/installer/data/mysql/atomicupdate/bug_30515-move_overdue_transports_to_patron_messaging_preferences.pl >new file mode 100644 >index 00000000000..748b2a74614 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_30515-move_overdue_transports_to_patron_messaging_preferences.pl >@@ -0,0 +1,66 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "30515", >+ description => "Add system preferences for patron specific overdue notice preferences", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO `message_attributes` >+ (`message_attribute_id`, `message_name`, `takes_days`) >+ VALUES >+ (15, 'Overdue1', 0), >+ (16, 'Overdue2', 0), >+ (17, 'Overdue3', 0) >+ } >+ ); >+ say $out "Message attributes for overdue notices added"; >+ >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO `message_transports` >+ (`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`) >+ VALUES >+ (15, 'email', 0, 'circulation', 'ODUE'), >+ (15, 'sms', 0, 'circulation', 'ODUE'), >+ (16, 'email', 0, 'circulation', 'ODUE2'), >+ (16, 'sms', 0, 'circulation', 'ODUE2'), >+ (17, 'email', 0, 'circulation', 'ODUE3'), >+ (17, 'sms', 0, 'circulation', 'ODUE3') >+ } >+ ); >+ say $out "Message transports for overdue notices added"; >+ >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO systempreferences >+ (`variable`, `value`, `options`, `explanation`, `type`) >+ VALUES ( >+ 'UsePatronPreferencesForOverdueNotices', >+ '0', >+ NULL, >+ 'Use patron specific messaging preferences for overdue notices if available', >+ 'YesNo' >+ ) >+ } >+ ); >+ say $out "UsePatronPreferencesForOverdueNotices system preference added"; >+ >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) >+ VALUES ( >+ 'UsePatronPreferencesForOverdueNoticesPrint', >+ 'always', >+ 'always|fallback|never', >+ 'When to send print notices when using patron specific messaging preferences for overdue notices', >+ 'Choice' >+ ) >+ } >+ ); >+ say $out "UsePatronPreferencesForOverdueNoticesPrint system preference added"; >+ }, >+} >diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml >index 0efc142bb0b..9d6724b61e4 100644 >--- a/installer/data/mysql/en/mandatory/sample_notices.yml >+++ b/installer/data/mysql/en/mandatory/sample_notices.yml >@@ -881,7 +881,69 @@ tables: > content: > - "Dear <<borrowers.firstname>> <<borrowers.surname>>," > - "" >- - "According to our current records, you have items that are overdue.Your library does not charge late fines, but please return or renew them at the branch below as soon as possible." >+ - "According to our current records, you have items that are overdue. Your library does not charge late fines, but please return or renew them at the branch below as soon as possible." >+ - "" >+ - "<<branches.branchname>>" >+ - "<<branches.branchaddress1>>" >+ - "<<branches.branchaddress2>> <<branches.branchaddress3>>" >+ - "Phone: <<branches.branchphone>>" >+ - "Fax: <<branches.branchfax>>" >+ - "Email: <<branches.branchemail>>" >+ - "" >+ - "If you have registered a password with the library, and you have a renewal available, you may renew online. If an item becomes more than 30 days overdue, you will be unable to use your library card until the item is returned." >+ - "" >+ - "The following item(s) is/are currently overdue:" >+ - "" >+ - "<item>\"<<biblio.title>>\" by <<biblio.author>>, <<items.itemcallnumber>>, Barcode: <<items.barcode>> Fine: <<items.fine>></item>" >+ - "" >+ - "Thank-you for your prompt attention to this matter." >+ - "" >+ - "<<branches.branchname>> Staff" >+ - "" >+ >+ - module: circulation >+ code: ODUE2 >+ branchcode: "" >+ name: "Overdue notice" >+ is_html: 0 >+ title: "Item overdue" >+ message_transport_type: email >+ lang: default >+ content: >+ - "Dear <<borrowers.firstname>> <<borrowers.surname>>," >+ - "" >+ - "According to our current records, you have items that are overdue. This is the second reminder. Your library does not charge late fines, but please return or renew them at the branch below as soon as possible." >+ - "" >+ - "<<branches.branchname>>" >+ - "<<branches.branchaddress1>>" >+ - "<<branches.branchaddress2>> <<branches.branchaddress3>>" >+ - "Phone: <<branches.branchphone>>" >+ - "Fax: <<branches.branchfax>>" >+ - "Email: <<branches.branchemail>>" >+ - "" >+ - "If you have registered a password with the library, and you have a renewal available, you may renew online. If an item becomes more than 30 days overdue, you will be unable to use your library card until the item is returned." >+ - "" >+ - "The following item(s) is/are currently overdue:" >+ - "" >+ - "<item>\"<<biblio.title>>\" by <<biblio.author>>, <<items.itemcallnumber>>, Barcode: <<items.barcode>> Fine: <<items.fine>></item>" >+ - "" >+ - "Thank-you for your prompt attention to this matter." >+ - "" >+ - "<<branches.branchname>> Staff" >+ - "" >+ >+ - module: circulation >+ code: ODUE3 >+ branchcode: "" >+ name: "Overdue notice" >+ is_html: 0 >+ title: "Item overdue" >+ message_transport_type: email >+ lang: default >+ content: >+ - "Dear <<borrowers.firstname>> <<borrowers.surname>>," >+ - "" >+ - "According to our current records, you have items that are overdue. This is the final reminder. Your library does not charge late fines, but please return or renew them at the branch below as soon as possible." > - "" > - "<<branches.branchname>>" > - "<<branches.branchaddress1>>" >diff --git a/installer/data/mysql/mandatory/sample_notices_message_attributes.sql b/installer/data/mysql/mandatory/sample_notices_message_attributes.sql >index 1b1659a67ef..6d65711ccc2 100644 >--- a/installer/data/mysql/mandatory/sample_notices_message_attributes.sql >+++ b/installer/data/mysql/mandatory/sample_notices_message_attributes.sql >@@ -13,4 +13,7 @@ values > (11, 'Ill_update', 0), > (12, 'Recall_Waiting', 0), > (13, 'Recall_Requested', 0), >-(14, 'Patron_Expiry', 0); >+(14, 'Patron_Expiry', 0) >+(15, 'Overdue1', 0), >+(16, 'Overdue2', 0), >+(17, 'Overdue3', 0); >diff --git a/installer/data/mysql/mandatory/sample_notices_message_transports.sql b/installer/data/mysql/mandatory/sample_notices_message_transports.sql >index c0395e09c92..15b3fa43e81 100644 >--- a/installer/data/mysql/mandatory/sample_notices_message_transports.sql >+++ b/installer/data/mysql/mandatory/sample_notices_message_transports.sql >@@ -55,4 +55,10 @@ values > (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"); >+(14, "phone", 0, "members", "MEMBERSHIP_EXPIRY") >+(15, 'email', 0, 'circulation', 'ODUE'), >+(15, 'sms', 0, 'circulation', 'ODUE'), >+(16, 'email', 0, 'circulation', 'ODUE2'), >+(16, 'sms', 0, 'circulation', 'ODUE2'), >+(17, 'email', 0, 'circulation', 'ODUE3'), >+(17, 'sms', 0, 'circulation', 'ODUE3'),; >-- >2.48.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 30515
:
163564
|
163573
|
163574
|
178276
|
178548
|
178549
| 178550