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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt (-2 / +19 lines)
Lines 19-26 Link Here
19
        $(".delete_news").on("click", function(){
19
        $(".delete_news").on("click", function(){
20
            return confirmDelete( _("Are you sure you want to delete this news item? This cannot be undone.") );
20
            return confirmDelete( _("Are you sure you want to delete this news item? This cannot be undone.") );
21
        });
21
        });
22
23
        function Checkbox(){
24
            var form = document.getElementById('del_form');
25
            var inputs = form.getElementsByTagName('input');
26
            var checked = false;
27
            for (var i=0; i<inputs.length; i++) {
28
                if (inputs[i].type == 'checkbox' && inputs[i].name == 'ids') {
29
                    checked = inputs[i].checked;
30
                    if (checked) return true;
31
                }
32
            }
33
        }
34
22
        $("#del_form").on("submit",function(){
35
        $("#del_form").on("submit",function(){
23
            return confirmDelete( _("Are you sure you want to delete the selected news?") );
36
            if ( Checkbox() ) {
37
                return confirmDelete( _("Are you sure you want to delete the selected news?") );
38
            } else {
39
                alert(_("Please select a news item to delete."));
40
                return false;
41
            }
24
        });
42
        });
25
    });
43
    });
26
    //]]>
44
    //]]>
27
- 

Return to bug 17183