From 21ee25baa4cb7f80d76ddc822a54fc91cbfee66d Mon Sep 17 00:00:00 2001 From: Robin Sheat Date: Wed, 25 Jun 2014 11:40:45 +1200 Subject: [PATCH] Bug 12469: add due dates to the ILSDI interface This adds the dlf:dateavailable field to ILSDI item availability information if an item is currently checked out. Test plan: * Hit the ILSDI GetAvailability URL for an issued item * See that it now has the return date --- C4/ILSDI/Services.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index 898b7cc5fd..7c09268e0f 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -122,7 +122,6 @@ sub GetAvailability { foreach my $id ( split( / /, $cgi->param('id') ) ) { if ( $cgi->param('id_type') eq "item" ) { my ( $biblionumber, $status, $msg, $location ) = _availability($id); - $out .= " \n"; $out .= " \n"; $out .= " \n"; @@ -132,6 +131,7 @@ sub GetAvailability { $out .= " " . $status . "\n"; if ($msg) { $out .= " " . $msg . "\n"; } if ($location) { $out .= " " . $location . "\n"; } + if ($duedate) { $out .= " " . $duedate . "\n"; } $out .= " \n"; $out .= " \n"; $out .= " \n"; @@ -880,9 +880,12 @@ sub _availability { if ( $item->notforloan ) { return ( $biblionumber, 'not available', 'Not for loan', $location ); - } elsif ( $item->onloan ) { - return ( $biblionumber, 'not available', 'Checked out', $location ); - } elsif ( $item->itemlost ) { + } elsif ( $item->{'onloan'} ) { + return ( + $biblionumber, 'not available', 'Checked out', + $location, $item->{'onloan'} + ); + } elsif ( $item->{'itemlost'} ) { return ( $biblionumber, 'not available', 'Item lost', $location ); } elsif ( $item->withdrawn ) { return ( $biblionumber, 'not available', 'Item withdrawn', $location ); -- 2.20.1