From 61e1b5dd3ecfc45fb49c5b3b88409aa9c4df231f Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 15 Mar 2021 16:18:36 +0000 Subject: [PATCH] Bug 24295: Remove GetTransfers from detail.pl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch replaces the call to GetTransfers in detail.pl with the get_transfer method available from the Koha::Item object Test plan 1/ Trigger the transfer of the item 2/ Check the detail page for the display of the current transfer status 3/ Apply patch 4/ Repeat step 2 JK: Remove unneeded string formatting for transfertwhen as it's done on the template toolkit side already with $KohaDates Rebased-by: Joonas Kylmälä Signed-off-by: Joonas Kylmälä --- catalogue/detail.pl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 29d816aa93..47d4867ecc 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -34,7 +34,6 @@ use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLat use C4::Output qw( output_html_with_http_headers ); use C4::Biblio qw( GetBiblioData GetFrameworkCode ); use C4::Items qw( GetAnalyticsCount GetHostItemsInfo GetItemsInfo ); -use C4::Circulation qw( GetTransfers ); use C4::Reserves; use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials ); use C4::XISBN qw( get_xisbns ); @@ -397,11 +396,11 @@ foreach my $item (@items) { } # Check the transit status - my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($item->{itemnumber}); - 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.30.2