[open-ils-commits] r7707 -
trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Aug 20 20:28:57 EDT 2007
Author: miker
Date: 2007-08-20 20:24:16 -0400 (Mon, 20 Aug 2007)
New Revision: 7707
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
Log:
add optional hold age requirement to nearest_hold method
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm 2007-08-18 09:01:23 UTC (rev 7706)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm 2007-08-21 00:24:16 UTC (rev 7707)
@@ -183,14 +183,20 @@
my $pl = shift;
my $cp = shift;
my $limit = int(shift()) || 10;
+ my $age = shift() || '0 seconds';
- my $ids = action::hold_request->db_Main->selectcol_arrayref(<<" SQL", {}, $cp, $pl);
+ my $age_where = '';
+ if ($age) {
+ $age_where = "
+
+ my $ids = action::hold_request->db_Main->selectcol_arrayref(<<" SQL", {}, $cp, $pl, $age);
SELECT h.id
FROM action.hold_request h
JOIN action.hold_copy_map hm ON (hm.hold = h.id)
JOIN actor.org_unit_proximity p ON (p.from_org = h.pickup_lib)
WHERE hm.target_copy = ?
AND p.to_org = ?
+ AND AGE(h.request_time) > ?
AND h.capture_time IS NULL
AND h.cancel_time IS NULL
ORDER BY
More information about the open-ils-commits
mailing list