From 0fe68cd70c5c09713a329f35071c78264363a42c Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 11 Sep 2006 15:26:37 +0000 Subject: [PATCH] if an item has a hold attached, but it's in the wrong place, transit to the pickup lib of the hold git-svn-id: svn://svn.open-ils.org/ILS/trunk@6063 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/Circ/Circulate.pm | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm index 85682215c6..bc63fe40f0 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm @@ -129,6 +129,14 @@ __PACKAGE__->register_method( the logged in user must have RENEW_CIRC permissions. NOTES +__PACKAGE__->register_method( + method => "run_method", + api_name => "open-ils.circ.checkout.full"); +__PACKAGE__->register_method( + method => "run_method", + api_name => "open-ils.circ.checkout.full.override"); + + sub run_method { my( $self, $conn, $auth, $args ) = @_; @@ -159,6 +167,14 @@ sub run_method { if( $api =~ /checkout\.permit/ ) { $circulator->do_permit(); + } elsif( $api =~ /checkout.full/ ) { + + $circulator->do_permit(); + unless( $circulator->bail_out ) { + $circulator->events([]); + $circulator->do_checkout(); + } + } elsif( $api =~ /checkout/ ) { $circulator->do_checkout(); @@ -267,6 +283,7 @@ sub DESTROY { } # Add a pile of automagic getter/setter methods # -------------------------------------------------------------------------- my @AUTOLOAD_FIELDS = qw/ + remote_hold backdate copy copy_id @@ -1257,14 +1274,21 @@ sub do_checkin { # this copy can fulfill a hold or needs to be routed to a different location # ------------------------------------------------------------------------------ - if( $self->attempt_checkin_hold_capture() ) { + if( !$self->remote_hold and $self->attempt_checkin_hold_capture() ) { return if $self->bail_out; } else { # not needed for a hold + my $circ_lib = (ref $self->copy->circ_lib) ? $self->copy->circ_lib->id : $self->copy->circ_lib; + if( $self->remote_hold ) { + $circ_lib = $self->remote_hold->pickup_lib; + $logger->warn("circulator: Copy ".$self->copy->barcode. + " is on a remote hold's shelf, sending to $circ_lib"); + } + $logger->debug("circulator: circlib=$circ_lib, workstation=".$self->editor->requestor->ws_ou); if( $circ_lib == $self->editor->requestor->ws_ou ) { @@ -1357,6 +1381,7 @@ sub checkin_check_holds_shelf { } $logger->info("circulator: hold is not for here.."); + $self->remote_hold($hold); return 0; } -- 2.11.0