From: miker Date: Thu, 25 Oct 2007 16:07:53 +0000 (+0000) Subject: correcting think-o in the nearest-hold logic X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d32a91f0313be4847c7eca465619e1645b509aec;p=Evergreen.git correcting think-o in the nearest-hold logic git-svn-id: svn://svn.open-ils.org/ILS/trunk@7929 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm index 76aa0dad7a..83d0d0bb98 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm @@ -204,25 +204,18 @@ __PACKAGE__->register_method( 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