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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc (-19 / +15 lines)
Lines 168-201 Link Here
168
                        </thead>
168
                        </thead>
169
                    </table>
169
                    </table>
170
170
171
                    <fieldset class="action">
172
                        <button class="btn btn-primary cancel_selected_holds" data-bulk="true"></button>
173
                    </fieldset>
174
175
                    [% PROCESS 'cancel-hold-modal' form_action = '/cgi-bin/koha/reserve/modrequest.pl' from_param = patronpage %]
171
                    [% PROCESS 'cancel-hold-modal' form_action = '/cgi-bin/koha/reserve/modrequest.pl' from_param = patronpage %]
176
                    [% PROCESS 'suspend-hold-modal' %]
172
                    [% PROCESS 'suspend-hold-modal' %]
177
                    [% PROCESS 'group-hold-modal' %]
173
                    [% PROCESS 'group-hold-modal' %]
178
                    [% IF Koha.Preference('DisplayAddHoldGroups') %]
174
                    <fieldset class="action">
179
                        <fieldset class="action">
175
                        <span class="me-2"><span class="badge text-bg-info selected_holds_count"></span> holds selected</span>
180
                            <button class="btn btn-primary group_selected_holds" data-bulk="true"></button>
176
                        <button class="btn btn-default cancel_selected_holds" data-bulk="true"><i class="fa fa-trash"></i> Cancel selected</button>
181
                        </fieldset>
177
                        [% IF Koha.Preference('SuspendHoldsIntranet') %]
182
                    [% END # IF DisplayAddHoldGroups %]
178
                            <button class="btn btn-default suspend_selected_holds" data-bulk="true"><i class="fa fa-pause"></i> Suspend selected</button>
183
179
                        [% END # IF SuspendHoldsIntranet %]
180
                        [% IF Koha.Preference('DisplayAddHoldGroups') %]
181
                            <button class="btn btn-default group_selected_holds" data-bulk="true"><i class="fa fa-layer-group"></i> Group selected</button>
182
                        [% END # IF DisplayAddHoldGroups %]
183
                    </fieldset>
184
                    [% IF Koha.Preference('SuspendHoldsIntranet') %]
184
                    [% IF Koha.Preference('SuspendHoldsIntranet') %]
185
                        <fieldset class="action">
185
                        <fieldset class="action">
186
                            <button class="btn btn-primary suspend_selected_holds" data-bulk="true"></button>
186
                            <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
187
                        </fieldset>
187
                                [% INCLUDE 'csrf-token.inc' %]
188
189
                        <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
190
                            [% INCLUDE 'csrf-token.inc' %]
191
                            <fieldset class="action">
192
                                <input type="hidden" name="op" value="cud-unsuspendall" />
188
                                <input type="hidden" name="op" value="cud-unsuspendall" />
193
                                <input type="hidden" name="from" value="borrower" />
189
                                <input type="hidden" name="from" value="borrower" />
194
                                <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
190
                                <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
195
                                <input type="hidden" name="suspend" value="0" />
191
                                <input type="hidden" name="suspend" value="0" />
196
                                <input type="submit" class="btn btn-primary" value="Resume all suspended holds" />
192
                                <button type="submit" class="btn btn-default"><i class="fa fa-play"></i> Resume all suspended holds</button>
197
                            </fieldset>
193
                            </form>
198
                        </form>
194
                        </fieldset>
199
                    [% END # IF SuspendHoldsIntranet %]
195
                    [% END # IF SuspendHoldsIntranet %]
200
                [% ELSE %]
196
                [% ELSE %]
201
                    <p>Patron has nothing on hold.</p>
197
                    <p>Patron has nothing on hold.</p>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-1 / +1 lines)
Lines 1301-1307 Link Here
1301
                        <input type="submit" class="btn btn-primary" name="submit" value="Update hold(s)" />
1301
                        <input type="submit" class="btn btn-primary" name="submit" value="Update hold(s)" />
1302
                    </div>
1302
                    </div>
1303
                    <div class="btn-group">
1303
                    <div class="btn-group">
1304
                        <button class="btn cancel_selected_holds" data-bulk="true"></button>
1304
                        <button class="btn cancel_selected_holds" data-bulk="true"> Cancel selected (<span class="selected_holds_count"></span>)</button>
1305
                    </div>
1305
                    </div>
1306
                    <div id="cancellation-reason-div" style="display:none">
1306
                    <div id="cancellation-reason-div" style="display:none">
1307
                        [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1307
                        [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/holds.js (-28 / +15 lines)
Lines 713-725 $(document).ready(function () { Link Here
713
        return toggle_suspend(this, inputs);
713
        return toggle_suspend(this, inputs);
714
    });
714
    });
715
715
716
    var MSG_SUSPEND_SELECTED = __("Suspend selected (%s)");
717
    var MSG_SUSPEND_SELECTED_HOLDS = __("selected holds");
716
    var MSG_SUSPEND_SELECTED_HOLDS = __("selected holds");
718
    $(".suspend_selected_holds").html(
719
        MSG_SUSPEND_SELECTED.format(
720
            $(".holds_table .select_hold:checked").length
721
        )
722
    );
723
717
724
    $(".suspend_selected_holds").click(function (e) {
718
    $(".suspend_selected_holds").click(function (e) {
725
        e.preventDefault();
719
        e.preventDefault();
Lines 743-749 $(document).ready(function () { Link Here
743
        return toggle_suspend(this, inputs);
737
        return toggle_suspend(this, inputs);
744
    });
738
    });
745
739
746
    var MSG_CANCEL_SELECTED = __("Cancel selected (%s)");
747
    var MSG_MOVE_SELECTED = __("Move selected (%s)");
740
    var MSG_MOVE_SELECTED = __("Move selected (%s)");
748
    var MSG_CANCEL_ALERT = __(
741
    var MSG_CANCEL_ALERT = __(
749
        "This action will cancel <span class='badge bg-danger'>%s</span> hold(s)."
742
        "This action will cancel <span class='badge bg-danger'>%s</span> hold(s)."
Lines 804-832 $(document).ready(function () { Link Here
804
        });
797
        });
805
    }
798
    }
806
799
807
    var MSG_GROUP_SELECTED = _("Group selected (%s)");
808
809
    function updateSelectedHoldsButtonCounters() {
800
    function updateSelectedHoldsButtonCounters() {
810
        $(".cancel_selected_holds").html(
811
            MSG_CANCEL_SELECTED.format(
812
                $(".holds_table .select_hold:checked").length
813
            )
814
        );
815
        $(".move_selected_holds").html(
801
        $(".move_selected_holds").html(
816
            MSG_MOVE_SELECTED.format(
802
            MSG_MOVE_SELECTED.format(
817
                $(".holds_table .select_hold:checked").length
803
                $(".holds_table .select_hold:checked").length
818
            )
804
            )
819
        );
805
        );
820
        $(".suspend_selected_holds").html(
806
        $(".selected_holds_count").html(
821
            MSG_SUSPEND_SELECTED.format(
807
            $(".holds_table .select_hold:checked").length
822
                $(".holds_table .select_hold:checked").length
823
            )
824
        );
825
        $(".group_selected_holds").html(
826
            MSG_GROUP_SELECTED.format(
827
                $(".holds_table .select_hold:checked").length
828
            )
829
        );
808
        );
809
        if (patron_page) {
810
            if ($(".holds_table .select_hold:checked").length == 0) {
811
                $(".cancel_selected_holds").prop("disabled", true);
812
                $(".suspend_selected_holds").prop("disabled", true);
813
                $(".group_selected_holds").prop("disabled", true);
814
            } else {
815
                if ($(".holds_table .select_hold:checked").length >= 2) {
816
                    $(".group_selected_holds").prop("disabled", false);
817
                }
818
                $(".suspend_selected_holds").prop("disabled", false);
819
                $(".cancel_selected_holds").prop("disabled", false);
820
            }
821
        }
830
    }
822
    }
831
823
832
    function updateMoveButtons(table) {
824
    function updateMoveButtons(table) {
Lines 1160-1169 $(document).ready(function () { Link Here
1160
        );
1152
        );
1161
    }
1153
    }
1162
1154
1163
    $(".group_selected_holds").html(
1164
        MSG_GROUP_SELECTED.format($(".holds_table .select_hold:checked").length)
1165
    );
1166
1167
    $(".group_selected_holds").click(function (e) {
1155
    $(".group_selected_holds").click(function (e) {
1168
        if ($(".holds_table .select_hold:checked").length > 1) {
1156
        if ($(".holds_table .select_hold:checked").length > 1) {
1169
            let selected_holds = get_selected_holds_data();
1157
            let selected_holds = get_selected_holds_data();
1170
- 

Return to bug 40517