Bug 17338: Fix redirection to correct tabs on waitingreserves.pl

To test:
1. Place multiple holds, good to have at least 4, for pickup at a location, I used Nick's handy script
2. Perl misc/cronjobs/holds/build_holds_queue.pl
3. Check in at least 4 items for pickup at one location so they'll be wating
4. Update the expiration date on those holds using ktd --dbshell
  update reserves set expirationdate = DATE('2024-01-01') where branchcode='CPL';
5. On Circulation > Holds waiting past their expiration date tab use the cancel button that is in the actions column to cancel a hold

The page loads on the Holds waiting tab, although in the url you see /circ/waitingreserves.pl?tab=holdsover

6. APPLY PATCH
7. Try 1 - 5 again, this time after step 5 you should be redirected.
8. Try cancelling holds with a transfer, ensuring you get redirected correctly.

Signed-off-by: Andrew Auld <andrew.auld@openfifth.co.uk>
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Lucas Gass 2025-04-28 16:50:41 +00:00 committed by Katrin Fischer
parent 103f095c2e
commit 9c746e675c
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 5 additions and 3 deletions

View File

@ -145,7 +145,7 @@ $template->param(
$template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find('FA');
if ( $item && $tab eq 'holdsover' && !@cancel_result ) {
print $input->redirect("/cgi-bin/koha/circ/waitingreserves.pl#holdsover");
print $input->redirect("/cgi-bin/koha/circ/waitingreserves.pl?tab=holdsover");
} elsif ( $op eq 'cud-cancelall' ) {
print $input->redirect("/cgi-bin/koha/circ/waitingreserves.pl");
} else {

View File

@ -56,7 +56,8 @@
<div class="alert alert-info">
<h2>This item is on hold for pick-up at [% Branches.GetName( branchcode ) | html %]</h2>
<p><strong>[% nextreservtitle | html %]</strong> is on hold for <strong> [% nextreservsurname | html %], [% nextreservfirstname | html %]</strong>. Please retain this item and check it in to process the hold. </p>
<form name="cancelReservewithtransfert" action="waitingreserves.pl#[% tab | html %]" method="get">
<form name="cancelReservewithtransfert" action="waitingreserves.pl" method="get">
<input type="hidden" name="tab" value="[% tab | html %]" />
<button type="submit" class="btn btn-default approve"><i class="fa fa-fw fa-check"></i> OK</button>
</form>
</div>
@ -65,7 +66,8 @@
<div class="alert alert-info">
<h2>This item is on hold for pick-up at your library</h2>
<p><strong>[% nextreservtitle | html %]</strong> is on hold for <strong>[% nextreservsurname | html %], [% nextreservfirstname | html %]</strong>. Please retain this item and check it in to process the hold. </p>
<form name="cancelReservewithwaiting" action="waitingreserves.pl#[% tab | html %]" method="get">
<form name="cancelReservewithwaiting" action="waitingreserves.pl" method="get">
<input type="hidden" name="tab" value="[% tab | html %]" />
<button type="submit" class="btn btn-default approve"><i class="fa fa-fw fa-check"></i> OK</button>
</form>
</div>