Bug 34478: Manual fix - add ops / change confirmation forms to get - waiting_holds.inc / waitingreserves.tt

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Nick Clemens 2024-02-01 09:36:03 -05:00 committed by Jonathan Druart
parent a08df1a9d5
commit 9439c9a36e
Signed by: jonathan.druart
GPG key ID: A085E712BEF0E0F0
3 changed files with 8 additions and 9 deletions

View file

@ -35,12 +35,12 @@ use Koha::BackgroundJob::BatchCancelHold;
my $input = CGI->new;
my $op = $input->param('op') || q{};
my $item = $input->param('itemnumber');
my $borrowernumber = $input->param('borrowernumber');
my $fbr = $input->param('fbr') || '';
my $tbr = $input->param('tbr') || '';
my $all_branches = $input->param('allbranches') || '';
my $cancelall = $input->param('cancelall');
my $tab = $input->param('tab');
my $cancelBulk = $input->param('cancelBulk');
@ -60,7 +60,7 @@ $template->param( TransferWhenCancelAllWaitingHolds => 1 ) if $transfer_when_can
my @cancel_result;
# if we have a return from the form we cancel the holds
if ($item) {
if ( $op eq 'cud-cancel' && $item) {
my $res = cancel( $item, $borrowernumber, $fbr, $tbr );
push @cancel_result, $res if $res;
}
@ -103,7 +103,7 @@ while ( my $hold = $holds->next ) {
my $calcDate = Date_to_Days( $expire_year, $expire_month, $expire_day );
if ($today > $calcDate) {
if ($cancelall) {
if ( $op eq 'cud-cancelall' ) {
my $res = cancel( $hold->item->itemnumber, $hold->borrowernumber, $hold->item->holdingbranch, $hold->item->homebranch, !$transfer_when_cancel_all );
push @cancel_result, $res if $res;
next;
@ -136,7 +136,7 @@ $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");
} elsif ($cancelall) {
} elsif ( $op eq 'cud-cancelall' ) {
print $input->redirect("/cgi-bin/koha/circ/waitingreserves.pl");
} else {
output_html_with_http_headers $input, $cookie, $template->output;

View file

@ -68,6 +68,7 @@
<td>
<form name="cancelReserve" action="waitingreserves.pl" method="post">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" name="op" value="cud-cancel">
<input type="hidden" name="borrowernumber" value="[% reserveloo.borrower.borrowernumber | html %]" />
<input type="hidden" name="itemnumber" value="[% reserveloo.item.itemnumber | html %]" />
<input type="hidden" name="fbr" value="[% reserveloo.item.holdingbranch | html %]" />

View file

@ -69,8 +69,7 @@
<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="post">
[% INCLUDE 'csrf-token.inc' %]
<form name="cancelReservewithtransfert" action="waitingreserves.pl#[% tab | html %]" method="get">
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
</form>
</div>
@ -81,8 +80,7 @@
<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="post">
[% INCLUDE 'csrf-token.inc' %]
<form name="cancelReservewithwaiting" action="waitingreserves.pl#[% tab | html %]" method="get">
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
</form>
</div>
@ -128,7 +126,7 @@
<div class="btn-group">
<form name="cancelAllReserve" action="waitingreserves.pl" method="post">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" name="cancelall" value="1" />
<input type="hidden" name="op" value="cud-cancelall" />
<input type="hidden" name="allbranches" value="[% allbranches | html %]" />
<input type="hidden" name="tab" value="holdsover">
[% IF TransferWhenCancelAllWaitingHolds %]