From 4ac15b3e6418a5806292e0085220a313a5481835 Mon Sep 17 00:00:00 2001 From: miker Date: Mon, 4 Oct 2010 16:17:31 +0000 Subject: [PATCH] Backport r18151 from trunk: add support for hold_priority sorting in open-ils.storage.action.hold_request.nearest_hold git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6@18152 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 ba76a0299f..b04e06934e 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm @@ -285,13 +285,15 @@ sub nearest_hold { my $age = shift() || '0 seconds'; my $fifo = shift(); - my $holdsort = $fifo ? "h.request_time, h.selection_depth DESC, p.prox " : "p.prox, h.selection_depth DESC, h.request_time "; + my $holdsort = $fifo ? "pgt.hold_priority, h.request_time, h.selection_depth DESC, p.prox " : "p.prox, pgt.hold_priority, h.selection_depth DESC, h.request_time "; 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 actor.usr au ON (au.id = h.usr) + JOIN permission.grp_tree pgt ON (au.profile = pgt.id) WHERE hm.target_copy = ? AND (AGE(NOW(),h.request_time) >= CAST(? AS INTERVAL) OR p.prox = 0) AND h.capture_time IS NULL -- 2.11.0