Bugzilla – Attachment 104885 Details for
Bug 25334
Add generic 'phone' message transport type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25334: Add generic 'phone' message transport type
Bug-25334-Add-generic-phone-message-transport-type.patch (text/plain), 13.58 KB, created by
Kyle M Hall (khall)
on 2020-05-14 13:51:07 UTC
(
hide
)
Description:
Bug 25334: Add generic 'phone' message transport type
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-05-14 13:51:07 UTC
Size:
13.58 KB
patch
obsolete
>From 9b739d089157dc73ac7008d03401bede3d783f4f Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 30 Apr 2020 13:35:48 -0400 >Subject: [PATCH] Bug 25334: Add generic 'phone' message transport type > >As bug 25333 changed the 'phone' transport type to 'talkingtech', we can >now re-add 'phone' as a transport type again, and allow it to behave and >support the same notices as the email transport type. > >Test Plan; >1) Apply this patch >2) Run updatedatabase >3) Restart all the things! >4) Disable TalkingTechItivaPhoneNotificationi if enabled >5) Enable new PhoneNotification system preference >6) Go to a patron's messaging preferences, not you can select the > 'phone' option for all the same notices as the 'email' option >7) Enable the phone option for all the message types >8) Browser to the Notices and slips editor >9) Add a phone notice version for each notice you wish to test >10) Test some notices ( CHECKIN, CHECKOUT, etc ) >11) Notices should show in the patron's messages as 'phone' notices >--- > C4/Reserves.pm | 1 + > .../data/mysql/atomicupdate/bug_25334.perl | 27 +++++++++++++++ > .../mandatory/message_transport_types.sql | 1 + > .../sample_notices_message_transports.sql | 15 +++++--- > installer/data/mysql/sysprefs.sql | 1 + > .../en/includes/messaging-preference-form.inc | 34 ++++++++++++++++++- > .../en/modules/admin/preferences/patrons.pref | 8 +++++ > .../prog/en/modules/tools/letter.tt | 9 ++--- > 8 files changed, 87 insertions(+), 9 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_25334.perl > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 0c2b9d6922..1147e9053f 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -1809,6 +1809,7 @@ sub _koha_notify_reserve { > ( $mtt eq 'email' and not $to_address ) # No email address > or ( $mtt eq 'sms' and not $patron->smsalertnumber ) # No SMS number > or ( $mtt eq 'itiva' and C4::Context->preference('TalkingTechItivaPhoneNotification') ) # Notice is handled by TalkingTech_itiva_outbound.pl >+ or ( $mtt eq 'phone' and not $patron->phone ) # No phone number to call > ); > > &$send_notification($mtt, $letter_code); >diff --git a/installer/data/mysql/atomicupdate/bug_25334.perl b/installer/data/mysql/atomicupdate/bug_25334.perl >new file mode 100644 >index 0000000000..1d4f96c7b3 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_25334.perl >@@ -0,0 +1,27 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >+ ('PhoneNotification','0',NULL,'If ON, enables generation of phone notifications to be sent by plugins','YesNo') >+ }); >+ >+ $dbh->do(q{ >+ INSERT INTO message_transport_types (message_transport_type) VALUES ('phone') >+ }); >+ >+ $dbh->do(q{ >+ INSERT IGNORE INTO `message_transports` >+ (`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`) >+ VALUES >+ (1, 'phone', 0, 'circulation', 'DUE'), >+ (1, 'phone', 1, 'circulation', 'DUEDGST'), >+ (2, 'phone', 0, 'circulation', 'PREDUE'), >+ (2, 'phone', 1, 'circulation', 'PREDUEDGST'), >+ (4, 'phone', 0, 'reserves', 'HOLD'), >+ (5, 'phone', 0, 'circulation', 'CHECKIN'), >+ (6, 'phone', 0, 'circulation', 'CHECKOUT'); >+ }); >+ >+ # Always end with this (adjust the bug info) >+ NewVersion( $DBversion, 12345, "Description"); >+} >diff --git a/installer/data/mysql/mandatory/message_transport_types.sql b/installer/data/mysql/mandatory/message_transport_types.sql >index 6ea2ff8aac..5f4e05be5b 100644 >--- a/installer/data/mysql/mandatory/message_transport_types.sql >+++ b/installer/data/mysql/mandatory/message_transport_types.sql >@@ -4,4 +4,5 @@ values > ('email'), > ('print'), > ('sms'), >+('phone'), > ('itiva'); >diff --git a/installer/data/mysql/mandatory/sample_notices_message_transports.sql b/installer/data/mysql/mandatory/sample_notices_message_transports.sql >index 268e963a28..5ce95ee5e5 100644 >--- a/installer/data/mysql/mandatory/sample_notices_message_transports.sql >+++ b/installer/data/mysql/mandatory/sample_notices_message_transports.sql >@@ -5,16 +5,23 @@ values > (1, 'email', 1, 'circulation', 'DUEDGST'), > (1, 'sms', 0, 'circulation', 'DUE'), > (1, 'sms', 1, 'circulation', 'DUEDGST'), >+(1, 'phone', 0, 'circulation', 'DUE'), >+(1, 'phone', 1, 'circulation', 'DUEDGST'), > (2, 'email', 0, 'circulation', 'PREDUE'), > (2, 'email', 1, 'circulation', 'PREDUEDGST'), > (2, 'sms', 0, 'circulation', 'PREDUE'), > (2, 'sms', 1, 'circulation', 'PREDUEDGST'), >-(2, 'itiva', 0, 'circulation', 'PREDUE'), >-(2, 'itiva', 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, 'itiva', 0, 'reserves', 'HOLD'), >+(4, 'phone', 0, 'reserves', 'HOLD'), >+(4, 'itiva', 0, 'reserves', 'HOLD'), > (5, 'email', 0, 'circulation', 'CHECKIN'), > (5, 'sms', 0, 'circulation', 'CHECKIN'), >+(5, 'phone', 0, 'circulation', 'CHECKIN'), > (6, 'email', 0, 'circulation', 'CHECKOUT'), >-(6, 'sms', 0, 'circulation', 'CHECKOUT'); >+(6, 'sms', 0, 'circulation', 'CHECKOUT'), >+(6, 'phone', 0, 'circulation', 'CHECKOUT'); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 58bd459e94..9ef29c12f2 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -506,6 +506,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('PayPalSandboxMode', '1', NULL , 'If enabled, the system will use PayPal''s sandbox server for testing, rather than the production server.', 'YesNo'), > ('PayPalSignature', '', NULL , 'Your PayPal API signature', 'Free'), > ('PayPalUser', '', NULL , 'Your PayPal API username ( email address )', 'Free'), >+('PhoneNotification','0',NULL,'If ON, enables generation of phone notifications to be sent by plugins','YesNo'), > ('PrefillGuaranteeField', 'phone,email,streetnumber,address,city,state,zipcode,country', NULL, 'Prefill these fields in guarantee member entry form from guarantor patron record', 'Multiple'), > ('PrefillItem','0','','When a new item is added, should it be prefilled with last created item values?','YesNo'), > ('PreserveSerialNotes','1','','When a new "Expected" issue is generated, should it be prefilled with last created issue notes?','YesNo'), >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 d6c74bf191..984e4f784c 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 >@@ -7,7 +7,7 @@ > <tr><th></th> > <th>Days in advance</th> > [% IF Koha.Preference('SMSSendDriver') %]<th>SMS</th>[% END %] >- [% IF Koha.Preference('TalkingTechItivaPhoneNotification') %]<th>Phone</th>[% END %] >+ [% IF Koha.Preference('TalkingTechItivaPhoneNotification') || Koha.Preference('PhoneNotification') %]<th>Phone</th>[% END %] > <th>Email</th> > <th>Digests only <i id="info_digests" data-toggle="tooltip" title="You can ask for a digest to reduce the number of messages. Messages will be saved and sent as a single message." data-placement="right" class="fa fa-info-circle"></i></th> > <!-- <th>RSS</th> --> >@@ -105,6 +105,38 @@ > [% ELSE %] > <td>-</td> > [% END %] >+ [% ELSIF Koha.Preference('PhoneNotification') %] >+ [% IF ( messaging_preference.transport_phone ) %] >+ <td> >+ [% IF ( messaging_form_inactive ) %] >+ [% IF ( messaging_preference.transports_phone ) %] >+ <input type="checkbox" >+ id="phone[% messaging_preference.message_attribute_id | html %]" >+ name="[% messaging_preference.message_attribute_id | html %]" >+ value="phone" checked="checked" disabled="disabled" /> >+ [% ELSE %] >+ <input type="checkbox" >+ id="phone[% messaging_preference.message_attribute_id | html %]" >+ name="[% messaging_preference.message_attribute_id | html %]" >+ value="phone" disabled="disabled" /> >+ [% END %] >+ [% ELSE %] >+ [% IF ( messaging_preference.transports_phone ) %] >+ <input type="checkbox" >+ id="phone[% 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 %]" /> >+ [% ELSE %] >+ <input type="checkbox" >+ id="phone[% 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 %]" /> >+ [% END %] >+ [% END %] >+ </td> >+ [% ELSE %] >+ <td>-</td> >+ [% END %] > [% END %] > > [% IF ( messaging_preference.transport_email ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >index 991de6668a..4db3329b10 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >@@ -149,6 +149,14 @@ Patrons: > yes: Enable > no: Disable > - patron phone notifications using Talking Tech i-tiva (overdues, predues and holds notices currently supported). >+ - <br/><i class="fa fa-exclamation-triangle"></i> If <code>TalkingTechItivaPhoneNotification</code> is enabled, <code>PhoneNotification</code> should be disabled. >+ - >+ - pref: PhoneNotification >+ choices: >+ yes: Enable >+ no: Disable >+ - patron phone notifications generation. A plugin will be required to process the phone notifications. >+ - <br/><i class="fa fa-exclamation-triangle"></i> If <code>PhoneNotification</code> is enabled, <code>TalkingTechItivaPhoneNotification</code> should be disabled. > - > - "Use the SMS::Send::" > - pref: SMSSendDriver >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 8ba22497ef..c2a05dde24 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt >@@ -391,6 +391,8 @@ > <div class="transport-types" style="clear:both"> > [% FOR mtt IN letters.$lang.templates.keys.sort %] > [% SET letter = letters.$lang.templates.$mtt %] >+ [% NEXT IF letter.message_transport_type == "talkingtech" && !Koha.Preference('TalkingTechItivaPhoneNotification') %] >+ [% NEXT IF letter.message_transport_type == "phone" && !Koha.Preference('PhoneNotification') %] > <h3> > [% SWITCH letter.message_transport_type %] > [% CASE 'email' %] >@@ -402,7 +404,9 @@ > [% CASE 'feed' %] > Feed > [% CASE 'itiva' %] >- Phone >+ Phone ( Itiva ) >+ [% CASE 'phone' %] >+ Phone > [% CASE %] > [% letter.message_transport_type | html %] > [% END %] >@@ -410,9 +414,6 @@ > [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %] > <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled"> > <div class="dialog message">You should enable the SMSSendDriver preference to use the SMS templates.</div> >- [% ELSIF letter.message_transport_type == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %] >- <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled"> >- <div class="dialog message">You should enable the TalkingTechItivaPhoneNotification preference to use the phone templates.</div> > [% ELSE %] > <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]"> > [% END %] >-- >2.24.2 (Apple Git-127)
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 25334
:
104050
|
104076
|
104885
|
104886
|
112101
|
112119
|
112137
|
112946
|
112947
|
112948
|
113059
|
113060
|
113103
|
113104
|
113105
|
113106
|
113107