[open-ils-commits] r7929 -
trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Oct 25 12:21:47 EDT 2007
Author: miker
Date: 2007-10-25 12:07:53 -0400 (Thu, 25 Oct 2007)
New Revision: 7929
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
Log:
correcting think-o in the nearest-hold logic
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm 2007-10-25 15:47:15 UTC (rev 7928)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm 2007-10-25 16:07:53 UTC (rev 7929)
@@ -204,25 +204,18 @@
sub nearest_hold {
my $self = shift;
my $client = shift;
- my $pl = shift;
+ my $here = shift;
my $cp = shift;
my $limit = int(shift()) || 10;
my $age = shift() || '0 seconds';
- my $depth = shift;
- my $descendents =
- defined($depth) ?
- "actor.org_unit_descendants($pl, $depth)" :
- "actor.org_unit_descendants($pl)" ;
-
- my $ids = action::hold_request->db_Main->selectcol_arrayref(<<" SQL", {}, $pl, $cp, $age);
+ my $ids = action::hold_request->db_Main->selectcol_arrayref(<<" SQL", {}, $here, $cp, $age);
SELECT h.id
FROM action.hold_request h
+ JOIN actor.org_unit_proximity p ON (p.from_org = ? AND p.to_org = h.pickup_lib)
JOIN action.hold_copy_map hm ON (hm.hold = h.id)
- JOIN $descendents d ON (d.id = h.pickup_lib)
- JOIN actor.org_unit_proximity p ON (p.from_org = ? AND p.to_org = d.id)
WHERE hm.target_copy = ?
- AND AGE(NOW(),h.request_time) >= CAST(? AS INTERVAL)
+ AND (AGE(NOW(),h.request_time) >= CAST(? AS INTERVAL) OR p.prox = 0)
AND h.capture_time IS NULL
AND h.cancel_time IS NULL
ORDER BY
More information about the open-ils-commits
mailing list