Bug 29737: Fix suspend from hold list
From holds list of a bibliographic record, the "unsuspend" button does not work as expected. The form is submitted but the suspension is still there. There are 3 requests, 2 GET and 1 POST. One of the GET is rejected by Firefox (NS_BINDING_ABORTED) Test plan: Place some items on hold, play with suspend/unsuspend from the hold list /cgi-bin/koha/reserve/request.pl?biblionumber=XX Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
e4f4a7ea98
commit
fd1b110fd5
|
|
@ -201,7 +201,7 @@
|
|||
<td>
|
||||
[% IF Koha.Preference('SuspendHoldsIntranet') %]
|
||||
[% UNLESS ( hold.found ) %]
|
||||
<button class="btn btn-default btn-xs" onclick="window.location.href='request.pl?action=toggleSuspend&reserve_id=[% hold.reserve_id | html %]&borrowernumber=[% hold.borrowernumber | html %]&biblionumber=[% hold.biblionumber | html %]&date=[% hold.date | html %]&suspend_until=' + $('#suspend_until_[% hold.reserve_id | html %]').val()">
|
||||
<button class="btn btn-default btn-xs toggle-suspend" data-reserve-id="[% hold.reserve_id | html %]" data-borrowernumber="[% hold.borrowernumber | html %]" data-biblionumber="[% hold.biblionumber | html %]" data-date="[% hold.date | html %]">
|
||||
[% IF ( hold.suspend ) %]
|
||||
<i class="fa fa-play" aria-hidden="true"></i> Unsuspend
|
||||
[% ELSE %]
|
||||
|
|
|
|||
|
|
@ -427,4 +427,15 @@ $(document).ready(function() {
|
|||
$('#suspend-modal').modal('hide');
|
||||
});
|
||||
});
|
||||
|
||||
$(".toggle-suspend").on('click', function(e) {
|
||||
e.preventDefault();
|
||||
let reserve_id = $(this).data('reserve-id');
|
||||
let borrowernumber = $(this).data('borrowernumber');
|
||||
let biblionumber = $(this).data('biblionumber');
|
||||
let date = $(this).data('date');
|
||||
let suspend_until = $('#suspend_until_' + reserve_id).val();
|
||||
window.location.href='request.pl?action=toggleSuspend&reserve_id=' + reserve_id + '&borrowernumber=' + borrowernumber + '&biblionumber=' + biblionumber + '&date=' + date + '&suspend_until=' + suspend_until;
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue