3 #----------------------------------------------------------------
4 # Code for testing the container API
5 #----------------------------------------------------------------
7 require '../oils_header.pl';
8 use vars qw/ $apputils $memcache $user $authtoken $authtime /;
9 use strict; use warnings;
11 #----------------------------------------------------------------
12 err("\nusage: $0 <config> <oils_login_username> ".
13 " <oils_login_password> <patronid> <copy_barcode> [<type>]\n".
14 "Where <type> is one of:\n".
15 "\t'permit' to run the permit only\n".
16 "\t'noncat_permit' to run the permit script against a noncat item\n".
17 "\t'noncat' to check out a noncat item\n".
18 "\tblahk to do a regular checkout\n" ) unless $ARGV[4];
19 #----------------------------------------------------------------
28 my $method = 'open-ils.circ.checkout_permit_';
31 osrf_connect($config);
32 oils_login($username, $password);
33 do_permit($patronid, $barcode, $type =~ /noncat/ );
34 do_checkout($patronid, $barcode, $type =~ /noncat/ ) unless ($type =~ /permit/);
40 #----------------------------------------------------------------
43 my( $patronid, $barcode, $noncat ) = @_;
45 my @args = ( $authtoken, 'patron', $patronid );
46 push(@args, ('barcode', $barcode)) unless $noncat;
47 push(@args, ('noncat', 1)) if $noncat;
50 CIRC(), 'open-ils.circ.permit_checkout_', @args );
52 oils_event_die($resp);
53 printl("Permit succeeded for patron $patronid");