From 68c2424277e53fe4530b3ec807af7d6310e4ba8f Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 15 Mar 2021 16:09:42 +0000 Subject: [PATCH] Bug 24295: Remove GetTransfers from opac-basket.pl This patch replaces the call to GetTransfers in opac-basket with the get_transfer method available from the Koha::Item object Test plan 1/ Trigger the transfer of the item 2/ Check the opac-basket page for the display of the current transfer status 3/ Apply patch 4/ Repeat step 2 --- opac/opac-basket.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl index ef4a25700f..0e26998321 100755 --- a/opac/opac-basket.pl +++ b/opac/opac-basket.pl @@ -30,7 +30,6 @@ use C4::Biblio qw( GetMarcUrls ); use C4::Items qw( GetHiddenItemnumbers GetItemsInfo ); -use C4::Circulation qw( GetTransfers ); use C4::Auth qw( get_template_and_user ); use C4::Output qw( output_html_with_http_headers ); use Koha::RecordProcessor; @@ -145,11 +144,12 @@ foreach my $biblionumber ( @bibs ) { if ($itm->{'location'}){ $itm->{'location_opac'} = $shelflocations->{$itm->{'location'} }; } - my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber}); - if ( defined( $transfertwhen ) && $transfertwhen ne '' ) { - $itm->{transfertwhen} = $transfertwhen; - $itm->{transfertfrom} = $transfertfrom; - $itm->{transfertto} = $transfertto; + my $item_object = Koha::Items->find($itm->{itemnumber}); + my $transfer = $item_object->get_transfer; + if ( $transfer->in_transit ) { + $itm->{transfertwhen} = output_pref({ dt => dt_from_string($transfer->datesent), dateonly => 1 }); + $itm->{transfertfrom} = $transfer->frombranch; + $itm->{transfertto} = $transfer->tobranch; } } $num++; -- 2.20.1