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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc (-10 / +13 lines)
Lines 177-182 Link Here
177
                [% IF hold.non_priority %]
177
                [% IF hold.non_priority %]
178
                    <br><i>Non priority hold</i>
178
                    <br><i>Non priority hold</i>
179
                [% END %]
179
                [% END %]
180
                [% IF ( hold.suspend ) %]
181
                    [% IF ( hold.suspend_until ) -%]
182
                        <p id="suspend-details-[% hold.reserve_id | html %]" style="font-size:90%">Hold is <strong>suspended</strong> until [% hold.suspend_until | $KohaDates %]</p>
183
                    [% ELSE %]
184
                        <p id="suspend-details-[% hold.reserve_id | html %]" style="font-size:90%">Hold is <strong>suspended</strong></p>
185
                    [% END %]
186
                [% END %]
180
            </td>
187
            </td>
181
188
182
            [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
189
            [% IF ( CAN_user_reserveforothers_modify_holds_priority ) %]
Lines 196-223 Link Here
196
            [% END %]
203
            [% END %]
197
204
198
            <td>
205
            <td>
199
                <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 %]">
206
                <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 %]">
200
                    <img src="[% interface | html %]/[% theme | html %]/img/x.png" alt="Cancel" />
207
                    <i class="fa fa-trash" aria-hidden="true"></i> Delete
201
                </a>
208
                </a>
202
            </td>
209
            </td>
203
210
204
            <td>
211
            <td>
205
                [% IF Koha.Preference('SuspendHoldsIntranet') %]
212
                [% IF Koha.Preference('SuspendHoldsIntranet') %]
206
                    [% UNLESS ( hold.found ) %]
213
                    [% UNLESS ( hold.found ) %]
207
                        <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()" />
214
                        [% IF ( hold.suspend ) %]
208
215
                            <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>
209
                        [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
210
                            <label for="suspend_until_[% hold.reserve_id | html %]">[% IF ( hold.suspend ) %] on [% ELSE %] until [% END %]</label>
211
                            <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="datepicker suspend_until_datepicker" />
212
                            <a href='#' onclick="document.getElementById('suspend_until_[% hold.reserve_id | html %]').value='';">Clear date</a>
213
                        [% ELSE %]
216
                        [% ELSE %]
214
                            <input type="hidden" name="suspend_until_[% hold.reserve_id | html %]" id="suspend_until_[% hold.reserve_id | html %]" value=""/>
217
                            <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>
215
                        [% END %]
218
                        [% END %]
216
                    [% END %]
219
                    [% END %]
217
                [% END # IF SuspendHoldsIntranet %]
220
                [% END # IF SuspendHoldsIntranet %]
218
221
219
                [% IF ( hold.found ) %]
222
                [% IF ( hold.found ) %]
220
                    <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 %]'">
223
                    <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 %]'">
221
                [% END %]
224
                [% END %]
222
            </td>
225
            </td>
223
226
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-3 / +60 lines)
Lines 1000-1011 Link Here
1000
                                                        [% holds_by_itemtype.push( h ) %]
1000
                                                        [% holds_by_itemtype.push( h ) %]
1001
                                                    [% END %]
1001
                                                    [% END %]
1002
                                                [% END %]
1002
                                                [% END %]
1003
                                                [% INCLUDE holds_table.inc holds=holds_by_itemtype %]
1003
                                                [% INCLUDE holds_table.inc holds=holds_by_itemtype hold_title = biblioloo.title %]
1004
                                            [% END %]
1004
                                            [% END %]
1005
                                        </fieldset>
1005
                                        </fieldset>
1006
                                    [% END # /FOREACH b %]
1006
                                    [% END # /FOREACH b %]
1007
                                [% ELSE %]
1007
                                [% ELSE %]
1008
                                    [% INCLUDE holds_table.inc holds=biblioloo.reserveloop %]
1008
                                    [% INCLUDE holds_table.inc holds=biblioloo.reserveloop hold_title = biblioloo.title %]
1009
                                [% END # /IF HoldsSplitQueue %]
1009
                                [% END # /IF HoldsSplitQueue %]
1010
1010
1011
                            [% END # /IF biblioloo.reserveloop %]
1011
                            [% END # /IF biblioloo.reserveloop %]
Lines 1590-1595 Link Here
1590
                stickTo: "#existing_holds",
1590
                stickTo: "#existing_holds",
1591
                stickyClass: "floating"
1591
                stickyClass: "floating"
1592
            });
1592
            });
1593
1594
            $("body").append("\
1595
                <div id='suspend-modal' class='modal' role='dialog' aria-hidden='true'>\
1596
                    <div class='modal-dialog'>\
1597
                    <div class='modal-content'>\
1598
                    <form id='suspend-modal-form' class='form-inline' name='suspend-modal-form' action='request.pl' method='post'>\
1599
                        <div class='modal-header'>\
1600
                            <button type='button' class='closebtn' data-dismiss='modal' aria-hidden='true'>×</button>\
1601
                            <h3 id='suspend-modal-label'>" + _("Suspend hold on") + " <em><span id='suspend-modal-title'></span></em></h3>\
1602
                        </div>\
1603
                        <div class='modal-body'>\
1604
                            <input type='hidden' name='action' value='toggleSuspend' />\
1605
                            <input type='hidden' id='suspend-modal-borrowernumber' name='borrowernumber' />\
1606
                            <input type='hidden' id='suspend-modal-biblionumber' name='biblionumber' />\
1607
                            <input type='hidden' id='suspend-modal-date' name='date' />\
1608
                            <input type='hidden' id='suspend-modal-reserve_id' name='reserve_id' />\
1609
                            <label for='suspend-modal-until'>" + _("Suspend until:") + "</label>\
1610
                            <input name='suspend_until' id='suspend-modal-until' class='suspend-until' size='10' />\
1611
                            <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>\
1612
                        </div>\
1613
                        <div class='modal-footer'>\
1614
                            <button id='suspend-modal-submit' class='btn btn-default' type='submit'>" + _("Suspend") + "</button>\
1615
                            <a href='#' data-dismiss='modal' aria-hidden='true' class='cancel'>" + _("Cancel") + "</a>\
1616
                        </div>\
1617
                    </form>\
1618
                    </div>\
1619
                    </div>\
1620
                </div>\
1621
            ");
1622
1623
            $(".hold-suspend, .hold-resume").on( "click", function(e) {
1624
                e.preventDefault();
1625
                var id = $(this).data("reserve-id")
1626
                var title = $(this).data("title");
1627
                var borrowernumber = $(this).data("borrowernumber");
1628
                var biblionumber = $(this).data("biblionumber");
1629
                var date = $(this).data("date");
1630
1631
                $("#suspend-modal-title").html( title );
1632
                $("#suspend-modal-reserve_id").val( id );
1633
                $("#suspend-modal-borrowernumber").val( borrowernumber );
1634
                $("#suspend-modal-biblionumber").val( biblionumber );
1635
                $("#suspend-modal-date").val( date );
1636
                /* Actions based on which button was pushed */
1637
                if( $(this).hasClass("hold-resume") ){
1638
                    document.forms["suspend-modal-form"].submit();
1639
                } else {
1640
                    [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
1641
                        $('#suspend-modal').modal('show');
1642
                    [% ELSE %]
1643
                        document.forms["suspend-modal-form"].submit();
1644
                    [% END %]
1645
                }
1646
            });
1647
1648
            $("#suspend-modal-until").datepicker({ minDate: 1 }); // Require that "until date" be in the future
1649
            $("#suspend-modal-clear-date").on( "click", function() { $("#suspend-modal-until").val(""); } );
1650
1593
        });
1651
        });
1594
    </script>
1652
    </script>
1595
[% END %]
1653
[% END %]
1596
- 

Return to bug 29060