Bugzilla – Attachment 126446 Details for
Bug 29060
Use modal for suspending holds until a date from the holds page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29060: Use modal for suspending holds until a date from the holds page
Bug-29060-Use-modal-for-suspending-holds-until-a-d.patch (text/plain), 6.55 KB, created by
Owen Leonard
on 2021-10-18 16:46:42 UTC
(
hide
)
Description:
Bug 29060: Use modal for suspending holds until a date from the holds page
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-10-18 16:46:42 UTC
Size:
6.55 KB
patch
obsolete
>From 3ce12f3b5fef6986905447d130b630e3472bc0fe Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 18 Oct 2021 16:43:37 +0000 >Subject: [PATCH] Bug 29060: Use modal for suspending holds until a date from > the holds page > >This patch modifies the way suspensions are handled when viewing the >list of holds on a particular title. In particular, when >AutoResumeSuspendedHolds is enabled the "suspend until" form field is >hidden until the suspend button is clicked, when a modal window appears. >This is consistent with the way it works when working with the list of >holds on a patron record. > >The patch also converts the hold deletion button from an "X" image to a >more-standard "Delete" button. > >To test, apply the patch and make sure AutoResumeSuspendedHolds is >enabled. > >- Locate a title in the catalog with multiple holds. >- View the holds on that title. In the list of holds you should see > "Delete" and "Suspend" buttons in the last two columns of the tabel of > holds. >- Test that the "Delete" button works correctly, >- Test the "Suspend" button. Clicking it should trigger a modal window > where you can set a date for the hold to resume. > - Submitting the form with a date should result in the page reloading > and showing the hold as suspended until that date. > - Submitting hte form without a date should result in the page > reloading and showing the hold as suspended. >- Test that the "Resume" button works to remove the suspension. >- Disable AutoResumeSuspendedHolds. Now when you click the "Suspend" > button you should not see the modal. The page should reload and the > hold should be suspended without a resume date. >--- > .../prog/en/modules/reserve/request.tt | 58 +++++++++---------- > 1 file changed, 28 insertions(+), 30 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index ed413af2c3..a37936e629 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -1067,6 +1067,33 @@ > </div> > </div> > >+ <div id="suspend-modal" class="modal" role="dialog" aria-hidden="true"> >+ <div class="modal-dialog"> >+ <div class="modal-content"> >+ <form id="suspend-modal-form" class="form-inline" name="suspend-modal-form" action="request.pl" method="post"> >+ <div class="modal-header"> >+ <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">Ã</button> >+ <h3 id="suspend-modal-label">Suspend hold on<em><span id="suspend-modal-title"></span></em></h3> >+ </div> >+ <div class="modal-body"> >+ <input type="hidden" name="action" value="toggleSuspend" /> >+ <input type="hidden" id="suspend-modal-borrowernumber" name="borrowernumber" /> >+ <input type="hidden" id="suspend-modal-biblionumber" name="biblionumber" /> >+ <input type="hidden" id="suspend-modal-date" name="date" /> >+ <input type="hidden" id="suspend-modal-reserve_id" name="reserve_id" /> >+ <label for="suspend-modal-until">Suspend until:</label> >+ <input name="suspend_until" id="suspend-modal-until" class="suspend-until" size="10" /> >+ <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> >+ </div> >+ <div class="modal-footer"> >+ <button id="suspend-modal-submit" class="btn btn-default" type="submit">Suspend</button> >+ <a href="#" data-dismiss="modal" aria-hidden="true" class="cancel">Cancel</a> >+ </div> >+ </form> >+ </div> >+ </div> >+ </div> >+ > [% MACRO jsinclude BLOCK %] > [% INCLUDE 'datatables.inc' %] > [% INCLUDE 'calendar.inc' %] >@@ -1148,7 +1175,7 @@ > [% END %] > > [% IF AutoResumeSuspendedHolds %] >- $(".suspend_until_datepicker").flatpickr({ >+ $(".suspend-until").flatpickr({ > minDate: new Date().fp_incr(1) /* Require that "until date" be in the future */ > }); > [% END %] >@@ -1672,35 +1699,6 @@ > return false; > }); > >- $("body").append("\ >- <div id='suspend-modal' class='modal' role='dialog' aria-hidden='true'>\ >- <div class='modal-dialog'>\ >- <div class='modal-content'>\ >- <form id='suspend-modal-form' class='form-inline' name='suspend-modal-form' action='request.pl' method='post'>\ >- <div class='modal-header'>\ >- <button type='button' class='closebtn' data-dismiss='modal' aria-hidden='true'>Ã</button>\ >- <h3 id='suspend-modal-label'>" + _("Suspend hold on") + " <em><span id='suspend-modal-title'></span></em></h3>\ >- </div>\ >- <div class='modal-body'>\ >- <input type='hidden' name='action' value='toggleSuspend' />\ >- <input type='hidden' id='suspend-modal-borrowernumber' name='borrowernumber' />\ >- <input type='hidden' id='suspend-modal-biblionumber' name='biblionumber' />\ >- <input type='hidden' id='suspend-modal-date' name='date' />\ >- <input type='hidden' id='suspend-modal-reserve_id' name='reserve_id' />\ >- <label for='suspend-modal-until'>" + _("Suspend until:") + "</label>\ >- <input name='suspend_until' id='suspend-modal-until' class='suspend-until' size='10' />\ >- <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>\ >- </div>\ >- <div class='modal-footer'>\ >- <button id='suspend-modal-submit' class='btn btn-default' type='submit'>" + _("Suspend") + "</button>\ >- <a href='#' data-dismiss='modal' aria-hidden='true' class='cancel'>" + _("Cancel") + "</a>\ >- </div>\ >- </form>\ >- </div>\ >- </div>\ >- </div>\ >- "); >- > $(".hold-suspend, .hold-resume").on( "click", function(e) { > e.preventDefault(); > var id = $(this).data("reserve-id") >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29060
:
125078
|
126446
|
126480