From: Chris Cormack Date: Sun, 12 Jan 2014 19:25:20 +0000 (+1300) Subject: Continuing on with the work X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=65bc505abfe365ad165f13f3fbba4d2c9d066769;p=working%2FNCIPServer.git Continuing on with the work --- diff --git a/lib/NCIP/Handler/CheckInItem.pm b/lib/NCIP/Handler/CheckInItem.pm index 89581d2..88cd8bc 100644 --- a/lib/NCIP/Handler/CheckInItem.pm +++ b/lib/NCIP/Handler/CheckInItem.pm @@ -32,11 +32,20 @@ sub handle { # checkin the item my $checkin = $self->ils->checkin( $userid, $itemid ); + my $output; my $vars; $vars->{'messagetype'} = 'CheckInItemResponse'; - $vars->{'elements'} = \@elements; - $vars->{'checkin'} = $checkin; - my $output = $self->render_output( 'response.tt', $vars ); + + if ( !$checkin->{success} ) { + + $output = $self->render_output( 'problem.tt', $vars ); + } + else { + + $vars->{'elements'} = \@elements; + $vars->{'checkin'} = $checkin; + $output = $self->render_output( 'response.tt', $vars ); + } return $output; } } diff --git a/lib/NCIP/ILS/Koha.pm b/lib/NCIP/ILS/Koha.pm index da1276c..38a4342 100644 --- a/lib/NCIP/ILS/Koha.pm +++ b/lib/NCIP/ILS/Koha.pm @@ -37,7 +37,9 @@ sub userdata { sub checkin { my $self = shift; my $barcode = shift; - my $result = AddReturn( $barcode, $branch, $exemptfine, $dropbox ); + my ($success, $messages, $issue, $borrower) = AddReturn( $barcode, $branch, $exemptfine, $dropbox ); + my $result = { success => $success, messages => $messages, iteminformation => $issue, borrower=> $borrower}; + return $result; } sub checkout { diff --git a/templates/includes/CheckOutItemResponse.inc b/templates/includes/CheckOutItemResponse.inc new file mode 100644 index 0000000..9659b3f --- /dev/null +++ b/templates/includes/CheckOutItemResponse.inc @@ -0,0 +1,3 @@ +[% date_due %] + + diff --git a/templates/problem.tt b/templates/problem.tt index a626a74..4da5935 100644 --- a/templates/problem.tt +++ b/templates/problem.tt @@ -1,8 +1,19 @@ [% INCLUDE 'includes/header.inc' %] - - [% error_detail %] - - + <[% messagetype %]> + [% IF processingerror %] + + + + [% processingerrortype %] + + + [% processingerrorelement %] + [% processingerrorvalue %] + + + [% error_detail %] + +