From 62512dc5d6e56eea4241ca8887d395b96f4173fd Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 15 Mar 2021 16:15:22 +0000 Subject: [PATCH] Bug 24295: Remove GetTransfers from request.pl MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch replaces the call to GetTransfers in reserve.pl with the get_transfer method available from the Koha::Item object Test plan 1/ Place a reserve on an item at a different branch 2/ Trigger the transfer of the item 3/ Check the reserves page for the display of the current transfer status 4/ Apply patch 5/ Repeat step 3 Rebased-by: Joonas Kylmälä Signed-off-by: Joonas Kylmälä Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- reserve/request.pl | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/reserve/request.pl b/reserve/request.pl index 8c64f43160..5fcb7ad0b2 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -37,7 +37,7 @@ use C4::Reserves qw( RevertWaitingStatus AlterPriority ToggleLowestPriority Togg use C4::Items qw( get_hostitemnumbers_of ); use C4::Koha qw( getitemtypeimagelocation ); use C4::Serials qw( CountSubscriptionFromBiblionumber ); -use C4::Circulation qw( GetTransfers _GetCircControlBranch GetBranchItemRule ); +use C4::Circulation qw( _GetCircControlBranch GetBranchItemRule ); use Koha::DateUtils qw( dt_from_string ); use C4::Search qw( enabled_staff_search_views ); @@ -450,13 +450,11 @@ if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) } # Check the transit status - my ( $transfertwhen, $transfertfrom, $transfertto ) = - GetTransfers($item_object->itemnumber); # FIXME replace with get_transfer - - if ( defined $transfertwhen && $transfertwhen ne '' ) { - $item->{transfertwhen} = $transfertwhen; - $item->{transfertfrom} = $transfertfrom; - $item->{transfertto} = $transfertto; + my $transfer = $item_object->get_transfer; + if ( $transfer && $transfer->in_transit ) { + $item->{transfertwhen} = $transfer->datesent; + $item->{transfertfrom} = $transfer->frombranch; + $item->{transfertto} = $transfer->tobranch; $item->{nocancel} = 1; } -- 2.39.5