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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/hold-group.tt (-1 / +1 lines)
Lines 4-10 Link Here
4
</head>
4
</head>
5
<body id="hold-group">
5
<body id="hold-group">
6
<h1>Holds group ([% hold_group.id | html %])</h1>
6
<h1>Holds group ([% hold_group.id | html %])</h1>
7
<div id="main">
7
<div id="main" data-hold-group-id="[% hold_group.id | uri %]">
8
    [% holds = hold_group.holds %]
8
    [% holds = hold_group.holds %]
9
    [% IF holds.count %]
9
    [% IF holds.count %]
10
        <table>
10
        <table>
(-)a/koha-tmpl/intranet-tmpl/prog/js/hold-group.js (-1 / +27 lines)
Lines 5-10 $(document).ready(function () { Link Here
5
        $("#hold-group-modal").modal("show");
5
        $("#hold-group-modal").modal("show");
6
        if (holds_table_patron_page()) {
6
        if (holds_table_patron_page()) {
7
            append_select_group_holds_button();
7
            append_select_group_holds_button();
8
            append_ungroup_holds_button();
8
        }
9
        }
9
        return false;
10
        return false;
10
    });
11
    });
Lines 26-31 $(document).ready(function () { Link Here
26
        });
27
        });
27
    });
28
    });
28
29
30
    $("body").on("click", "button#ungroup-hold-group", function () {
31
        let hold_group_id = $("#hold-group-modal #main").data("hold-group-id");
32
        $.ajax({
33
            method: "DELETE",
34
            url:
35
                "/api/v1/patrons/" +
36
                borrowernumber +
37
                "/hold_groups/" +
38
                hold_group_id,
39
        }).done(function () {
40
            $("#holds-table").DataTable().ajax.reload();
41
        });
42
    });
43
29
    function append_select_group_holds_button() {
44
    function append_select_group_holds_button() {
30
        var button = document.createElement("button");
45
        var button = document.createElement("button");
31
        button.type = "button";
46
        button.type = "button";
Lines 37-40 $(document).ready(function () { Link Here
37
            $("#hold-group-modal .modal-footer").prepend(button);
52
            $("#hold-group-modal .modal-footer").prepend(button);
38
        }
53
        }
39
    }
54
    }
55
56
    function append_ungroup_holds_button() {
57
        var button = document.createElement("button");
58
        button.type = "button";
59
        button.className = "btn btn-danger";
60
        button.id = "ungroup-hold-group";
61
        button.dataset.bsDismiss = "modal";
62
        button.innerHTML = _("Ungroup holds");
63
        if (!$("#ungroup-hold-group").length) {
64
            $("#hold-group-modal .modal-footer").prepend(button);
65
        }
66
    }
40
});
67
});
41
- 

Return to bug 40613