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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/image-manage.tt (-9 / +9 lines)
Lines 5-21 Link Here
5
        //<![CDATA[
5
        //<![CDATA[
6
            function DeleteConfirm() {
6
            function DeleteConfirm() {
7
                var results = selected_images("delete");
7
                var results = selected_images("delete");
8
                if (results.images != -1) {
8
                if (results.images) {
9
                    var msg = _("Are you sure you want to delete image(s): %s?").format(results.image_ids);
9
                    var msg = _("Are you sure you want to delete image(s): %s?").format(results.image_ids);
10
                    var answer = confirm(msg);
10
                    var answer = confirm(msg);
11
                    if (answer) {
11
                    if (answer) {
12
                        window.location = "/cgi-bin/koha/patroncards/image-manage.pl?op=delete&" + results.images;
12
                        window.location = "/cgi-bin/koha/patroncards/image-manage.pl?op=delete&" + results.images;
13
                    }
13
                    } else {
14
                    else {
15
                        return; // abort delete
14
                        return; // abort delete
16
                    }
15
                    }
16
                } else {
17
                    alert(_("Please select image(s) to delete."));
17
                }
18
                }
18
            };
19
            }
20
19
            function selected_images(op) {
21
            function selected_images(op) {
20
                var selected = new Array;
22
                var selected = new Array;
21
                var image_ids = new Array;
23
                var image_ids = new Array;
Lines 25-40 Link Here
25
                            selected.push("image_id=" + document.delete_images.action[i].value);
27
                            selected.push("image_id=" + document.delete_images.action[i].value);
26
                            image_ids.push(document.delete_images.action[i].value);
28
                            image_ids.push(document.delete_images.action[i].value);
27
                        }
29
                        }
28
                    };
30
                    }
29
                    images = selected.join("&");
31
                    images = selected.join("&");
30
                    return {images:images, image_ids:image_ids};
32
                    return {images:images, image_ids:image_ids};
31
                }
33
                }
32
                else if (document.delete_images.action.checked){
34
                else if (document.delete_images.action.checked){
33
                        return {images:"batch_id="+document.delete_images.action.value, image_ids:document.delete_images.action.value};
35
                        return {images:"batch_id="+document.delete_images.action.value, image_ids:document.delete_images.action.value};
34
                };
36
                }
35
                alert(_("Please select image(s) to %s.").format(op));
36
                return (-1);
37
                return (-1);
37
            };
38
            }
38
        $(document).ready(function() {
39
        $(document).ready(function() {
39
            $("#delete").click(function(){
40
            $("#delete").click(function(){
40
                return DeleteConfirm();
41
                return DeleteConfirm();
41
- 

Return to bug 15711