From 513e4099925ae0a3ba6465f8563a1f762ee296ca Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 30 Apr 2020 14:09:02 -0400 Subject: [PATCH] Bug 25333: Change message transport type for Talking Tech from "phone" to "talkingtech" From its inception, phone notices via Talking Tech have not behaved like other notices. Instead of reading notices generated by Koha, the Talking Tech scripts largely generate their own notices. We would like to pave the way to having "generic" phone notices that can be processed by plugins to support arbitrary telephony vendors ( we will be targeting Twilio initially ). To that end, it seems sensible to begin by changing the messaage transport type for Talking Tech from 'phone' to 'talkingtech' to highlight its specificity and difference from standard message transports. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Restart all the things! 4) Test Talking Tech outbound script 5) Note no changes in functionality --- .../sample_notices_message_transports.sql | 34 +++++++++---------- .../en/includes/messaging-preference-form.inc | 22 ++++++------ .../prog/en/modules/tools/letter.tt | 2 +- .../thirdparty/TalkingTech_itiva_outbound.pl | 10 +++--- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/installer/data/mysql/mandatory/sample_notices_message_transports.sql b/installer/data/mysql/mandatory/sample_notices_message_transports.sql index 5954bafc7b..8fe6fc1838 100644 --- a/installer/data/mysql/mandatory/sample_notices_message_transports.sql +++ b/installer/data/mysql/mandatory/sample_notices_message_transports.sql @@ -1,20 +1,20 @@ insert into `message_transports` (`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`) values -(1, 'email', 0, 'circulation', 'DUE'), -(1, 'email', 1, 'circulation', 'DUEDGST'), -(1, 'sms', 0, 'circulation', 'DUE'), -(1, 'sms', 1, 'circulation', 'DUEDGST'), -(2, 'email', 0, 'circulation', 'PREDUE'), -(2, 'email', 1, 'circulation', 'PREDUEDGST'), -(2, 'sms', 0, 'circulation', 'PREDUE'), -(2, 'sms', 1, 'circulation', 'PREDUEDGST'), -(2, 'phone', 0, 'circulation', 'PREDUE'), -(2, 'phone', 1, 'circulation', 'PREDUEDGST'), -(4, 'email', 0, 'reserves', 'HOLD'), -(4, 'sms', 0, 'reserves', 'HOLD'), -(4, 'phone', 0, 'reserves', 'HOLD'), -(5, 'email', 0, 'circulation', 'CHECKIN'), -(5, 'sms', 0, 'circulation', 'CHECKIN'), -(6, 'email', 0, 'circulation', 'CHECKOUT'), -(6, 'sms', 0, 'circulation', 'CHECKOUT'); +(1, 'email', 0, 'circulation', 'DUE'), +(1, 'email', 1, 'circulation', 'DUEDGST'), +(1, 'sms', 0, 'circulation', 'DUE'), +(1, 'sms', 1, 'circulation', 'DUEDGST'), +(2, 'email', 0, 'circulation', 'PREDUE'), +(2, 'email', 1, 'circulation', 'PREDUEDGST'), +(2, 'sms', 0, 'circulation', 'PREDUE'), +(2, 'sms', 1, 'circulation', 'PREDUEDGST'), +(2, 'talkingtech', 0, 'circulation', 'PREDUE'), +(2, 'talkingtech', 1, 'circulation', 'PREDUEDGST'), +(4, 'email', 0, 'reserves', 'HOLD'), +(4, 'sms', 0, 'reserves', 'HOLD'), +(4, 'talkingtech', 0, 'reserves', 'HOLD'), +(5, 'email', 0, 'circulation', 'CHECKIN'), +(5, 'sms', 0, 'circulation', 'CHECKIN'), +(6, 'email', 0, 'circulation', 'CHECKOUT'), +(6, 'sms', 0, 'circulation', 'CHECKOUT'); 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 2f948c6236..6e6e74c74a 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 @@ -74,31 +74,31 @@ [% END %] [% IF Koha.Preference('TalkingTechItivaPhoneNotification') %] - [% IF ( messaging_preference.transport_phone ) %] + [% IF ( messaging_preference.transport_talkingtech ) %] [% IF ( messaging_form_inactive ) %] - [% IF ( messaging_preference.transports_phone ) %] + [% IF ( messaging_preference.transports_talkingtech ) %] + value="talkingtech" checked="checked" disabled="disabled" /> [% ELSE %] + value="talkingtech" disabled="disabled" /> [% END %] [% ELSE %] - [% IF ( messaging_preference.transports_phone ) %] + [% IF ( messaging_preference.transports_talkingtech ) %] + value="talkingtech" checked="checked" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" /> [% ELSE %] + value="talkingtech" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" /> [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt index 313e44bebf..b0938578f3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt @@ -401,7 +401,7 @@ SMS [% CASE 'feed' %] Feed - [% CASE 'phone' %] + [% CASE 'talkingtech' %] Phone [% CASE %] [% letter.message_transport_type | html %] diff --git a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl index 1131da61e2..b84cef6908 100755 --- a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl +++ b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl @@ -145,7 +145,7 @@ foreach my $type (@types) { biblio => $issues->{'biblionumber'}, biblioitems => $issues->{'biblionumber'}, }, - message_transport_type => 'phone', + message_transport_type => 'talkingtech', ); die "No letter found for type $type!... dying\n" unless $letter; @@ -155,7 +155,7 @@ foreach my $type (@types) { $message_id = C4::Letters::EnqueueLetter( { letter => $letter, borrowernumber => $issues->{'borrowernumber'}, - message_transport_type => 'phone', + message_transport_type => 'talkingtech', } ); } @@ -250,7 +250,7 @@ sub GetOverdueIssues { JOIN overduerules USING (categorycode) JOIN overduerules_transport_types USING ( overduerules_id ) WHERE ( overduerules.branchcode = borrowers.branchcode or overduerules.branchcode = '') - AND overduerules_transport_types.message_transport_type = 'phone' + AND overduerules_transport_types.message_transport_type = 'talkingtech' AND ( (TO_DAYS(NOW())-TO_DAYS(date_due) ) = delay1 OR (TO_DAYS(NOW())-TO_DAYS(date_due) ) = delay2 OR (TO_DAYS(NOW())-TO_DAYS(date_due) ) = delay3 ) @@ -292,7 +292,7 @@ sub GetPredueIssues { JOIN borrower_message_transport_preferences USING (borrower_message_preference_id) JOIN message_attributes USING (message_attribute_id) WHERE ( TO_DAYS( date_due ) - TO_DAYS( NOW() ) ) = days_in_advance - AND message_transport_type = 'phone' + AND message_transport_type = 'talkingtech' AND message_name = 'Advance_Notice' $patron_branchcode_filter "; @@ -323,7 +323,7 @@ sub GetWaitingHolds { JOIN borrower_message_transport_preferences USING (borrower_message_preference_id) JOIN message_attributes USING (message_attribute_id) WHERE ( reserves.found = 'W' ) - AND message_transport_type = 'phone' + AND message_transport_type = 'talkingtech' AND message_name = 'Hold_Filled' $patron_branchcode_filter "; -- 2.24.2 (Apple Git-127)