Bug 36735: Fix revert hold button

Update the revert hold button to use the new include for submitting
forms from link data with a POST request

To test:
1. Place a hold on a biblio record
2. Check an item in to fill the hold
3. On the holds tab for the biblio record, click the "Revert waiting
   status" button for that hold
--> The page reloads but the hold is still waiting
4. Apply patchset
5. Click to another page and then return to the holds tab (we don't want
   to refresh the page and resend the request)
6. Click the "Revert waiting status" button for that hold
--> The hold should be reverted to pending status

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Emily Lamancusa 2024-04-30 15:32:13 -04:00 committed by Katrin Fischer
parent 11c69496bc
commit 236c9d4d98
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834
2 changed files with 2 additions and 1 deletions

View file

@ -257,7 +257,7 @@
[%- END -%]
[%- END # IF SuspendHoldsIntranet -%]
[%- IF ( hold.found ) -%]
<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?op=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 %]'">
<a class="btn btn-default submit-form-link" href="#" id="revert_hold_[% hold.reserve_id | html %]" data-op="cud-move" data-where="down" data-first_priority="[% first_priority | uri %]" data-last_priority="[% last_priority | uri %]" data-prev_priority="0" data-next_priority="1" data-borrowernumber="[% hold.borrowernumber | uri %]" data-biblionumber="[% hold.biblionumber | uri %]" data-itemnumber="[% hold.itemnumber | uri %]" data-reserve_id="[% hold.reserve_id | uri %]" data-date="[% hold.date | uri %]" data-action="request.pl" data-method="post">[% IF hold.intransit %]Revert transit status[% ELSE %]Revert waiting status[% END %]</a>
[%- END -%]
</td>
[% IF ( hold.intransit || hold.atdestination ) %]

View file

@ -1489,6 +1489,7 @@
[% Asset.js("lib/hc-sticky/hc-sticky.js") | $raw %]
[% INCLUDE 'select2.inc' %]
[% Asset.js("js/holds.js") | $raw%]
[% Asset.js("js/form-submit.js") | $raw%]
[% SET url_biblio_params = "biblionumber=" _ biblionumbers.join("&amp;biblionumber=") %]
[% IF multi_hold %]