signature => q/
Creates an in-house use action.
@param $authtoken The login session key
- @param params A named list of params including
+ @param params A hash of params including
'location' The org unit id where the in-house use occurs
'copyid' The copy in question
'count' The number of in-house uses to apply to this copy
/);
sub create_in_house_use {
- my( $self, $client, $authtoken, %params ) = @_;
+ my( $self, $client, $authtoken, $params ) = @_;
my( $staff, $evt, $copy );
- my $org = $params{location};
- my $copyid = $params{copyid};
- my $count = $params{count} || 1;
+ my $org = $params->{location};
+ my $copyid = $params->{copyid};
+ my $count = $params->{count} || 1;
($staff, $evt) = $U->checkses($authtoken);
return $evt if $evt;
notes => q/
Determines if the given checkout can occur
@param authtoken The login session key
- @param params A trailing list of named params including
+ @param params A trailing hash of named params including
barcode : The copy barcode,
patron : The patron the checkout is occurring for,
renew : true or false - whether or not this is a renewal
/);
sub permit_circ {
- my( $self, $client, $authtoken, %params ) = @_;
+ my( $self, $client, $authtoken, $params ) = @_;
my ( $requestor, $patron, $ctx, $evt );
# check permisson of the requestor
( $requestor, $patron, $evt ) =
$apputils->checkses_requestor(
- $authtoken, $params{patron}, 'VIEW_PERMIT_CHECKOUT' );
+ $authtoken, $params->{patron}, 'VIEW_PERMIT_CHECKOUT' );
return $evt if $evt;
# fetch and build the circulation environment
- ( $ctx, $evt ) = create_circ_ctx( %params,
+ ( $ctx, $evt ) = create_circ_ctx( %$params,
patron => $patron,
type => 'permit',
fetch_patron_circ_summary => 1,
notes => q/
Checks out an item
@param authtoken The login session key
- @param params A named list of params including:
+ @param params A named hash of params including:
copy The copy object
barcode If no copy is provided, the copy is retrieved via barcode
copyid If no copy or barcode is provide, the copy id will be use
/);
sub checkout {
- my( $self, $client, $authtoken, %params ) = @_;
+ my( $self, $client, $authtoken, $params ) = @_;
my ( $requestor, $patron, $ctx, $evt );
# check permisson of the requestor
( $requestor, $patron, $evt ) =
$apputils->checkses_requestor(
- $authtoken, $params{patron}, 'COPY_CHECKOUT' );
+ $authtoken, $params->{patron}, 'COPY_CHECKOUT' );
return $evt if $evt;
- return _checkout_noncat( $requestor, $patron, %params ) if $params{noncat};
+ return _checkout_noncat( $requestor, $patron, %$params ) if $params->{noncat};
# fetch and build the circulation environment
- ( $ctx, $evt ) = create_circ_ctx( %params,
+ ( $ctx, $evt ) = create_circ_ctx( %$params,
patron => $patron,
type => 'checkout',
fetch_patron_circ_summary => 1,
NOTES
sub checkin {
- my( $self, $client, $authtoken, %params ) = @_;
+ my( $self, $client, $authtoken, $params ) = @_;
my $barcode = $params{barcode};
}
NOTES
sub renew {
- my( $self, $client, $authtoken, %params ) = @_;
+ my( $self, $client, $authtoken, $params ) = @_;
my $circ = $params{circ};
}
"\t'permit' to run the permit only\n".
"\t'noncat_permit' to run the permit script against a noncat item\n".
"\t'noncat' to check out a noncat item\n".
- "\t(blank) to do a regular checkout\n" ) unless $ARGV[5];
+ "\t(blank) to do a regular checkout\n" ) unless $ARGV[4];
#----------------------------------------------------------------
my $config = shift;
my $password = shift;
my $patronid = shift;
my $barcode = shift;
-my $type = shift;
+my $type = shift || "";
my $nc_type = shift;
sub go {
sub do_permit {
my( $patronid, $barcode, $noncat ) = @_;
- my @args = ( $authtoken, 'patron', $patronid );
- push(@args, (barcode => $barcode)) unless $noncat;
- push(@args, (noncat => 1, noncat_type => $nc_type) ) if $noncat;
+ my $args = { patron => $patronid };
+
+ $args->{barcode} = $barcode;
+ if($noncat) {
+ $args->{noncat} = 1;
+ $args->{noncat_type} = $nc_type;
+ }
my $resp = simplereq(
- CIRC(), 'open-ils.circ.checkout.permit', @args );
+ CIRC(), 'open-ils.circ.checkout.permit', $authtoken, $args );
oils_event_die($resp);
printl("Permit succeeded for patron $patronid");
sub do_checkout {
my( $patronid, $barcode, $noncat, $nc_type ) = @_;
- my @args = ($authtoken, 'patron', $patronid);
- push(@args, (barcode => $barcode)) unless $noncat;
- push(@args, noncat => 1, noncat_type => $nc_type ) if $noncat;
+ my $args = { patron => $patronid };
+ $args->{barcode} = $barcode;
+ if($noncat) {
+ $args->{noncat} = 1;
+ $args->{noncat_type} = $nc_type;
+ }
my $resp = osrf_request(
'open-ils.circ',
- 'open-ils.circ.checkout', @args );
+ 'open-ils.circ.checkout', $authtoken, $args );
+
oils_event_die($resp);
printl("Checkout succeeded");
}