-package NCIP::Handler::LookupUser;
+package NCIP::Handler::CancelRequestItem;
=head1
- NCIP::Handler::LookupUser
+ NCIP::Handler::CancelRequestItem
=head1 SYNOPSIS
my $self = shift;
my $xmldoc = shift;
if ($xmldoc) {
-
- # Given our xml document, lets find the itemid
- my ($user_id) =
- $xmldoc->getElementsByTagNameNS( $self->namespace(),
- 'UserIdentifierValue' );
-
- my $user = NCIP::User->new(
- { userid => $user_id->textContent(), ils => $self->ils } );
- $user->initialise();
- my $vars;
- $vars->{'messagetype'} = 'LookupUserResponse';
- $vars->{'user'} = $user;
- my $output = $self->render_output('response.tt',$vars);
+ my $root = $xmldoc->documentElement();
+ my $xpc = $self->xpc();
+ my $userid = $xpc->findnodes( '//ns:UserIdentifierValue', $root );
+ my $requestid = $xpc->findnodes( '//ns:RequestIdentifierValue', $root );
+ my ( $error, $messages ) = $self->ils->cancelrequest($requestid);
+ if ($error) {
+ $vars->{'processingerror'} = 1;
+ $vars->{'processingerrortype'} = $messages;
+ $vars->{'processingerrorelement'} = 'UniqueRequestIdentifier';
+ $output = $self->render_output( 'problem.tt', $vars );
+ }
+ else {
+ my $elements = $self->get_user_elements($xmldoc);
+ $vars->{'elements'} = $elements;
+ $output = $self->render_output( 'response.tt', $vars );
+ }
return $output;
-
}
}
We can not place a request, we have no borrower information
[% CASE 'ITEM_NOT_FOUND' %]
We can not place a request, we have no item information
+ [% CASE 'ITEMNOTSAMEBRANCH' %]
+ Circulation rules stop this borrower from checking out this item, the borrower and item are not from the same branch
[% END %]
</Value>