my $itemid =
$xpc->findnodes( 'ns:RequestItem/UniqueItemId/ItemIdentifierValue',
$root );
-
+ my $biblionumber = $xpc->findnodes( 'ns://BibliographicRecordIdentifier',
+ $root );
# request the item
- my ( $error, $messages ) = $self->ils->request( $userid, $itemid );
+ my ( $error, $messages ) = $self->ils->request( $userid, $itemid, $biblionumber );
my $vars;
my $output;
my $vars->{'barcode'} = $itemid;
use C4::Items qw { GetItem };
use C4::Reserves
qw {CanBookBeReserved AddReserve GetReservesFromItemnumber CancelReserve};
-use C4::Biblio qw {AddBiblio GetMarcFromKohaField};
+use C4::Biblio qw {AddBiblio GetMarcFromKohaField GetBiblioData};
use C4::Barcodes::ValueBuilder;
use C4::Items qw{AddItem};
}
sub request {
- my $self = shift;
- my $cardnumber = shift;
- my $barcode = shift;
- my $borrower = GetMemberDetails( undef, $cardnumber );
+ my $self = shift;
+ my $cardnumber = shift;
+ my $barcode = shift;
+ my $biblionumber = shift;
+ my $borrower = GetMemberDetails( undef, $cardnumber );
my $result;
unless ($borrower) {
$result = { success => 0, messages => { 'BORROWER_NOT_FOUND' => 1 } };
return $result;
}
- my $itemdata = GetItem( undef, $barcode );
+ my $itemdata;
+ if ($barcode) {
+ $itemdata = GetItem( undef, $barcode );
+ }
+ else {
+ $itemdata = GetBiblioData($biblionumber);
+ }
unless ($itemdata) {
$result = { success => 0, messages => {'ITEM_NOT_FOUND'} };
return $result;
We can not place a hold, we have no borrower information
[% CASE 'Wrongbranch' %]
We are trying to check this item in at the wrong branch
+ [% CASE 'BORROWER_NOT_FOUND' %]
+ 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
[% END %]
</Value>