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 103-114 Link Here
103
                 <input type="checkbox"
107
                 <input type="checkbox"
104
                 id="itiva[% messaging_preference.message_attribute_id | html %]"
108
                 id="itiva[% messaging_preference.message_attribute_id | html %]"
105
                 name="[% messaging_preference.message_attribute_id | html %]"
109
                 name="[% messaging_preference.message_attribute_id | html %]"
106
                 value="itiva" checked="checked" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
110
                 value="itiva" checked="checked" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
107
              [% ELSE %]
111
              [% ELSE %]
108
                 <input type="checkbox"
112
                 <input type="checkbox"
109
                 id="itiva[% messaging_preference.message_attribute_id | html %]"
113
                 id="itiva[% messaging_preference.message_attribute_id | html %]"
110
                 name="[% messaging_preference.message_attribute_id | html %]"
114
                 name="[% messaging_preference.message_attribute_id | html %]"
111
                 value="itiva" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
115
                 value="itiva" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
112
              [% END %]
116
              [% END %]
113
          [% END %]
117
          [% END %]
114
          </td>
118
          </td>
Lines 135-146 Link Here
135
                 <input type="checkbox"
139
                 <input type="checkbox"
136
                 id="phone[% messaging_preference.message_attribute_id | html %]"
140
                 id="phone[% messaging_preference.message_attribute_id | html %]"
137
                 name="[% messaging_preference.message_attribute_id | html %]"
141
                 name="[% messaging_preference.message_attribute_id | html %]"
138
                 value="phone" checked="checked" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
142
                 value="phone" checked="checked" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
139
              [% ELSE %]
143
              [% ELSE %]
140
                 <input type="checkbox"
144
                 <input type="checkbox"
141
                 id="phone[% messaging_preference.message_attribute_id | html %]"
145
                 id="phone[% messaging_preference.message_attribute_id | html %]"
142
                 name="[% messaging_preference.message_attribute_id | html %]"
146
                 name="[% messaging_preference.message_attribute_id | html %]"
143
                 value="phone" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
147
                 value="phone" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
144
              [% END %]
148
              [% END %]
145
          [% END %]
149
          [% END %]
146
          </td>
150
          </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