From f11340a08cde2e0d22670811febc4fedaf5ae47c Mon Sep 17 00:00:00 2001 From: Lyon3 Team Date: Tue, 27 Apr 2021 16:13:39 +0200 Subject: [PATCH] Bug 28238: Add itemcallnumber to ils-di GetAvailability output Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi Signed-off-by: Fridolin Somers --- C4/ILSDI/Services.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index 34465a7caf..43986779c2 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -119,7 +119,7 @@ sub GetAvailability { foreach my $id ( split( / /, $cgi->param('id') ) ) { if ( $cgi->param('id_type') eq "item" ) { - my ( $biblionumber, $status, $msg, $location ) = _availability($id); + my ( $biblionumber, $status, $msg, $location, $itemcallnumber ) = _availability($id); $out .= " \n"; $out .= " \n"; @@ -130,6 +130,7 @@ sub GetAvailability { $out .= " " . $status . "\n"; if ($msg) { $out .= " " . $msg . "\n"; } if ($location) { $out .= " " . $location . "\n"; } + if ($itemcallnumber) { $out .= " " . $itemcallnumber. "\n"; } $out .= " \n"; $out .= " \n"; $out .= " \n"; @@ -146,13 +147,14 @@ sub GetAvailability { # We loop over the items to clean them while ( my $item = $items->next ) { my $itemnumber = $item->itemnumber; - my ( $biblionumber, $status, $msg, $location ) = _availability($itemnumber); + my ( $biblionumber, $status, $msg, $location, $itemcallnumber ) = _availability($itemnumber); $out .= " \n"; $out .= " \n"; $out .= " " . $itemnumber . "\n"; $out .= " " . $status . "\n"; if ($msg) { $out .= " " . $msg . "\n"; } if ($location) { $out .= " " . $location . "\n"; } + if ($itemcallnumber) { $out .= " " . $itemcallnumber. "\n"; } $out .= " \n"; $out .= " \n"; } @@ -961,6 +963,7 @@ sub _availability { my $biblionumber = $item->biblioitemnumber; my $library = Koha::Libraries->find( $item->holdingbranch ); my $location = $library ? $library->branchname : ''; + my $itemcallnumber = $item->itemcallnumber; if ( $item->notforloan ) { return ( $biblionumber, 'not available', 'Not for loan', $location ); @@ -973,7 +976,7 @@ sub _availability { } elsif ( $item->damaged ) { return ( $biblionumber, 'not available', 'Item damaged', $location ); } else { - return ( $biblionumber, 'available', undef, $location ); + return ( $biblionumber, 'available', undef, $location, $itemcallnumber ); } } -- 2.39.5