$logger->info("child_init: kcxxx:$kcxxx");
}
+#----------------------------------------------------------------------
+
sub exists {
return 1;
}
}
);
+#----------------------------------------------------------------------
+
sub xyzzy {
my ($self, $conn, $authtoken, $id) = @_;
my $org = $e->requestor->ws_ou;
$logger->info("org:$org");
- $logger->info("e:".Dumper($e));
+ #$logger->info("e:".Dumper($e));
return new OpenILS::Event("SELFCHECK_NOT_ALLOWED") unless ($U->is_true(
$U->ou_ancestor_setting_value($org, 'circ.selfcheck')
));
- return $org;
+ return {"org" => $e->requestor->ws_ou, "patronid" => $e->requestor->id};
}
__PACKAGE__->register_method(
method => "xyzzy",
{type => 'string', desc => 'Authentication token'},
{type => 'number', desc => 'ID'},
],
- return => { desc => 'Test junk' }
+ return => {
+ desc => 'Test junk'
+ }
}
);
+#----------------------------------------------------------------------
+
sub checkout {
my ($self, $conn, $authtoken, $barcode) = @_;
my $r = $U->simplereq(
'open-ils.circ',
- 'open-ils.circ.checkout',
+ 'open-ils.circ.checkout.full',
$authtoken,
{ barcode => $barcode, patron => $e->requestor->id });
}
__PACKAGE__->register_method(
method => "checkout",
- api_name => "open-ils.selfcheck.checkout",
+ api_name => "open-ils.selfcheck.checkout.override",
+ signature => {
+ params => [
+ {type => 'string', desc => 'Authentication token'},
+ {type => 'string', desc => 'barcode'},
+ ],
+ return => { desc => 'Checkout item by barcode' }
+ }
+);
+
+#----------------------------------------------------------------------
+
+sub checkout2 {
+ my ($self, $conn, $authtoken, $barcode) = @_;
+
+ my $e = new_editor(xact => 1, authtoken => $authtoken);
+ return $e->die_event unless $e->checkauth;
+
+ my $org = $e->requestor->ws_ou;
+ return new OpenILS::Event("SELFCHECK_NOT_ALLOWED") unless ($U->is_true(
+ $U->ou_ancestor_setting_value($org, 'circ.selfcheck')
+ ));
+
+ my $circ_sess = OpenSRF::AppSession->connect('open-ils.circ');
+ my $req = $circ_sess->request(
+ 'open-ils.circ.checkout.full.override',
+ $authtoken,
+ { barcode => $barcode, patron => $e->requestor->id });
+
+ $conn->respond($req->gather(1));
+ $circ_sess->disconnect;
+
+ return;
+}
+__PACKAGE__->register_method(
+ method => "checkout2",
+ api_name => "open-ils.selfcheck.checkout2",
signature => {
params => [
{type => 'string', desc => 'Authentication token'},