@@ -, +, @@ 'phone' option for all the same notices as the 'email' option --- 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/mandatory/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 --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -1842,6 +1842,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); --- a/installer/data/mysql/atomicupdate/bug_25334.perl +++ a/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, 25334, "Add generic 'phone' message transport type"); +} --- a/installer/data/mysql/mandatory/message_transport_types.sql +++ a/installer/data/mysql/mandatory/message_transport_types.sql @@ -4,4 +4,5 @@ values ('email'), ('print'), ('sms'), +('phone'), ('itiva'); --- a/installer/data/mysql/mandatory/sample_notices_message_transports.sql +++ a/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'); --- a/installer/data/mysql/mandatory/sysprefs.sql +++ a/installer/data/mysql/mandatory/sysprefs.sql @@ -516,6 +516,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'), --- a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc @@ -7,7 +7,7 @@ Days in advance [% IF Koha.Preference('SMSSendDriver') %]SMS[% END %] - [% IF Koha.Preference('TalkingTechItivaPhoneNotification') %]Phone[% END %] + [% IF Koha.Preference('TalkingTechItivaPhoneNotification') || Koha.Preference('PhoneNotification') %]Phone[% END %] Email Digests only @@ -110,6 +110,38 @@ [% ELSE %] - [% END %] + [% ELSIF Koha.Preference('PhoneNotification') %] + [% IF ( messaging_preference.transport_phone ) %] + + [% IF ( messaging_form_inactive ) %] + [% IF ( messaging_preference.transports_phone ) %] + + [% ELSE %] + + [% END %] + [% ELSE %] + [% IF ( messaging_preference.transports_phone ) %] + + [% ELSE %] + + [% END %] + [% END %] + + [% ELSE %] + - + [% END %] [% END %] [% IF ( messaging_preference.transport_email ) %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -158,6 +158,14 @@ Patrons: yes: Enable no: Disable - patron phone notifications using Talking Tech i-tiva (overdues, predues and holds notices currently supported). + -
If TalkingTechItivaPhoneNotification is enabled, PhoneNotification should be disabled. + - + - pref: PhoneNotification + choices: + yes: Enable + no: Disable + - patron phone notifications generation. A plugin will be required to process the phone notifications. + -
If PhoneNotification is enabled, TalkingTechItivaPhoneNotification should be disabled. - - "Use the SMS::Send::" - pref: SMSSendDriver --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt @@ -394,6 +394,8 @@
[% 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') %]

[% SWITCH letter.message_transport_type %] [% CASE 'email' %] @@ -405,7 +407,9 @@ [% CASE 'feed' %] Feed [% CASE 'itiva' %] - Phone + Phone ( Itiva ) + [% CASE 'phone' %] + Phone [% CASE %] [% letter.message_transport_type | html %] [% END %] @@ -413,9 +417,6 @@ [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
You should enable the SMSSendDriver preference to use the SMS templates.
- [% ELSIF letter.message_transport_type == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %] -
-
You should enable the TalkingTechItivaPhoneNotification preference to use the phone templates.
[% ELSE %]
[% END %] --