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

(-)a/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js (-18 / +8 lines)
Lines 48-82 $(document).ready(function(){ Link Here
48
        });
48
        });
49
    }
49
    }
50
50
51
    // At load time, we want digest disabled if no digest using transport is enabled
51
    function toggle_digest(id){
52
    $(".pmp_email").each(function(){
53
        var rowid = $(this).attr("id");
54
        id = Number(rowid.replace("email",""));
55
        if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") ) {
52
        if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") ) {
56
            $("#digest"+id).attr("disabled", false).tooltip('disable');
53
            $("#digest"+id).attr("disabled", false).tooltip('disable');
57
        } else {
54
        } else {
58
            $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
55
            $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
59
        }
56
        }
57
58
    }
59
    // At load time, we want digest disabled if no digest using transport is enabled
60
    $(".pmp_email").each(function(){
61
        toggle_digest(Number($(this).attr("id").replace("email", "")));
60
    });
62
    });
61
63
62
    // If user clears all digest using transports for a notice, disable digest checkbox
64
    // If user clears all digest using transports for a notice, disable digest checkbox
63
    $(".pmp_email").click(function(){
65
    $(".pmp_email").click(function(){
64
        var rowid = $(this).attr("id");
66
        toggle_digest(Number($(this).attr("id").replace("email", "")));
65
        id = Number(rowid.replace("email",""));
66
        if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") ) {
67
            $("#digest"+id).attr("disabled", false).tooltip('disable');
68
        } else {
69
            $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
70
        }
71
    });
67
    });
72
    $(".pmp_sms").click(function(){
68
    $(".pmp_sms").click(function(){
73
        var rowid = $(this).attr("id");
69
        toggle_digest(Number($(this).attr("id").replace("sms", "")));
74
        id = Number(rowid.replace("sms",""));
75
        if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") ) {
76
            $("#digest"+id).attr("disabled", false).tooltip('disable');
77
        } else {
78
            $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
79
        }
80
    });
70
    });
81
71
82
//    $('#memberentry_messaging_prefs [data-toggle="tooltip"][disabled]').tooltip();
72
//    $('#memberentry_messaging_prefs [data-toggle="tooltip"][disabled]').tooltip();
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt (-20 / +10 lines)
Lines 250-285 Link Here
250
        $(document).ready(function(){
250
        $(document).ready(function(){
251
            $("#info_digests").tooltip();
251
            $("#info_digests").tooltip();
252
252
253
            // At load time, we want digest disabled if no digest using transport is enabled
253
            function toggle_digest(id){
254
            $(".pmp_email").each(function(){
255
                var rowid = $(this).attr("id");
256
                id = Number(rowid.replace("email",""));
257
                if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") ) {
254
                if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") ) {
258
                    $("#digest"+id).attr("disabled", false).tooltip('disable');
255
                    $("#digest"+id).attr("disabled", false).tooltip('disable');
259
                } else {
256
                } else {
260
                    $("#digest"+id).attr("disabled", true).tooltip('enable');
257
                    $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
261
                }
258
                }
259
260
            }
261
            // At load time, we want digest disabled if no digest using transport is enabled
262
            $(".pmp_email").each(function(){
263
                toggle_digest(Number($(this).attr("id").replace("email", "")));
262
            });
264
            });
263
265
264
            // If user clears all digest using transports for a notice, disable digest checkbox
266
            // If user clears all digest using transports for a notice, disable digest checkbox
265
            $(".pmp_email").click(function(){
267
            $(".pmp_email").click(function(){
266
                var rowid = $(this).attr("id");
268
                toggle_digest(Number($(this).attr("id").replace("email", "")));
267
                id = Number(rowid.replace("email",""));
268
                if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") ) {
269
                    $("#digest"+id).attr("disabled", false).tooltip('disable');
270
                } else {
271
                    $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
272
                }
273
            });
269
            });
274
            $(".pmp_sms").click(function(){
270
            $(".pmp_sms").click(function(){
275
                var rowid = $(this).attr("id");
271
                toggle_digest(Number($(this).attr("id").replace("sms", "")));
276
                id = Number(rowid.replace("sms",""));
277
                if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") ) {
278
                    $("#digest"+id).attr("disabled", false).tooltip('disable');
279
                } else {
280
                    $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
281
                }
282
            });
272
            });
273
283
        });
274
        });
284
275
285
        function normalizeSMS(value){
276
        function normalizeSMS(value){
286
- 

Return to bug 13613