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 105-116 Link Here
105
                 <input type="checkbox"
109
                 <input type="checkbox"
106
                 id="itiva[% messaging_preference.message_attribute_id | html %]"
110
                 id="itiva[% messaging_preference.message_attribute_id | html %]"
107
                 name="[% messaging_preference.message_attribute_id | html %]"
111
                 name="[% messaging_preference.message_attribute_id | html %]"
108
                 value="itiva" checked="checked" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
112
                 value="itiva" checked="checked" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
109
              [% ELSE %]
113
              [% ELSE %]
110
                 <input type="checkbox"
114
                 <input type="checkbox"
111
                 id="itiva[% messaging_preference.message_attribute_id | html %]"
115
                 id="itiva[% messaging_preference.message_attribute_id | html %]"
112
                 name="[% messaging_preference.message_attribute_id | html %]"
116
                 name="[% messaging_preference.message_attribute_id | html %]"
113
                 value="itiva" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
117
                 value="itiva" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
114
              [% END %]
118
              [% END %]
115
          [% END %]
119
          [% END %]
116
          </td>
120
          </td>
Lines 137-148 Link Here
137
                 <input type="checkbox"
141
                 <input type="checkbox"
138
                 id="phone[% messaging_preference.message_attribute_id | html %]"
142
                 id="phone[% messaging_preference.message_attribute_id | html %]"
139
                 name="[% messaging_preference.message_attribute_id | html %]"
143
                 name="[% messaging_preference.message_attribute_id | html %]"
140
                 value="phone" checked="checked" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
144
                 value="phone" checked="checked" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
141
              [% ELSE %]
145
              [% ELSE %]
142
                 <input type="checkbox"
146
                 <input type="checkbox"
143
                 id="phone[% messaging_preference.message_attribute_id | html %]"
147
                 id="phone[% messaging_preference.message_attribute_id | html %]"
144
                 name="[% messaging_preference.message_attribute_id | html %]"
148
                 name="[% messaging_preference.message_attribute_id | html %]"
145
                 value="phone" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
149
                 value="phone" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
146
              [% END %]
150
              [% END %]
147
          [% END %]
151
          [% END %]
148
          </td>
152
          </td>
(-)a/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js (-2 / +7 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
        console.log("TEST: " + PhoneNotification );
59
        let phone_checked = TalkingTechItivaPhoneNotification ? false : PhoneNotification ? $("#phone"+id).prop("checked") : false;
60
        console.log("PHONE: " + phone_checked );
61
        if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") || phone_checked ) {
59
            $("#digest"+id).attr("disabled", false).tooltip('disable');
62
            $("#digest"+id).attr("disabled", false).tooltip('disable');
60
        } else {
63
        } else {
61
            $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
64
            $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
Lines 74-79 $(document).ready(function(){ Link Here
74
    $(".pmp_sms").click(function(){
77
    $(".pmp_sms").click(function(){
75
        toggle_digest(Number($(this).attr("id").replace("sms", "")));
78
        toggle_digest(Number($(this).attr("id").replace("sms", "")));
76
    });
79
    });
80
    $(".pmp_phone").click(function(){
81
        toggle_digest(Number($(this).attr("id").replace("phone", "")));
82
    });
77
83
78
//    $('#memberentry_messaging_prefs [data-toggle="tooltip"][disabled]').tooltip();
84
//    $('#memberentry_messaging_prefs [data-toggle="tooltip"][disabled]').tooltip();
79
});
85
});
80
- 

Return to bug 31166