From 396355b9fe30c613d035fdeb474d067526314637 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 19 Sep 2024 14:31:56 -0400 Subject: [PATCH] Bug 37967: Allow auto renewals notices to be sent via phone Auto renewals via phone are only disallowed because itiva did not support them. There is no reason to disallow auto-reneals for the generic phone transport. Twilio, for example, would have no problem sending those phone notices. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Note you can now select phone for auto-renewals! Signed-off-by: David Nind Signed-off-by: Lucas Gass Signed-off-by: Martin Renvoize --- .../data/mysql/atomicupdate/bug_37967.pl | 22 +++++++++++++++++++ .../sample_notices_message_transports.sql | 2 ++ 2 files changed, 24 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_37967.pl diff --git a/installer/data/mysql/atomicupdate/bug_37967.pl b/installer/data/mysql/atomicupdate/bug_37967.pl new file mode 100755 index 0000000000..9e08f9bcc7 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_37967.pl @@ -0,0 +1,22 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_failure say_success say_info); + +return { + bug_number => "BUG_NUMBER", + description => "A single line description", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + try { + $dbh->do(q{ + INSERT IGNORE INTO message_transports (`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`) VALUES + (9, 'phone', 1, 'circulation', 'AUTO_RENEWALS_DGST'), + (9, 'phone', 0, 'circulation', 'AUTO_RENEWALS'); + }); + say_success( $out, "Added phone messaging transports for auto-renewals" ); + } catch { + say_failure( $out, "Error adding phone messaging transports for auto-renewals: $_" ); + }; + }, +}; diff --git a/installer/data/mysql/mandatory/sample_notices_message_transports.sql b/installer/data/mysql/mandatory/sample_notices_message_transports.sql index 977e59f5ea..762fdb7ee5 100644 --- a/installer/data/mysql/mandatory/sample_notices_message_transports.sql +++ b/installer/data/mysql/mandatory/sample_notices_message_transports.sql @@ -36,8 +36,10 @@ values (8, 'phone', 0, 'ill', 'ILL_REQUEST_UNAVAIL'), (9, 'email', 0, 'circulation', 'AUTO_RENEWALS'), (9, 'sms', 0, 'circulation', 'AUTO_RENEWALS'), +(9, 'phone', 0, 'circulation', 'AUTO_RENEWALS'), (9, 'email', 1, 'circulation', 'AUTO_RENEWALS_DGST'), (9, 'sms', 1, 'circulation', 'AUTO_RENEWALS_DGST'), +(9, 'phone', 1, 'circulation', 'AUTO_RENEWALS_DGST'), (10, 'email', 0, 'circulation', 'HOLD_REMINDER'), (10, 'sms', 0, 'circulation', 'HOLD_REMINDER'), (10, 'phone', 0, 'circulation', 'HOLD_REMINDER'), -- 2.39.5