View | Details | Raw Unified | Return to bug 25334
Collapse All | Expand All

(-)a/C4/Reserves.pm (+1 lines)
Lines 1809-1814 sub _koha_notify_reserve { Link Here
1809
               ( $mtt eq 'email' and not $to_address ) # No email address
1809
               ( $mtt eq 'email' and not $to_address ) # No email address
1810
            or ( $mtt eq 'sms'   and not $patron->smsalertnumber ) # No SMS number
1810
            or ( $mtt eq 'sms'   and not $patron->smsalertnumber ) # No SMS number
1811
            or ( $mtt eq 'itiva' and C4::Context->preference('TalkingTechItivaPhoneNotification') ) # Notice is handled by TalkingTech_itiva_outbound.pl
1811
            or ( $mtt eq 'itiva' and C4::Context->preference('TalkingTechItivaPhoneNotification') ) # Notice is handled by TalkingTech_itiva_outbound.pl
1812
            or ( $mtt eq 'phone' and not $patron->phone ) # No phone number to call
1812
        );
1813
        );
1813
1814
1814
        &$send_notification($mtt, $letter_code);
1815
        &$send_notification($mtt, $letter_code);
(-)a/installer/data/mysql/atomicupdate/bug_25334.perl (+27 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{
4
        INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
5
        ('PhoneNotification','0',NULL,'If ON, enables generation of phone notifications to be sent by plugins','YesNo')
6
    });
7
8
    $dbh->do(q{
9
        INSERT INTO message_transport_types (message_transport_type) VALUES ('phone')
10
    });
11
12
    $dbh->do(q{
13
        INSERT IGNORE INTO `message_transports`
14
        (`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`)
15
        VALUES
16
        (1, 'phone',       0, 'circulation', 'DUE'),
17
        (1, 'phone',       1, 'circulation', 'DUEDGST'),
18
        (2, 'phone',       0, 'circulation', 'PREDUE'),
19
        (2, 'phone',       1, 'circulation', 'PREDUEDGST'),
20
        (4, 'phone',       0, 'reserves',    'HOLD'),
21
        (5, 'phone',       0, 'circulation', 'CHECKIN'),
22
        (6, 'phone',       0, 'circulation', 'CHECKOUT');
23
    });
24
25
    # Always end with this (adjust the bug info)
26
    NewVersion( $DBversion, 25334, "Add generic 'phone' message transport type");
27
}
(-)a/installer/data/mysql/mandatory/message_transport_types.sql (+1 lines)
Lines 4-7 values Link Here
4
('email'),
4
('email'),
5
('print'),
5
('print'),
6
('sms'),
6
('sms'),
7
('phone'),
7
('itiva');
8
('itiva');
(-)a/installer/data/mysql/mandatory/sample_notices_message_transports.sql (-4 / +11 lines)
Lines 5-20 values Link Here
5
(1, 'email',       1, 'circulation', 'DUEDGST'),
5
(1, 'email',       1, 'circulation', 'DUEDGST'),
6
(1, 'sms',         0, 'circulation', 'DUE'),
6
(1, 'sms',         0, 'circulation', 'DUE'),
7
(1, 'sms',         1, 'circulation', 'DUEDGST'),
7
(1, 'sms',         1, 'circulation', 'DUEDGST'),
8
(1, 'phone',       0, 'circulation', 'DUE'),
9
(1, 'phone',       1, 'circulation', 'DUEDGST'),
8
(2, 'email',       0, 'circulation', 'PREDUE'),
10
(2, 'email',       0, 'circulation', 'PREDUE'),
9
(2, 'email',       1, 'circulation', 'PREDUEDGST'),
11
(2, 'email',       1, 'circulation', 'PREDUEDGST'),
10
(2, 'sms',         0, 'circulation', 'PREDUE'),
12
(2, 'sms',         0, 'circulation', 'PREDUE'),
11
(2, 'sms',         1, 'circulation', 'PREDUEDGST'),
13
(2, 'sms',         1, 'circulation', 'PREDUEDGST'),
12
(2, 'itiva', 0, 'circulation', 'PREDUE'),
14
(2, 'phone',       0, 'circulation', 'PREDUE'),
13
(2, 'itiva', 1, 'circulation', 'PREDUEDGST'),
15
(2, 'phone',       1, 'circulation', 'PREDUEDGST'),
16
(2, 'itiva',       0, 'circulation', 'PREDUE'),
17
(2, 'itiva',       1, 'circulation', 'PREDUEDGST'),
14
(4, 'email',       0, 'reserves',    'HOLD'),
18
(4, 'email',       0, 'reserves',    'HOLD'),
15
(4, 'sms',         0, 'reserves',    'HOLD'),
19
(4, 'sms',         0, 'reserves',    'HOLD'),
16
(4, 'itiva', 0, 'reserves',    'HOLD'),
20
(4, 'phone',       0, 'reserves',    'HOLD'),
21
(4, 'itiva',       0, 'reserves',    'HOLD'),
17
(5, 'email',       0, 'circulation', 'CHECKIN'),
22
(5, 'email',       0, 'circulation', 'CHECKIN'),
18
(5, 'sms',         0, 'circulation', 'CHECKIN'),
23
(5, 'sms',         0, 'circulation', 'CHECKIN'),
24
(5, 'phone',       0, 'circulation', 'CHECKIN'),
19
(6, 'email',       0, 'circulation', 'CHECKOUT'),
25
(6, 'email',       0, 'circulation', 'CHECKOUT'),
20
(6, 'sms',         0, 'circulation', 'CHECKOUT');
26
(6, 'sms',         0, 'circulation', 'CHECKOUT'),
27
(6, 'phone',       0, 'circulation', 'CHECKOUT');
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 506-511 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
506
('PayPalSandboxMode',  '1', NULL ,  'If enabled, the system will use PayPal''s sandbox server for testing, rather than the production server.',  'YesNo'),
506
('PayPalSandboxMode',  '1', NULL ,  'If enabled, the system will use PayPal''s sandbox server for testing, rather than the production server.',  'YesNo'),
507
('PayPalSignature',  '', NULL ,  'Your PayPal API signature',  'Free'),
507
('PayPalSignature',  '', NULL ,  'Your PayPal API signature',  'Free'),
508
('PayPalUser',  '', NULL ,  'Your PayPal API username ( email address )',  'Free'),
508
('PayPalUser',  '', NULL ,  'Your PayPal API username ( email address )',  'Free'),
509
('PhoneNotification','0',NULL,'If ON, enables generation of phone notifications to be sent by plugins','YesNo'),
509
('PrefillGuaranteeField', 'phone,email,streetnumber,address,city,state,zipcode,country', NULL, 'Prefill these fields in guarantee member entry form from guarantor patron record', 'Multiple'),
510
('PrefillGuaranteeField', 'phone,email,streetnumber,address,city,state,zipcode,country', NULL, 'Prefill these fields in guarantee member entry form from guarantor patron record', 'Multiple'),
510
('PrefillItem','0','','When a new item is added, should it be prefilled with last created item values?','YesNo'),
511
('PrefillItem','0','','When a new item is added, should it be prefilled with last created item values?','YesNo'),
511
('PreserveSerialNotes','1','','When a new "Expected" issue is generated, should it be prefilled with last created issue notes?','YesNo'),
512
('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 (-1 / +33 lines)
Lines 7-13 Link Here
7
    <tr><th></th>
7
    <tr><th></th>
8
        <th>Days in advance</th>
8
        <th>Days in advance</th>
9
        [% IF Koha.Preference('SMSSendDriver') %]<th>SMS</th>[% END %]
9
        [% IF Koha.Preference('SMSSendDriver') %]<th>SMS</th>[% END %]
10
        [% IF Koha.Preference('TalkingTechItivaPhoneNotification') %]<th>Phone</th>[% END %]
10
        [% IF Koha.Preference('TalkingTechItivaPhoneNotification') || Koha.Preference('PhoneNotification') %]<th>Phone</th>[% END %]
11
        <th>Email</th>
11
        <th>Email</th>
12
        <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>
12
        <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>
13
        <!-- <th>RSS</th> -->
13
        <!-- <th>RSS</th> -->
Lines 105-110 Link Here
105
        [% ELSE %]
105
        [% ELSE %]
106
          <td>-</td>
106
          <td>-</td>
107
        [% END %]
107
        [% END %]
108
      [% ELSIF Koha.Preference('PhoneNotification') %]
109
        [% IF ( messaging_preference.transport_phone ) %]
110
          <td>
111
          [% IF ( messaging_form_inactive ) %]
112
              [% IF ( messaging_preference.transports_phone ) %]
113
                 <input type="checkbox"
114
                 id="phone[% messaging_preference.message_attribute_id | html %]"
115
                 name="[% messaging_preference.message_attribute_id | html %]"
116
                 value="phone" checked="checked" disabled="disabled" />
117
              [% ELSE %]
118
                 <input type="checkbox"
119
                 id="phone[% messaging_preference.message_attribute_id | html %]"
120
                 name="[% messaging_preference.message_attribute_id | html %]"
121
                 value="phone" disabled="disabled" />
122
              [% END %]
123
          [% ELSE %]
124
              [% IF ( messaging_preference.transports_phone ) %]
125
                 <input type="checkbox"
126
                 id="phone[% messaging_preference.message_attribute_id | html %]"
127
                 name="[% messaging_preference.message_attribute_id | html %]"
128
                 value="phone" checked="checked" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
129
              [% ELSE %]
130
                 <input type="checkbox"
131
                 id="phone[% messaging_preference.message_attribute_id | html %]"
132
                 name="[% messaging_preference.message_attribute_id | html %]"
133
                 value="phone" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
134
              [% END %]
135
          [% END %]
136
          </td>
137
        [% ELSE %]
138
          <td>-</td>
139
        [% END %]
108
      [% END %]
140
      [% END %]
109
141
110
      [% IF ( messaging_preference.transport_email ) %]
142
      [% IF ( messaging_preference.transport_email ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (+8 lines)
Lines 149-154 Patrons: Link Here
149
               yes: Enable
149
               yes: Enable
150
               no: Disable
150
               no: Disable
151
         - patron phone notifications using Talking Tech i-tiva (overdues, predues and holds notices currently supported).
151
         - patron phone notifications using Talking Tech i-tiva (overdues, predues and holds notices currently supported).
152
         - <br/><i class="fa fa-exclamation-triangle"></i> If <code>TalkingTechItivaPhoneNotification</code> is enabled, <code>PhoneNotification</code> should be disabled.
153
     -
154
         - pref: PhoneNotification
155
           choices:
156
               yes: Enable
157
               no: Disable
158
         - patron phone notifications generation. A plugin will be required to process the phone notifications.
159
         - <br/><i class="fa fa-exclamation-triangle"></i> If <code>PhoneNotification</code> is enabled, <code>TalkingTechItivaPhoneNotification</code> should be disabled.
152
     -
160
     -
153
         - "Use the SMS::Send::"
161
         - "Use the SMS::Send::"
154
         - pref: SMSSendDriver
162
         - pref: SMSSendDriver
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt (-5 / +5 lines)
Lines 391-396 Link Here
391
                            <div class="transport-types" style="clear:both">
391
                            <div class="transport-types" style="clear:both">
392
                                [% FOR mtt IN letters.$lang.templates.keys.sort %]
392
                                [% FOR mtt IN letters.$lang.templates.keys.sort %]
393
                                    [% SET letter = letters.$lang.templates.$mtt %]
393
                                    [% SET letter = letters.$lang.templates.$mtt %]
394
                                    [% NEXT IF letter.message_transport_type == "talkingtech" && !Koha.Preference('TalkingTechItivaPhoneNotification') %]
395
                                    [% NEXT IF letter.message_transport_type == "phone" && !Koha.Preference('PhoneNotification') %]
394
                                    <h3>
396
                                    <h3>
395
                                        [% SWITCH letter.message_transport_type %]
397
                                        [% SWITCH letter.message_transport_type %]
396
                                            [% CASE 'email' %]
398
                                            [% CASE 'email' %]
Lines 402-408 Link Here
402
                                            [% CASE 'feed' %]
404
                                            [% CASE 'feed' %]
403
                                              Feed
405
                                              Feed
404
                                            [% CASE 'itiva' %]
406
                                            [% CASE 'itiva' %]
405
                                              Phone
407
                                              Phone ( Itiva )
408
                                            [% CASE 'phone' %]
409
                                                Phone
406
                                            [% CASE %]
410
                                            [% CASE %]
407
                                              [% letter.message_transport_type | html %]
411
                                              [% letter.message_transport_type | html %]
408
                                        [% END %]
412
                                        [% END %]
Lines 410-418 Link Here
410
                                    [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
414
                                    [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
411
                                        <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled">
415
                                        <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled">
412
                                            <div class="dialog message">You should enable the SMSSendDriver preference to use the SMS templates.</div>
416
                                            <div class="dialog message">You should enable the SMSSendDriver preference to use the SMS templates.</div>
413
                                    [% ELSIF letter.message_transport_type == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %]
414
                                        <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]" disabled="disabled">
415
                                            <div class="dialog message">You should enable the TalkingTechItivaPhoneNotification preference to use the phone templates.</div>
416
                                    [% ELSE %]
417
                                    [% ELSE %]
417
                                        <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]">
418
                                        <fieldset class="rows mtt" id="[% letter.message_transport_type | html %]_[% lang | html %]">
418
                                    [% END %]
419
                                    [% END %]
419
- 

Return to bug 25334