[open-ils-commits] r9876 -
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Jun 19 11:57:10 EDT 2008
Author: erickson
Date: 2008-06-19 11:57:08 -0400 (Thu, 19 Jun 2008)
New Revision: 9876
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
Log:
added support for setting hold expire time using an interval defined in the org unit setting
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2008-06-19 15:46:24 UTC (rev 9875)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2008-06-19 15:57:08 UTC (rev 9876)
@@ -18,10 +18,12 @@
use base qw/OpenILS::Application/;
use strict; use warnings;
use OpenILS::Application::AppUtils;
+use DateTime;
use Data::Dumper;
use OpenSRF::EX qw(:try);
use OpenILS::Perm;
use OpenILS::Event;
+use OpenSRF::Utils;
use OpenSRF::Utils::Logger qw(:logger);
use OpenILS::Utils::CStoreEditor q/:funcs/;
use OpenILS::Utils::PermitHold;
@@ -34,6 +36,7 @@
+
__PACKAGE__->register_method(
method => "create_hold",
api_name => "open-ils.circ.holds.create",
@@ -138,6 +141,13 @@
}
}
+ # set the configured expire time
+ my $interval = $U->ou_ancestor_setting_value($recipient->home_ou, OILS_SETTING_HOLD_EXPIRE);
+ if($interval) {
+ my $date = DateTime->now->add(seconds => OpenSRF::Utils::interval_to_seconds($interval));
+ $hold->expire_time($U->epoch2ISO8601($date->epoch));
+ }
+
$hold->requestor($e->requestor->id);
$hold->request_lib($e->requestor->ws_ou);
$hold->selection_ou($hold->pickup_lib) unless $hold->selection_ou;
More information about the open-ils-commits
mailing list