put the frozen (and also empty issuance or last-copy-removed) check back in as a...
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 24 Sep 2010 17:56:31 +0000 (17:56 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 24 Sep 2010 17:56:31 +0000 (17:56 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17957 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm

index 0181969..030aa11 100644 (file)
@@ -1060,6 +1060,28 @@ sub retrieve_hold_queue_status_impl {
         } 
     });
 
+    if (!@$q_holds) { # none? maybe we don't have a map ... 
+        my $q_holds = $e->json_query({
+            select => {ahr => ['id', 'cut_in_line', 'request_time']},
+            from   => 'ahr',
+            order_by => [
+                {
+                    "class" => "ahr",
+                    "field" => "cut_in_line",
+                    "transform" => "coalesce",
+                    "params" => [ 0 ],
+                    "direction" => "desc"
+                },
+                { "class" => "ahr", "field" => "request_time" }
+            ],
+            where    => {
+                hold_type => $hold->hold_type, 
+                target    => $hold->target 
+           } 
+        });
+    }
+
+
     my $qpos = 1;
     for my $h (@$q_holds) {
         last if $h->{id} == $hold->id;