From 06fe73bcaf8fe1605cee192671dbba41f71ef013 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 1 Nov 2018 18:56:18 +0000 Subject: [PATCH] Bug 21608: (follow-up) Use RevertWaitingStatus and do not alter _FixPriority --- C4/Reserves.pm | 5 +---- .../intranet-tmpl/prog/en/includes/holds_table.inc | 2 +- reserve/request.pl | 19 ++++++++++++------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index bdf0e0a130..41bdb4a35f 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -129,6 +129,7 @@ BEGIN { &AlterPriority &ToggleLowestPriority + &RevertWaitingStatus &ReserveSlip &ToggleSuspend @@ -1425,10 +1426,6 @@ sub _FixPriority { my $sth = $dbh->prepare($query); $sth->execute( $reserve_id ); } - elsif ( $hold && $hold->found() && $rank > 0 ) { - $hold->found(undef); - $hold->store(); - } my @priority; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc index 27c380a775..744672ef99 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/holds_table.inc @@ -191,7 +191,7 @@ [% END %] [% ELSE %] - + [% END %] [% END # IF SuspendHoldsIntranet %] diff --git a/reserve/request.pl b/reserve/request.pl index a1668a48b8..4629e3450e 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -86,13 +86,18 @@ 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'); - AlterPriority( $where, $reserve_id, $prev_priority, $next_priority, $first_priority, $last_priority ); + 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 ){ + 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 $hold = Koha::Holds->find( $reserve_id ); -- 2.11.0