[open-ils-commits] r17400 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Aug 31 08:48:33 EDT 2010
Author: erickson
Date: 2010-08-31 08:48:31 -0400 (Tue, 31 Aug 2010)
New Revision: 17400
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
Log:
use circ_lib param instead of direct ws_ou acccess
circulator->circ_lib, which defaults to requestor->ws_ou (but is
overrideable) should be used in in lieu of direct ws_ou accesss;
This is useful when the caller is not physically logged in to a
workstation (e.g. centralized SIP client) and need to specify the
physical location through other means.
This change has no effect unless circ_lib is overridden by the caller
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2010-08-31 03:52:53 UTC (rev 17399)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2010-08-31 12:48:31 UTC (rev 17400)
@@ -998,7 +998,7 @@
# ahead and renew the item instead of warning about open circulations.
my $auto_renew_intvl = $U->ou_ancestor_setting_value(
- $self->editor->requestor->ws_ou,
+ $self->circ_lib,
'circ.checkout_auto_renew_age',
$self->editor
);
@@ -1121,7 +1121,7 @@
my $results = $self->editor->json_query(
{ from => [
$dbfunc,
- $self->editor->requestor->ws_ou,
+ $self->circ_lib,
($self->is_noncat or ($self->is_precat and !$self->override and !$self->is_renewal)) ? undef : $self->copy->id,
$self->patron->id,
]
@@ -1351,7 +1351,7 @@
$CR->checkin_time('now');
$CR->checkin_scan_time('now');
- $CR->checkin_lib($self->editor->requestor->ws_ou);
+ $CR->checkin_lib($self->circ_lib);
$CR->checkin_workstation($self->editor->requestor->wsid);
$CR->checkin_staff($self->editor->requestor->id);
@@ -1613,7 +1613,7 @@
$hold->capture_time('now') unless $hold->capture_time;
$hold->fulfillment_time('now');
$hold->fulfillment_staff($e->requestor->id);
- $hold->fulfillment_lib($e->requestor->ws_ou);
+ $hold->fulfillment_lib($self->circ_lib);
return $self->bail_on_events($e->event)
unless $e->update_action_hold_request($hold);
@@ -1636,7 +1636,7 @@
return undef if $self->volume->id == OILS_PRECAT_CALL_NUMBER;
return undef unless $U->ou_ancestor_setting_value(
- $e->requestor->ws_ou, 'circ.checkout_fills_related_hold', $e);
+ $self->circ_lib, 'circ.checkout_fills_related_hold', $e);
# find the oldest unfulfilled hold that has not yet hit the holds shelf.
my $args = {
@@ -1989,7 +1989,7 @@
# due-date overlap should be determined by the location the item
# is checked out from, not the owning or circ lib of the item
- my $org = $self->editor->requestor->ws_ou;
+ my $org = $self->circ_lib;
$logger->info("circulator: circ searching for closed date overlap on lib $org".
" with an item due date of ".$circ->due_date );
@@ -2104,7 +2104,7 @@
my $circ;
my $evt;
- my $lib = $self->noncat_circ_lib || $self->editor->requestor->ws_ou;
+ my $lib = $self->noncat_circ_lib || $self->circ_lib;
my $count = $self->noncat_count || 1;
my $cotime = cleanse_ISO8601($self->checkout_time) || "";
@@ -2292,9 +2292,9 @@
" is on a remote hold's shelf, sending to $circ_lib");
}
- $logger->debug("circulator: circlib=$circ_lib, workstation=".$self->editor->requestor->ws_ou);
+ $logger->debug("circulator: circlib=$circ_lib, workstation=".$self->circ_lib);
- if( $circ_lib == $self->editor->requestor->ws_ou ) {
+ if( $circ_lib == $self->circ_lib) {
# copy is where it needs to be, either for hold or reshelving
$self->checkin_handle_precat();
@@ -2305,7 +2305,7 @@
if ($U->is_true( $self->copy->floating ) && !$self->remote_hold) { # copy is floating, stick here
$self->checkin_changed(1);
- $self->copy->circ_lib( $self->editor->requestor->ws_ou );
+ $self->copy->circ_lib( $self->circ_lib );
$self->update_copy;
} else {
my $bc = $self->copy->barcode;
@@ -2319,7 +2319,7 @@
} else { # no-op checkin
if ($U->is_true( $self->copy->floating )) { # XXX floating items still stick where they are even with no-op checkin?
$self->checkin_changed(1);
- $self->copy->circ_lib( $self->editor->requestor->ws_ou );
+ $self->copy->circ_lib( $self->circ_lib );
$self->update_copy;
}
}
@@ -2426,7 +2426,7 @@
$logger->info("circulator: we found a captured, un-fulfilled hold [".
$hold->id. "] for copy ".$self->copy->barcode);
- if( $hold->pickup_lib == $self->editor->requestor->ws_ou ) {
+ if( $hold->pickup_lib == $self->circ_lib ) {
$logger->info("circulator: hold is for here .. we're done: ".$self->copy->barcode);
return 1;
}
@@ -2459,7 +2459,7 @@
#$dest ||= (ref($copy->circ_lib)) ? $copy->circ_lib->id : $copy->circ_lib;
$logger->info("circulator: transiting copy to $dest");
- $transit->source($self->editor->requestor->ws_ou);
+ $transit->source($self->circ_lib);
$transit->dest($dest);
$transit->target_copy($copy->id);
$transit->source_send_time('now');
@@ -2548,7 +2548,7 @@
$hold->current_copy($copy->id);
$hold->capture_time('now');
$self->put_hold_on_shelf($hold)
- if $hold->pickup_lib == $self->editor->requestor->ws_ou;
+ if $hold->pickup_lib == $self->circ_lib;
# prevent DB errors caused by fetching
# holds from storage, and updating through cstore
@@ -2566,7 +2566,7 @@
return 0 if $self->bail_out;
- if( $hold->pickup_lib == $self->editor->requestor->ws_ou ) {
+ if( $hold->pickup_lib == $self->circ_lib ) {
# This hold was captured in the correct location
$copy->status(OILS_COPY_STATUS_ON_HOLDS_SHELF);
@@ -2708,7 +2708,7 @@
$logger->debug("circulator: building hold transit for ".$copy->barcode);
$trans->hold($hold->id);
- $trans->source($self->editor->requestor->ws_ou);
+ $trans->source($self->circ_lib);
$trans->dest($hold->pickup_lib);
$trans->source_send_time("now");
$trans->target_copy($copy->id);
@@ -2734,11 +2734,11 @@
my $transit = $self->transit;
- if( $transit->dest != $self->editor->requestor->ws_ou ) {
+ if( $transit->dest != $self->circ_lib ) {
# - this item is in-transit to a different location
my $tid = $transit->id;
- my $loc = $self->editor->requestor->ws_ou;
+ my $loc = $self->circ_lib;
my $dest = $transit->dest;
$logger->info("circulator: Fowarding transit on copy which is destined ".
@@ -2873,7 +2873,7 @@
$circ->checkin_scan_time('now');
$circ->checkin_staff($self->editor->requestor->id);
- $circ->checkin_lib($self->editor->requestor->ws_ou);
+ $circ->checkin_lib($self->circ_lib);
$circ->checkin_workstation($self->editor->requestor->wsid);
my $circ_lib = (ref $self->copy->circ_lib) ?
@@ -2885,7 +2885,7 @@
$circ_lib, OILS_SETTING_LOST_IMMEDIATELY_AVAILABLE, $self->editor) || 0;
- if ( (!$lost_immediately_available) && ($circ_lib != $self->editor->requestor->ws_ou) ) {
+ if ( (!$lost_immediately_available) && ($circ_lib != $self->circ_lib) ) {
if( ($stat == OILS_COPY_STATUS_LOST or $stat == OILS_COPY_STATUS_MISSING) ) {
$logger->info("circulator: not updating copy status on checkin because copy is lost/missing");
More information about the open-ils-commits
mailing list