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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc (-8 / +14 lines)
Lines 173-178 Link Here
173
                [%- IF hold.non_priority -%]
173
                [%- IF hold.non_priority -%]
174
                    <br><i>Non priority hold</i>
174
                    <br><i>Non priority hold</i>
175
                [%- END -%]
175
                [%- END -%]
176
                [% IF ( hold.suspend ) %]
177
                    [% IF ( hold.suspend_until ) -%]
178
                        <p id="suspend-details-[% hold.reserve_id | html %]" style="font-size:90%">Hold is <strong>suspended</strong> until [% hold.suspend_until | $KohaDates %]</p>
179
                    [% ELSE %]
180
                        <p id="suspend-details-[% hold.reserve_id | html %]" style="font-size:90%">Hold is <strong>suspended</strong></p>
181
                    [% END %]
182
                [% END %]
176
            </td>
183
            </td>
177
            [%- IF ( CAN_user_reserveforothers_modify_holds_priority ) -%]
184
            [%- IF ( CAN_user_reserveforothers_modify_holds_priority ) -%]
178
            [%- UNLESS hold.found -%]
185
            [%- UNLESS hold.found -%]
Lines 190-213 Link Here
190
        [%- END -%]
197
        [%- END -%]
191
            [%- END -%]
198
            [%- END -%]
192
            <td>
199
            <td>
193
                <a class="cancel-hold" title="Cancel hold" data-borrowernumber="[% hold.borrowernumber | html %]" data-biblionumber="[% hold.biblionumber | html %]" data-id="[% hold.reserve_id | html %]" href="request.pl?action=cancel&amp;borrowernumber=[% hold.borrowernumber | html %]&amp;biblionumber=[% hold.biblionumber | html %]&amp;reserve_id=[% hold.reserve_id | html %]&amp;date=[% hold.date | html %]">
200
                <a class="cancel-hold btn btn-default btn-xs" title="Cancel hold" data-borrowernumber="[% hold.borrowernumber | html %]" data-biblionumber="[% hold.biblionumber | html %]" data-id="[% hold.reserve_id | html %]" href="request.pl?action=cancel&amp;borrowernumber=[% hold.borrowernumber | html %]&amp;biblionumber=[% hold.biblionumber | html %]&amp;reserve_id=[% hold.reserve_id | html %]&amp;date=[% hold.date | html %]">
194
                    <img src="[% interface | html %]/[% theme | html %]/img/x.png" alt="Cancel" />
201
                    <i class="fa fa-trash" aria-hidden="true"></i> Delete
195
                </a>
202
                </a>
196
            </td>
203
            </td>
197
            <td>
204
            <td>
198
                [%- IF Koha.Preference('SuspendHoldsIntranet') -%]
205
                [%- IF Koha.Preference('SuspendHoldsIntranet') -%]
199
                    [%- UNLESS ( hold.found ) -%]
206
                    [%- UNLESS ( hold.found ) -%]
200
                        <input type="button" value="[% IF ( hold.suspend ) %]Unsuspend[% ELSE %]Suspend[% END %]" onclick="window.location.href='request.pl?action=toggleSuspend&amp;reserve_id=[% hold.reserve_id | html %]&amp;borrowernumber=[% hold.borrowernumber | html %]&amp;biblionumber=[% hold.biblionumber | html %]&amp;date=[% hold.date | html %]&amp;suspend_until=' + $('#suspend_until_[% hold.reserve_id | html %]').val()" />
207
201
                        [%- IF Koha.Preference('AutoResumeSuspendedHolds') -%]
208
                        [% IF ( hold.suspend ) %]
202
                            <label for="suspend_until_[% hold.reserve_id | html %]">[% IF ( hold.suspend ) %] on [% ELSE %] until [% END %]</label>
209
                            <a class="hold-resume btn btn-default btn-xs" data-biblionumber="[% hold.biblionumber | html %]" data-borrowernumber="[% hold.borrowernumber | html %]" data-reserve-id="[% hold.reserve_id | html %]" data-title="[% hold_title | html %]" data-date="[% hold.date | html %]" id="resume[% hold.reserve_id | html %]"><i class="fa fa-play"></i> Resume</a>
203
                            <input type="text" name="suspend_until_[% hold.reserve_id | html %]" id="suspend_until_[% hold.reserve_id | html %]" size="10" value="[% hold.suspend_until | $KohaDates %]" class="suspend_until_datepicker" />
204
                        [%- ELSE -%]
210
                        [%- ELSE -%]
205
                            <input type="hidden" name="suspend_until_[% hold.reserve_id | html %]" id="suspend_until_[% hold.reserve_id | html %]" value=""/>
211
                            <a class="hold-suspend btn btn-default btn-xs" data-biblionumber="[% hold.biblionumber | html %]" data-borrowernumber="[% hold.borrowernumber | html %]" data-reserve-id="[% hold.reserve_id | html %]" data-title="[% hold_title | html %]" data-date="[% hold.date | html %]" id="suspend[% hold.reserve_id | html %]"><i class="fa fa-pause"></i> Suspend</a>
206
                        [%- END -%]
212
                        [%- END -%]
207
                    [%- END -%]
213
                    [%- END -%]
208
                [%- END # IF SuspendHoldsIntranet -%]
214
                [%- END # IF SuspendHoldsIntranet -%]
209
                [%- IF ( hold.found ) -%]
215
                [%- IF ( hold.found ) -%]
210
                    <input type="button" id="revert_hold_[% hold.reserve_id | html %]" value="[% IF hold.intransit %]Revert transit status[% ELSE %]Revert waiting status[% END %]" onclick="window.location.href='request.pl?action=move&amp;where=down&amp;first_priority=[% first_priority | uri %]&amp;last_priority=[% last_priority | uri %]&amp;prev_priority=0&amp;next_priority=1&amp;borrowernumber=[% hold.borrowernumber | uri %]&amp;biblionumber=[% hold.biblionumber | uri %]&amp;itemnumber=[% hold.itemnumber | uri %]&amp;reserve_id=[% hold.reserve_id | uri %]&amp;date=[% hold.date | uri %]'">
216
                    <input class="btn btn-default btn-xs" type="button" id="revert_hold_[% hold.reserve_id | html %]" value="[% IF hold.intransit %]Revert transit status[% ELSE %]Revert waiting status[% END %]" onclick="window.location.href='request.pl?action=move&amp;where=down&amp;first_priority=[% first_priority | uri %]&amp;last_priority=[% last_priority | uri %]&amp;prev_priority=0&amp;next_priority=1&amp;borrowernumber=[% hold.borrowernumber | uri %]&amp;biblionumber=[% hold.biblionumber | uri %]&amp;itemnumber=[% hold.itemnumber | uri %]&amp;reserve_id=[% hold.reserve_id | uri %]&amp;date=[% hold.date | uri %]'">
211
                [%- END -%]
217
                [%- END -%]
212
            </td>
218
            </td>
213
        </tr>
219
        </tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-4 / +54 lines)
Lines 1005-1016 Link Here
1005
                                                        [% holds_by_itemtype.push( h ) %]
1005
                                                        [% holds_by_itemtype.push( h ) %]
1006
                                                    [% END %]
1006
                                                    [% END %]
1007
                                                [% END %]
1007
                                                [% END %]
1008
                                                [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1008
                                                [% INCLUDE holds_table.inc holds=holds_by_itemtype hold_title = biblioloo.title %]
1009
                                            [% END %]
1009
                                            [% END %]
1010
                                        </fieldset>
1010
                                        </fieldset>
1011
                                    [% END # /FOREACH b %]
1011
                                    [% END # /FOREACH b %]
1012
                                [% ELSE %]
1012
                                [% ELSE %]
1013
                                    [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1013
                                    [% INCLUDE holds_table.inc holds=biblioloo.reserveloop hold_title = biblioloo.title %]
1014
                                [% END # /IF HoldsSplitQueue %]
1014
                                [% END # /IF HoldsSplitQueue %]
1015
1015
1016
                            [% END # /IF biblioloo.reserveloop %]
1016
                            [% END # /IF biblioloo.reserveloop %]
Lines 1067-1072 Link Here
1067
        </div>
1067
        </div>
1068
    </div>
1068
    </div>
1069
1069
1070
    <div id="suspend-modal" class="modal" role="dialog" aria-hidden="true">
1071
        <div class="modal-dialog">
1072
        <div class="modal-content">
1073
        <form id="suspend-modal-form" class="form-inline" name="suspend-modal-form" action="request.pl" method="post">
1074
            <div class="modal-header">
1075
                <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1076
                <h3 id="suspend-modal-label">Suspend hold on<em><span id="suspend-modal-title"></span></em></h3>
1077
            </div>
1078
            <div class="modal-body">
1079
                <input type="hidden" name="action" value="toggleSuspend" />
1080
                <input type="hidden" id="suspend-modal-borrowernumber" name="borrowernumber" />
1081
                <input type="hidden" id="suspend-modal-biblionumber" name="biblionumber" />
1082
                <input type="hidden" id="suspend-modal-date" name="date" />
1083
                <input type="hidden" id="suspend-modal-reserve_id" name="reserve_id" />
1084
                <label for="suspend-modal-until">Suspend until:</label>
1085
                <input name="suspend_until" id="suspend-modal-until" class="suspend-until" size="10" />
1086
                <p><a class="btn btn-link" id="suspend-modal-clear-date" ><i class="fa fa-remove" aria-hidden="true"></i> Clear date to suspend indefinitely</a></p>
1087
            </div>
1088
            <div class="modal-footer">
1089
                <button id="suspend-modal-submit" class="btn btn-default" type="submit">Suspend</button>
1090
                <a href="#" data-dismiss="modal" aria-hidden="true" class="cancel">Cancel</a>
1091
            </div>
1092
        </form>
1093
        </div>
1094
        </div>
1095
    </div>
1096
1070
[% MACRO jsinclude BLOCK %]
1097
[% MACRO jsinclude BLOCK %]
1071
    [% INCLUDE 'datatables.inc' %]
1098
    [% INCLUDE 'datatables.inc' %]
1072
    [% INCLUDE 'calendar.inc' %]
1099
    [% INCLUDE 'calendar.inc' %]
Lines 1148-1154 Link Here
1148
            [% END %]
1175
            [% END %]
1149
1176
1150
            [% IF AutoResumeSuspendedHolds %]
1177
            [% IF AutoResumeSuspendedHolds %]
1151
                $(".suspend_until_datepicker").flatpickr({
1178
                $(".suspend-until").flatpickr({
1152
                    minDate: new Date().fp_incr(1) /* Require that "until date" be in the future */
1179
                    minDate: new Date().fp_incr(1) /* Require that "until date" be in the future */
1153
                });
1180
                });
1154
            [% END %]
1181
            [% END %]
Lines 1672-1677 Link Here
1672
                return false;
1699
                return false;
1673
            });
1700
            });
1674
1701
1702
            $(".hold-suspend, .hold-resume").on( "click", function(e) {
1703
                e.preventDefault();
1704
                var id = $(this).data("reserve-id")
1705
                var title = $(this).data("title");
1706
                var borrowernumber = $(this).data("borrowernumber");
1707
                var biblionumber = $(this).data("biblionumber");
1708
                var date = $(this).data("date");
1709
1710
                $("#suspend-modal-title").html( title );
1711
                $("#suspend-modal-reserve_id").val( id );
1712
                $("#suspend-modal-borrowernumber").val( borrowernumber );
1713
                $("#suspend-modal-biblionumber").val( biblionumber );
1714
                $("#suspend-modal-date").val( date );
1715
                /* Actions based on which button was pushed */
1716
                if( $(this).hasClass("hold-resume") ){
1717
                    document.forms["suspend-modal-form"].submit();
1718
                } else {
1719
                    [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
1720
                        $('#suspend-modal').modal('show');
1721
                    [% ELSE %]
1722
                        document.forms["suspend-modal-form"].submit();
1723
                    [% END %]
1724
                }
1725
            });
1675
        });
1726
        });
1676
    </script>
1727
    </script>
1677
[% END %]
1728
[% END %]
1678
- 

Return to bug 29060