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-203 Link Here
168
                                </tr>
168
                                </tr>
169
                            </thead>
169
                            </thead>
170
                        </table>
170
                        </table>
171
172
                        <fieldset class="action">
173
                            <button class="btn btn-primary cancel_selected_holds" data-bulk="true"></button>
174
                        </fieldset>
175
                    </form>
171
                    </form>
176
172
177
                    [% PROCESS 'cancel-hold-modal' form_action = '/cgi-bin/koha/reserve/modrequest.pl' from_param = patronpage %]
173
                    [% PROCESS 'cancel-hold-modal' form_action = '/cgi-bin/koha/reserve/modrequest.pl' from_param = patronpage %]
178
                    [% PROCESS 'suspend-hold-modal' %]
174
                    [% PROCESS 'suspend-hold-modal' %]
179
                    [% PROCESS 'group-hold-modal' %]
175
                    [% PROCESS 'group-hold-modal' %]
180
                    [% IF Koha.Preference('DisplayAddHoldGroups') %]
176
                    <fieldset class="action">
181
                        <fieldset class="action">
177
                        <span class="me-2"><span class="badge text-bg-info selected_holds_count"></span> holds selected</span>
182
                            <button class="btn btn-primary group_selected_holds" data-bulk="true"></button>
178
                        <button class="btn btn-default cancel_selected_holds" data-bulk="true"><i class="fa fa-trash"></i> Cancel selected</button>
183
                        </fieldset>
179
                        [% IF Koha.Preference('SuspendHoldsIntranet') %]
184
                    [% END # IF DisplayAddHoldGroups %]
180
                            <button class="btn btn-default suspend_selected_holds" data-bulk="true"><i class="fa fa-pause"></i> Suspend selected</button>
185
181
                        [% END # IF SuspendHoldsIntranet %]
182
                        [% IF Koha.Preference('DisplayAddHoldGroups') %]
183
                            <button class="btn btn-default group_selected_holds" data-bulk="true"><i class="fa fa-layer-group"></i> Group selected</button>
184
                        [% END # IF DisplayAddHoldGroups %]
185
                    </fieldset>
186
                    [% IF Koha.Preference('SuspendHoldsIntranet') %]
186
                    [% IF Koha.Preference('SuspendHoldsIntranet') %]
187
                        <fieldset class="action">
187
                        <fieldset class="action">
188
                            <button class="btn btn-primary suspend_selected_holds" data-bulk="true"></button>
188
                            <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
189
                        </fieldset>
189
                                [% INCLUDE 'csrf-token.inc' %]
190
191
                        <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
192
                            [% INCLUDE 'csrf-token.inc' %]
193
                            <fieldset class="action">
194
                                <input type="hidden" name="op" value="cud-unsuspendall" />
190
                                <input type="hidden" name="op" value="cud-unsuspendall" />
195
                                <input type="hidden" name="from" value="borrower" />
191
                                <input type="hidden" name="from" value="borrower" />
196
                                <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
192
                                <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
197
                                <input type="hidden" name="suspend" value="0" />
193
                                <input type="hidden" name="suspend" value="0" />
198
                                <input type="submit" class="btn btn-primary" value="Resume all suspended holds" />
194
                                <button type="submit" class="btn btn-default"><i class="fa fa-play"></i> Resume all suspended holds</button>
199
                            </fieldset>
195
                            </form>
200
                        </form>
196
                        </fieldset>
201
                    [% END # IF SuspendHoldsIntranet %]
197
                    [% END # IF SuspendHoldsIntranet %]
202
                [% ELSE %]
198
                [% ELSE %]
203
                    <p>Patron has nothing on hold.</p>
199
                    <p>Patron has nothing on hold.</p>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-1 / +1 lines)
Lines 1237-1243 Link Here
1237
                        <input type="submit" class="btn btn-primary" name="submit" value="Update hold(s)" />
1237
                        <input type="submit" class="btn btn-primary" name="submit" value="Update hold(s)" />
1238
                    </div>
1238
                    </div>
1239
                    <div class="btn-group">
1239
                    <div class="btn-group">
1240
                        <button class="btn cancel_selected_holds" data-bulk="true"></button>
1240
                        <button class="btn cancel_selected_holds" data-bulk="true"> Cancel selected (<span class="selected_holds_count"></span>)</button>
1241
                    </div>
1241
                    </div>
1242
                    <fieldset id="cancellation-reason-fieldset" class="action" style="display:none">
1242
                    <fieldset id="cancellation-reason-fieldset" class="action" style="display:none">
1243
                        [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
1243
                        [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/holds.js (-28 / +15 lines)
Lines 699-711 $(document).ready(function () { Link Here
699
        return toggle_suspend(this, inputs);
699
        return toggle_suspend(this, inputs);
700
    });
700
    });
701
701
702
    var MSG_SUSPEND_SELECTED = _("Suspend selected (%s)");
703
    var MSG_SUSPEND_SELECTED_HOLDS = _("selected holds");
702
    var MSG_SUSPEND_SELECTED_HOLDS = _("selected holds");
704
    $(".suspend_selected_holds").html(
705
        MSG_SUSPEND_SELECTED.format(
706
            $(".holds_table .select_hold:checked").length
707
        )
708
    );
709
703
710
    $(".suspend_selected_holds").click(function (e) {
704
    $(".suspend_selected_holds").click(function (e) {
711
        e.preventDefault();
705
        e.preventDefault();
Lines 729-735 $(document).ready(function () { Link Here
729
        return toggle_suspend(this, inputs);
723
        return toggle_suspend(this, inputs);
730
    });
724
    });
731
725
732
    var MSG_CANCEL_SELECTED = _("Cancel selected (%s)");
733
    var MSG_CANCEL_ALERT = _(
726
    var MSG_CANCEL_ALERT = _(
734
        "This action will cancel <span class='badge bg-danger'>%s</span> hold(s)."
727
        "This action will cancel <span class='badge bg-danger'>%s</span> hold(s)."
735
    );
728
    );
Lines 789-812 $(document).ready(function () { Link Here
789
        });
782
        });
790
    }
783
    }
791
784
792
    var MSG_GROUP_SELECTED = _("Group selected (%s)");
793
794
    function updateSelectedHoldsButtonCounters() {
785
    function updateSelectedHoldsButtonCounters() {
795
        $(".cancel_selected_holds").html(
786
        $(".selected_holds_count").html(
796
            MSG_CANCEL_SELECTED.format(
787
            $(".holds_table .select_hold:checked").length
797
                $(".holds_table .select_hold:checked").length
798
            )
799
        );
800
        $(".suspend_selected_holds").html(
801
            MSG_SUSPEND_SELECTED.format(
802
                $(".holds_table .select_hold:checked").length
803
            )
804
        );
805
        $(".group_selected_holds").html(
806
            MSG_GROUP_SELECTED.format(
807
                $(".holds_table .select_hold:checked").length
808
            )
809
        );
788
        );
789
        if (patron_page) {
790
            if ($(".holds_table .select_hold:checked").length == 0) {
791
                $(".cancel_selected_holds").prop("disabled", true);
792
                $(".suspend_selected_holds").prop("disabled", true);
793
                $(".group_selected_holds").prop("disabled", true);
794
            } else {
795
                if ($(".holds_table .select_hold:checked").length >= 2) {
796
                    $(".group_selected_holds").prop("disabled", false);
797
                }
798
                $(".suspend_selected_holds").prop("disabled", false);
799
                $(".cancel_selected_holds").prop("disabled", false);
800
            }
801
        }
810
    }
802
    }
811
803
812
    updateSelectedHoldsButtonCounters();
804
    updateSelectedHoldsButtonCounters();
Lines 938-947 $(document).ready(function () { Link Here
938
        );
930
        );
939
    }
931
    }
940
932
941
    $(".group_selected_holds").html(
942
        MSG_GROUP_SELECTED.format($(".holds_table .select_hold:checked").length)
943
    );
944
945
    $(".group_selected_holds").click(function (e) {
933
    $(".group_selected_holds").click(function (e) {
946
        if ($(".holds_table .select_hold:checked").length > 1) {
934
        if ($(".holds_table .select_hold:checked").length > 1) {
947
            let selected_holds = get_selected_holds_data();
935
            let selected_holds = get_selected_holds_data();
948
- 

Return to bug 40517