@@ -, +, @@ - View the holds tab under "Your summary." - Click the "Suspend" button next to one of the holds. - You should see a modal which shows the title of the item in question. - Test that the date picker works correctly: - Test selecting a month and year - Test selecting a date both with the mouse and by using arrow keys. - Test that you can clear the selected date both by clicking the X and by clicking the text link. - Select a date and close the modal without submitting the suspension. - Click the "Suspend" link on another title to confirm that the date picker still works correctly. - Submit a suspension and confirm that the it completes successfully. - --- .../bootstrap/en/includes/holds-table.inc | 33 +---------- .../bootstrap/en/modules/opac-user.tt | 57 +++++++++++++++++++ 2 files changed, 58 insertions(+), 32 deletions(-) --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc +++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc @@ -138,38 +138,7 @@ [% ELSE %] [% IF AutoResumeSuspendedHolds %] - Suspend - [% # hold suspend modal form %] - + Suspend [% ELSE %]
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -874,6 +874,38 @@ +[% # hold suspend modal form %] +
+ [% IF ( OverDriveCirculation ) %] [% INCLUDE 'overdrive-checkout.inc' %] [% IF ( Koha.Preference('OverDrivePasswordRequired') ) %] @@ -950,6 +982,31 @@ })($(this)) }); + /* We initiate this flatpickr instance here so that we can use the variable later */ + var suspend_until_date = $("#suspend_untilDate").flatpickr({ + minDate: "today" + }); + + $(".suspend_hold").on("click", function(e){ + e.preventDefault(); + var title = $(this).data("title"); + var reserve_id = $(this).data("reserve_id"); + $("#suspendHoldReserveId").val( reserve_id ); + $("#suspendHoldTitle").html( "" + title + "" ); + $("#suspendHoldModal").modal("show"); + }); + + $("#suspend-modal-clear-date").on( "click", function(e) { + e.preventDefault(); + suspend_until_date.clear(); + }); + + $("#suspendHoldModal").on("hidden.bs.modal", function(){ + $("#suspendHoldTitle").html(""); + $("#suspendHoldReserveId").val(""); + suspend_until_date.clear(); + }); + $("#suspend_all_submit").on("click", function(e){ e.preventDefault(); var title = _("Are you sure you want to suspend all holds?"); --