Browse Source

Bug 25333: Change message transport type for Talking Tech from "phone" to "itiva"

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 'itiva' 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

Signed-off-by: Christopher Zorn <Christofer.Zorn@ajaxlibrary.ca>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

JD amended patch: remove uneeded indentation change in sample_notices_message_transports.sql

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
20.11.x
Kyle Hall 1 year ago
committed by Jonathan Druart
parent
commit
ebbee18822
  1. 2
      C4/Reserves.pm
  2. 9
      installer/data/mysql/atomicupdate/bug_25333.perl
  3. 2
      installer/data/mysql/mandatory/message_transport_types.sql
  4. 6
      installer/data/mysql/mandatory/sample_notices_message_transports.sql
  5. 22
      koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc
  6. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt
  7. 10
      misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl

2
C4/Reserves.pm

@ -1853,7 +1853,7 @@ sub _koha_notify_reserve {
next if (
( $mtt eq 'email' and not $to_address ) # No email address
or ( $mtt eq 'sms' and not $patron->smsalertnumber ) # No SMS number
or ( $mtt eq 'phone' and C4::Context->preference('TalkingTechItivaPhoneNotification') ) # Notice is handled by TalkingTech_itiva_outbound.pl
or ( $mtt eq 'itiva' and C4::Context->preference('TalkingTechItivaPhoneNotification') ) # Notice is handled by TalkingTech_itiva_outbound.pl
);
&$send_notification($mtt, $letter_code);

9
installer/data/mysql/atomicupdate/bug_25333.perl

@ -0,0 +1,9 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
$dbh->do(q{
UPDATE message_transport_types SET message_transport_type = "itiva" WHERE message_transport_type = "phone"
});
# Always end with this (adjust the bug info)
NewVersion( $DBversion, 25333, q{Change message transport type for Talking Tech from "phone" to "itiva"});
}

2
installer/data/mysql/mandatory/message_transport_types.sql

@ -4,4 +4,4 @@ values
('email'),
('print'),
('sms'),
('phone');
('itiva');

6
installer/data/mysql/mandatory/sample_notices_message_transports.sql

@ -9,11 +9,11 @@ values
(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'),
(2, 'itiva', 0, 'circulation', 'PREDUE'),
(2, 'itiva', 1, 'circulation', 'PREDUEDGST'),
(4, 'email', 0, 'reserves', 'HOLD'),
(4, 'sms', 0, 'reserves', 'HOLD'),
(4, 'phone', 0, 'reserves', 'HOLD'),
(4, 'itiva', 0, 'reserves', 'HOLD'),
(5, 'email', 0, 'circulation', 'CHECKIN'),
(5, 'sms', 0, 'circulation', 'CHECKIN'),
(6, 'email', 0, 'circulation', 'CHECKOUT'),

22
koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc

@ -79,31 +79,31 @@
[% END %]
[% IF Koha.Preference('TalkingTechItivaPhoneNotification') %]
[% IF ( messaging_preference.transport_phone ) %]
[% IF ( messaging_preference.transport_itiva ) %]
<td>
[% IF ( messaging_form_inactive ) %]
[% IF ( messaging_preference.transports_phone ) %]
[% IF ( messaging_preference.transports_itiva ) %]
<input type="checkbox"
id="phone[% messaging_preference.message_attribute_id | html %]"
id="itiva[% messaging_preference.message_attribute_id | html %]"
name="[% messaging_preference.message_attribute_id | html %]"
value="phone" checked="checked" disabled="disabled" />
value="itiva" checked="checked" disabled="disabled" />
[% ELSE %]
<input type="checkbox"
id="phone[% messaging_preference.message_attribute_id | html %]"
id="itiva[% messaging_preference.message_attribute_id | html %]"
name="[% messaging_preference.message_attribute_id | html %]"
value="phone" disabled="disabled" />
value="itiva" disabled="disabled" />
[% END %]
[% ELSE %]
[% IF ( messaging_preference.transports_phone ) %]
[% IF ( messaging_preference.transports_itiva ) %]
<input type="checkbox"
id="phone[% messaging_preference.message_attribute_id | html %]"
id="itiva[% messaging_preference.message_attribute_id | html %]"
name="[% messaging_preference.message_attribute_id | html %]"
value="phone" checked="checked" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
value="itiva" checked="checked" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
[% ELSE %]
<input type="checkbox"
id="phone[% messaging_preference.message_attribute_id | html %]"
id="itiva[% messaging_preference.message_attribute_id | html %]"
name="[% messaging_preference.message_attribute_id | html %]"
value="phone" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
value="itiva" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
[% END %]
[% END %]
</td>

2
koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt

@ -404,7 +404,7 @@
SMS
[% CASE 'feed' %]
Feed
[% CASE 'phone' %]
[% CASE 'itiva' %]
Phone
[% CASE %]
[% letter.message_transport_type | html %]

10
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 => 'itiva',
);
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 => 'itiva',
}
);
}
@ -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 = 'itiva'
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 = 'itiva'
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 = 'itiva'
AND message_name = 'Hold_Filled'
$patron_branchcode_filter
";

Loading…
Cancel
Save