[open-ils-commits] r14756 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Nov 3 18:16:43 EST 2009
Author: erickson
Date: 2009-11-03 18:16:37 -0500 (Tue, 03 Nov 2009)
New Revision: 14756
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
Log:
added support for setting shelf_expire_time to hold requests and clearing shelf expire time on hold reset
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2009-11-03 23:05:47 UTC (rev 14755)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2009-11-03 23:16:37 UTC (rev 14756)
@@ -2081,7 +2081,7 @@
$hold->current_copy($copy->id);
$hold->capture_time('now');
- $hold->shelf_time('now')
+ $self->put_hold_on_shelf($hold)
if $hold->pickup_lib == $self->editor->requestor->ws_ou;
# prevent DB errors caused by fetching
@@ -2242,7 +2242,7 @@
my $hold = $self->editor->retrieve_action_hold_request($hold_transit->hold);
# hold has arrived at destination, set shelf time
- $hold->shelf_time('now');
+ $self->put_hold_on_shelf($hold);
$self->bail_on_events($self->editor->event)
unless $self->editor->update_action_hold_request($hold);
return if $self->bail_out;
@@ -2261,6 +2261,28 @@
}
+# ------------------------------------------------------------------
+# Sets the shelf_time and shelf_expire_time for a newly shelved hold
+# ------------------------------------------------------------------
+sub put_hold_on_shelf {
+ my($self, $hold) = @_;
+
+ $hold->shelf_time('now');
+
+ my $shelf_expire = $U->ou_ancestor_setting_value(
+ $self->circ_lib, 'circ.holds.default_shelf_expire_interval', $self->editor);
+
+ if($shelf_expire) {
+ my $seconds = OpenSRF::Utils->interval_to_seconds($shelf_expire);
+ my $expire_time = DateTime->now->add(seconds => $seconds);
+ $hold->shelf_expire_time($expire_time->strftime('%FT%T%z'));
+ }
+
+ return undef;
+}
+
+
+
sub generate_fines {
my $self = shift;
my $evt;
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2009-11-03 23:05:47 UTC (rev 14755)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2009-11-03 23:16:37 UTC (rev 14756)
@@ -1232,6 +1232,7 @@
$hold->clear_capture_time;
$hold->clear_current_copy;
$hold->clear_shelf_time;
+ $hold->clear_shelf_expire_time;
$e->update_action_hold_request($hold) or return $e->event;
$e->commit;
More information about the open-ils-commits
mailing list