From 2f87409a835ac56a651f6a0895a7c92037c28212 Mon Sep 17 00:00:00 2001 From: Lyon3 Team Date: Fri, 30 Sep 2016 14:50:16 +0200 Subject: [PATCH] Bug 17317: Perfomance Improvement - Use of GetItemnumbersForBiblio instead of GetItemsByBiblioitemnumber (thx Jonathan Druart) Signed-off-by: Hector Castro Works as advertised Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- C4/ILSDI/Services.pm | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index 03f60853a4..23ec85a564 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -134,19 +134,15 @@ sub GetAvailability { } else { my $status; my $msg; - my $biblioitem = ( GetBiblioItemByBiblioNumber( $id, undef ) )[0]; - if ($biblioitem) { - my $biblioitemnumber = $biblioitem->{'biblioitemnumber'}; - my $items = (GetItemsByBiblioitemnumber($biblioitemnumber))[0]; - + my $items = GetItemnumbersForBiblio($id); + if ($items) { + # Open XML + $out .= " \n"; + $out .= " \n"; + $out .= " \n"; # We loop over the items to clean them - my $itemnumber; - foreach my $item (@$items) { - $itemnumber=$item->{'itemnumber'}; + foreach my $itemnumber (@$items) { my ( $biblionumber, $status, $msg, $location ) = _availability($itemnumber); - $out .= " \n"; - $out .= " \n"; - $out .= " \n"; $out .= " \n"; $out .= " \n"; $out .= " " . $itemnumber . "\n"; @@ -155,9 +151,10 @@ sub GetAvailability { if ($location) { $out .= " " . $location . "\n"; } $out .= " \n"; $out .= " \n"; - $out .= " \n"; - $out .= " \n"; } + # Close XML + $out .= " \n"; + $out .= " \n"; } else { $status = "unknown"; $msg = "Error: could not retrieve availability for this ID"; -- 2.39.5