From 068e8759fae7ef73bc8ccde2c954761d6a7c5879 Mon Sep 17 00:00:00 2001 From: Lyon3 Team Date: Tue, 20 Sep 2016 12:13:23 +0200 Subject: [PATCH] Bug 17317 ILSDI - Getavailability method with id_type=bib implementation --- C4/ILSDI/Services.pm | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index 72bbbb7..279eec2 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -136,19 +136,32 @@ sub GetAvailability { my $msg; my $biblioitem = ( GetBiblioItemByBiblioNumber( $id, undef ) )[0]; if ($biblioitem) { - + my $biblioitemnumber = $biblioitem->{'biblioitemnumber'}; + my $items = (GetItemsByBiblioitemnumber($biblioitemnumber))[0]; + + # We loop over the items to clean them + my $itemnumber; + foreach my $item (@$items) { + $itemnumber=$item->{'itemnumber'}; + my ( $biblionumber, $status, $msg, $location ) = _availability($itemnumber); + $out .= " \n"; + $out .= " \n"; + $out .= " \n"; + $out .= " \n"; + $out .= " \n"; + $out .= " " . $itemnumber . "\n"; + $out .= " " . $status . "\n"; + if ($msg) { $out .= " " . $msg . "\n"; } + if ($location) { $out .= " " . $location . "\n"; } + $out .= " \n"; + $out .= " \n"; + $out .= " \n"; + $out .= " \n"; + } } else { $status = "unknown"; $msg = "Error: could not retrieve availability for this ID"; } - $out .= " \n"; - $out .= " \n"; - $out .= " \n"; - $out .= " " . $id . "\n"; - $out .= " " . $status . "\n"; - $out .= " " . $msg . "\n"; - $out .= " \n"; - $out .= " \n"; } } $out .= "\n"; -- 2.8.1