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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc (-1 / +1 lines)
Lines 191-197 Link Here
191
      [% END %] -->
191
      [% END %] -->
192
192
193
      [% UNLESS ( messaging_form_inactive ) %]
193
      [% UNLESS ( messaging_form_inactive ) %]
194
      <td><input type="checkbox" class="none" id="none[% messaging_preference.message_attribute_id | html %]" /></td>
194
      <td><a href="#memberentry_messaging_prefs" class="clear_pref" id="clear_[% messaging_preference.message_attribute_id | html %]">Clear</a></td>
195
      [% END %]
195
      [% END %]
196
    </tr>
196
    </tr>
197
    [% END %]
197
    [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js (-12 / +2 lines)
Lines 1-20 Link Here
1
$(document).ready(function(){
1
$(document).ready(function(){
2
    $(".none").click(function(){
2
    $(".clear_pref").click(function(){
3
        if($(this).prop("checked")){
4
            var rowid = $(this).attr("id");
3
            var rowid = $(this).attr("id");
5
            var newid = Number(rowid.replace("none",""));
4
            var newid = Number(rowid.replace("clear_",""));
6
            $("#sms"+newid).prop("checked", false);
5
            $("#sms"+newid).prop("checked", false);
7
            $("#email"+newid).prop("checked", false);
6
            $("#email"+newid).prop("checked", false);
8
            $("#phone"+newid).prop("checked", false);
7
            $("#phone"+newid).prop("checked", false);
9
            $("#digest"+newid).prop("checked", false);
8
            $("#digest"+newid).prop("checked", false);
10
            $("#rss"+newid).prop("checked", false);
9
            $("#rss"+newid).prop("checked", false);
11
        }
12
    });
13
    $(".active_notify").on("change",function(){
14
        var attr_id = $(this).data("attr-id");
15
        if( $(this).prop("checked") ){
16
            $("#none" + attr_id ).prop("checked", false);
17
        }
18
    });
10
    });
19
    $("#info_digests").tooltip();
11
    $("#info_digests").tooltip();
20
12
Lines 36-42 $(document).ready(function(){ Link Here
36
                    return;
28
                    return;
37
                }
29
                }
38
            }
30
            }
39
            $(".none").prop("checked", false); // When loading default prefs the "Clear" boxes should be cleared
40
            var jqxhr = $.getJSON('/cgi-bin/koha/members/default_messageprefs.pl?categorycode=' + categorycode, function(data) {
31
            var jqxhr = $.getJSON('/cgi-bin/koha/members/default_messageprefs.pl?categorycode=' + categorycode, function(data) {
41
                $.each(data.messaging_preferences, function(i, item) {
32
                $.each(data.messaging_preferences, function(i, item) {
42
                    var attrid = item.message_attribute_id;
33
                    var attrid = item.message_attribute_id;
43
- 

Return to bug 22744