From 78e6b617d43aa7680b8d3f947ccc3f043c1ce389 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 29 Sep 2021 20:20:38 -0300 Subject: [PATCH] Bug 23678: (QA follow-up) Use correct indentation Signed-off-by: Tomas Cohen Arazi --- circ/waitingreserves.pl | 26 ++++++------- reserve/request.pl | 82 ++++++++++++++++++++++------------------- 2 files changed, 58 insertions(+), 50 deletions(-) diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl index ccbab78a2b..d71c53bb77 100755 --- a/circ/waitingreserves.pl +++ b/circ/waitingreserves.pl @@ -73,19 +73,19 @@ if ( C4::Context->preference('IndependentBranches') ) { } $template->param( all_branches => 1 ) if $all_branches; -if ( $cancelBulk ) { - my $cancellation_reason = $input->param("cancellation-reason"); - my @hold_ids = split ',', $input->param("ids"); - my $params = { - reason => $cancellation_reason, - hold_ids => \@hold_ids, - }; - my $job_id = Koha::BackgroundJob::BatchCancelHold->new->enqueue($params); - - $template->param( - enqueued => 1, - job_id => $job_id - ) +if ($cancelBulk) { + my $reason = $input->param("cancellation-reason"); + my @hold_ids = split ',', $input->param("ids"); + my $params = { + reason => $reason, + hold_ids => \@hold_ids, + }; + my $job_id = Koha::BackgroundJob::BatchCancelHold->new->enqueue($params); + + $template->param( + enqueued => 1, + job_id => $job_id + ); } my (@reserve_loop, @over_loop); diff --git a/reserve/request.pl b/reserve/request.pl index 33adf216ea..95a7fd43d1 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -90,43 +90,51 @@ my $action = $input->param('action'); $action ||= q{}; if ( $action eq 'move' ) { - my $where = $input->param('where'); - my $reserve_id = $input->param('reserve_id'); - my $prev_priority = $input->param('prev_priority'); - my $next_priority = $input->param('next_priority'); - my $first_priority = $input->param('first_priority'); - my $last_priority = $input->param('last_priority'); - my $hold_itemnumber = $input->param('itemnumber'); - if ( $prev_priority == 0 && $next_priority == 1 ){ - C4::Reserves::RevertWaitingStatus({ itemnumber => $hold_itemnumber }); - } else { - AlterPriority( $where, $reserve_id, $prev_priority, $next_priority, $first_priority, $last_priority ); - } -} elsif ( $action eq 'cancel' ) { - my $reserve_id = $input->param('reserve_id'); - my $cancellation_reason = $input->param("cancellation-reason"); - my $hold = Koha::Holds->find( $reserve_id ); - $hold->cancel({ cancellation_reason => $cancellation_reason }) if $hold; -} elsif ( $action eq 'setLowestPriority' ) { - my $reserve_id = $input->param('reserve_id'); - ToggleLowestPriority( $reserve_id ); -} elsif ( $action eq 'toggleSuspend' ) { - my $reserve_id = $input->param('reserve_id'); - my $suspend_until = $input->param('suspend_until'); - ToggleSuspend( $reserve_id, $suspend_until ); -} elsif ( $action eq 'cancelBulk') { - my $cancellation_reason = $input->param("cancellation-reason"); - my @hold_ids = split ',', $input->param("ids"); - my $params = { - reason => $cancellation_reason, - hold_ids => \@hold_ids, - }; - my $job_id = Koha::BackgroundJob::BatchCancelHold->new->enqueue($params); - - $template->param( - enqueued => 1, - job_id => $job_id - ) + my $where = $input->param('where'); + my $reserve_id = $input->param('reserve_id'); + my $prev_priority = $input->param('prev_priority'); + my $next_priority = $input->param('next_priority'); + my $first_priority = $input->param('first_priority'); + my $last_priority = $input->param('last_priority'); + my $hold_itemnumber = $input->param('itemnumber'); + if ( $prev_priority == 0 && $next_priority == 1 ) { + C4::Reserves::RevertWaitingStatus( { itemnumber => $hold_itemnumber } ); + } + else { + AlterPriority( + $where, $reserve_id, $prev_priority, + $next_priority, $first_priority, $last_priority + ); + } +} +elsif ( $action eq 'cancel' ) { + my $reserve_id = $input->param('reserve_id'); + my $cancellation_reason = $input->param("cancellation-reason"); + my $hold = Koha::Holds->find($reserve_id); + $hold->cancel( { cancellation_reason => $cancellation_reason } ) if $hold; +} +elsif ( $action eq 'setLowestPriority' ) { + my $reserve_id = $input->param('reserve_id'); + ToggleLowestPriority($reserve_id); +} +elsif ( $action eq 'toggleSuspend' ) { + my $reserve_id = $input->param('reserve_id'); + my $suspend_until = $input->param('suspend_until'); + ToggleSuspend( $reserve_id, $suspend_until ); +} +elsif ( $action eq 'cancelBulk' ) { + my $cancellation_reason = $input->param("cancellation-reason"); + my @hold_ids = split ',', $input->param("ids"); + my $params = { + reason => $cancellation_reason, + hold_ids => \@hold_ids, + }; + my $job_id = Koha::BackgroundJob::BatchCancelHold->new->enqueue($params); + + $template->param( + enqueued => 1, + job_id => $job_id + ); } if ($findborrower) { -- 2.32.0