From: Chris Cormack Date: Wed, 5 Mar 2014 00:27:52 +0000 (+1300) Subject: Continuing on with the AcceptItem handler X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9004187bcacaa69046f1e3dd21b87b4f0ee855e1;p=working%2FNCIPServer.git Continuing on with the AcceptItem handler --- diff --git a/lib/NCIP/Handler/AcceptItem.pm b/lib/NCIP/Handler/AcceptItem.pm index 3c120eb..dc39b5f 100644 --- a/lib/NCIP/Handler/AcceptItem.pm +++ b/lib/NCIP/Handler/AcceptItem.pm @@ -1,4 +1,4 @@ -package NCIP::Handler::AccpetItem; +package NCIP::Handler::AcceptItem; =head1 @@ -26,9 +26,7 @@ sub handle { my $root = $xmldoc->documentElement(); my $xpc = XML::LibXML::XPathContext->new; $xpc->registerNs( 'ns', $self->namespace() ); - my $itemid = - $xpc->findnodes( 'ns:AcceptItem/UniqueItemId/ItemIdentifierValue', - $root ); + my $itemid = $xpc->findnodes( '//ns:ItemId', $root ); # checkin the item my $accepted = $self->ils->acceptitem($itemid); @@ -52,7 +50,7 @@ sub handle { else { my $elements = $self->get_user_elements($xmldoc); $vars->{'elements'} = $elements; - $vars->{'checkin'} = $checkin; + $vars->{'accept'} = $accepted; $output = $self->render_output( 'response.tt', $vars ); } return $output; diff --git a/lib/NCIP/ILS/Koha.pm b/lib/NCIP/ILS/Koha.pm index 9132e29..3ac4288 100644 --- a/lib/NCIP/ILS/Koha.pm +++ b/lib/NCIP/ILS/Koha.pm @@ -150,10 +150,10 @@ sub acceptitem { my ( $reservedate, $borrowernumber, $branchcode, $reserve_id, $wait ) = GetReservesFromItemnumber( $itemdata->{'itemnumber'} ); unless ($reserve_id) { - $result = { success => 0, messages => 'No hold found for that item' }; + $result = { success => 0, messages => { NO_HOLD => 1 } }; return $result; } - $result = $self->checkin( $barcode, $branch ); + $result = $self->checkin( $barcode, $branchcode ); return $result; } 1; diff --git a/templates/problem.tt b/templates/problem.tt index 8a39f8b..99dec61 100644 --- a/templates/problem.tt +++ b/templates/problem.tt @@ -15,6 +15,8 @@ The item is on hold for another borrower [% CASE 'RENEW_ISSUE' %] This item is already on loan to this borrower + [% CASE 'NO_HOLD' %] + There is no hold on this item [% END %]