From 1afdcbcbf74d7862a5b80ef36ba65f0b215c32a4 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 27 Jan 2006 23:06:46 +0000 Subject: [PATCH] non-cataloged circs are now working git-svn-id: svn://svn.open-ils.org/ILS/trunk@2873 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../OpenILS/Application/Circ/Circulate.pm | 24 +++++-------------- .../support-scripts/test-scripts/checkout.pl | 6 ++--- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm index d2eea0b47a..52f146c038 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm @@ -70,7 +70,7 @@ sub create_circ_ctx { my $ctx = {}; $ctx->{type} = $params{type}; - $ctx->{isrenew} = $params{isrenew}; + $ctx->{renew} = $params{renew}; $ctx->{noncat} = $params{noncat}; $ctx->{noncat_type} = $params{noncat_type}; @@ -252,7 +252,7 @@ sub _build_circ_script_runner { $runner->insert( 'result', {} ); $runner->insert( 'result.event', 'SUCCESS' ); - $runner->insert('environment.isRenewal', 1) if $ctx->{isrenew}; + $runner->insert('environment.isRenewal', 1) if $ctx->{renew}; $runner->insert('environment.isNonCat', 1) if $ctx->{noncat}; $runner->insert('environment.nonCatType', $ctx->{noncat_type}) if $ctx->{noncat}; @@ -288,7 +288,7 @@ sub _add_script_runner_methods { __PACKAGE__->register_method( method => "permit_circ", - api_name => "open-ils.circ.permit_checkout_", + api_name => "open-ils.circ.checkout.permit", notes => q/ Determines if the given checkout can occur @param authtoken The login session key @@ -312,18 +312,12 @@ sub permit_circ { return $evt if $evt; # fetch and build the circulation environment - ( $ctx, $evt ) = create_circ_ctx( - barcode => $params{barcode}, - copyid => $params{copyid}, - copy => $params{copy}, + ( $ctx, $evt ) = create_circ_ctx( %params, patron => $patron, type => 'permit', fetch_patron_circ_summary => 1, fetch_copy_statuses => 1, fetch_copy_locations => 1, - isrenew => ($params{renew}) ? 1 : 0, - noncat => ($params{noncat}) ? 1 : 0, - noncat_type => $params{noncat_type}, ); return $evt if $evt; @@ -394,22 +388,16 @@ sub checkout { return _checkout_noncat( $requestor, $patron, %params ) if $params{noncat}; # fetch and build the circulation environment - ( $ctx, $evt ) = create_circ_ctx( - barcode => $params{barcode}, - copyid => $params{copyid}, - copy => $params{copy}, + ( $ctx, $evt ) = create_circ_ctx( %params, patron => $patron, type => 'checkout', fetch_patron_circ_summary => 1, fetch_copy_statuses => 1, fetch_copy_locations => 1, - isrenew => ($params{renew}) ? 1 : 0, - noncat => ($params{noncat}) ? 1 : 0, ); return $evt if $evt; return _run_checkout_scripts( $ctx ); - } @@ -442,7 +430,7 @@ sub _checkout_noncat { __PACKAGE__->register_method( method => "checkin", - api_name => "open-ils.circ.checkin.barcode_", + api_name => "open-ils.circ.checkin", notes => <<" NOTES"); PARAMS( authtoken, barcode => bc ) Checks in based on barcode diff --git a/Open-ILS/src/support-scripts/test-scripts/checkout.pl b/Open-ILS/src/support-scripts/test-scripts/checkout.pl index f12524d69d..7e20b0b184 100755 --- a/Open-ILS/src/support-scripts/test-scripts/checkout.pl +++ b/Open-ILS/src/support-scripts/test-scripts/checkout.pl @@ -43,10 +43,10 @@ sub do_permit { my @args = ( $authtoken, 'patron', $patronid ); push(@args, (barcode => $barcode)) unless $noncat; - push(@args, (noncat => 1, noncat_type => $nc_type )) if $noncat; + push(@args, (noncat => 1, noncat_type => $nc_type) ) if $noncat; my $resp = simplereq( - CIRC(), 'open-ils.circ.permit_checkout_', @args ); + CIRC(), 'open-ils.circ.checkout.permit', @args ); oils_event_die($resp); printl("Permit succeeded for patron $patronid"); @@ -57,7 +57,7 @@ sub do_checkout { my @args = ($authtoken, 'patron', $patronid); push(@args, (barcode => $barcode)) unless $noncat; - push(@args, (noncat => 1, noncat_type => $nc_type )) if $noncat; + push(@args, noncat => 1, noncat_type => $nc_type ) if $noncat; my $resp = osrf_request( 'open-ils.circ', -- 2.43.2