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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc (-4 / +8 lines)
Lines 1-6 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
<!-- snippet for form to set borrower and patron category messaging preferences -->
2
<!-- snippet for form to set borrower and patron category messaging preferences -->
3
3
4
<script>
5
    var TalkingTechItivaPhoneNotification = [% Koha.Preference('TalkingTechItivaPhoneNotification') || 0 | html %];
6
    var PhoneNotification = [% Koha.Preference('PhoneNotification') || 0 | html %];
7
</script>
4
<input type="hidden" name="modify" value="yes" />
8
<input type="hidden" name="modify" value="yes" />
5
<input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
9
<input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
6
  <table>
10
  <table>
Lines 109-120 Link Here
109
                 <input type="checkbox"
113
                 <input type="checkbox"
110
                 id="itiva[% messaging_preference.message_attribute_id | html %]"
114
                 id="itiva[% messaging_preference.message_attribute_id | html %]"
111
                 name="[% messaging_preference.message_attribute_id | html %]"
115
                 name="[% messaging_preference.message_attribute_id | html %]"
112
                 value="itiva" checked="checked" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
116
                 value="itiva" checked="checked" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
113
              [% ELSE %]
117
              [% ELSE %]
114
                 <input type="checkbox"
118
                 <input type="checkbox"
115
                 id="itiva[% messaging_preference.message_attribute_id | html %]"
119
                 id="itiva[% messaging_preference.message_attribute_id | html %]"
116
                 name="[% messaging_preference.message_attribute_id | html %]"
120
                 name="[% messaging_preference.message_attribute_id | html %]"
117
                 value="itiva" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
121
                 value="itiva" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
118
              [% END %]
122
              [% END %]
119
          [% END %]
123
          [% END %]
120
          </td>
124
          </td>
Lines 141-152 Link Here
141
                 <input type="checkbox"
145
                 <input type="checkbox"
142
                 id="phone[% messaging_preference.message_attribute_id | html %]"
146
                 id="phone[% messaging_preference.message_attribute_id | html %]"
143
                 name="[% messaging_preference.message_attribute_id | html %]"
147
                 name="[% messaging_preference.message_attribute_id | html %]"
144
                 value="phone" checked="checked" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
148
                 value="phone" checked="checked" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
145
              [% ELSE %]
149
              [% ELSE %]
146
                 <input type="checkbox"
150
                 <input type="checkbox"
147
                 id="phone[% messaging_preference.message_attribute_id | html %]"
151
                 id="phone[% messaging_preference.message_attribute_id | html %]"
148
                 name="[% messaging_preference.message_attribute_id | html %]"
152
                 name="[% messaging_preference.message_attribute_id | html %]"
149
                 value="phone" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
153
                 value="phone" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
150
              [% END %]
154
              [% END %]
151
          [% END %]
155
          [% END %]
152
          </td>
156
          </td>
(-)a/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js (-1 / +5 lines)
Lines 55-61 $(document).ready(function(){ Link Here
55
    }
55
    }
56
56
57
    function toggle_digest(id){
57
    function toggle_digest(id){
58
        if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") ) {
58
        let phone_checked = TalkingTechItivaPhoneNotification ? false : PhoneNotification ? $("#phone"+id).prop("checked") : false;
59
        if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") || phone_checked ) {
59
            $("#digest"+id).attr("disabled", false).tooltip('disable');
60
            $("#digest"+id).attr("disabled", false).tooltip('disable');
60
        } else {
61
        } else {
61
            $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
62
            $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
Lines 74-79 $(document).ready(function(){ Link Here
74
    $(".pmp_sms").click(function(){
75
    $(".pmp_sms").click(function(){
75
        toggle_digest(Number($(this).attr("id").replace("sms", "")));
76
        toggle_digest(Number($(this).attr("id").replace("sms", "")));
76
    });
77
    });
78
    $(".pmp_phone").click(function(){
79
        toggle_digest(Number($(this).attr("id").replace("phone", "")));
80
    });
77
81
78
//    $('#memberentry_messaging_prefs [data-toggle="tooltip"][disabled]').tooltip();
82
//    $('#memberentry_messaging_prefs [data-toggle="tooltip"][disabled]').tooltip();
79
});
83
});
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt (-4 / +10 lines)
Lines 110-122 Link Here
110
                                                    <td class="selectcol">
110
                                                    <td class="selectcol">
111
                                                        [% IF ( messaging_preference.transports_phone ) %]
111
                                                        [% IF ( messaging_preference.transports_phone ) %]
112
                                                            <input type="checkbox"
112
                                                            <input type="checkbox"
113
                                                                   class="phone"
113
                                                                   class="pmp_phone"
114
                                                                   id="phone[% messaging_preference.message_attribute_id | html %]"
114
                                                                   id="phone[% messaging_preference.message_attribute_id | html %]"
115
                                                                   name="[% messaging_preference.message_attribute_id | html %]"
115
                                                                   name="[% messaging_preference.message_attribute_id | html %]"
116
                                                                   value="phone" checked="checked" />
116
                                                                   value="phone" checked="checked" />
117
                                                        [% ELSE %]
117
                                                        [% ELSE %]
118
                                                            <input type="checkbox"
118
                                                            <input type="checkbox"
119
                                                                   class="phone"
119
                                                                   class="pmp_phone"
120
                                                                   id="phone[% messaging_preference.message_attribute_id | html %]"
120
                                                                   id="phone[% messaging_preference.message_attribute_id | html %]"
121
                                                                   name="[% messaging_preference.message_attribute_id | html %]"
121
                                                                   name="[% messaging_preference.message_attribute_id | html %]"
122
                                                                   value="phone" />
122
                                                                   value="phone" />
Lines 259-265 Link Here
259
            $("#info_digests").tooltip();
259
            $("#info_digests").tooltip();
260
260
261
            function toggle_digest(id){
261
            function toggle_digest(id){
262
                if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") ) {
262
                let PhoneNotification = [% Koha.Preference('PhoneNotification') || 0 | html %];
263
                let TalkingTechItivaPhoneNotification = [% Koha.Preference('TalkingTechItivaPhoneNotification') || 0 | html %];
264
                let phone_checked = TalkingTechItivaPhoneNotification ? false : PhoneNotification ? $("#phone"+id).prop("checked") : false;
265
266
                if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") || phone_checked ) {
263
                    $("#digest"+id).attr("disabled", false).tooltip('disable');
267
                    $("#digest"+id).attr("disabled", false).tooltip('disable');
264
                } else {
268
                } else {
265
                    $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
269
                    $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
Lines 278-283 Link Here
278
            $(".pmp_sms").click(function(){
282
            $(".pmp_sms").click(function(){
279
                toggle_digest(Number($(this).attr("id").replace("sms", "")));
283
                toggle_digest(Number($(this).attr("id").replace("sms", "")));
280
            });
284
            });
285
            $(".pmp_phone").click(function(){
286
                toggle_digest(Number($(this).attr("id").replace("phone", "")));
287
            });
281
288
282
        });
289
        });
283
290
284
- 

Return to bug 31166