From 9701452cf6d17b6437fe1c45e2952aca9dcada6a Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 15 Jan 2015 15:54:16 -0500 Subject: [PATCH] Revert "LP#1386347 hard-coded queue stats for captured holds" Return to calculating queue position for captured holds from the copy map instead of assuming queue position 1. This reverts commit 23171c7debf33f71ef0d59d2f8b3cdebc8a08f9f. --- Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm index 7d405abb62..4c40d2fec1 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -1381,7 +1381,7 @@ sub retrieve_hold_queue_status_impl { # least one potential copy with the context hold, plus any holds that # share the same hold type and target. The latter part exists to # accomodate holds that currently have no potential copies - my $q_holds = $hold->capture_time ? [] :$e->json_query({ + my $q_holds = $e->json_query({ # fetch cut_in_line and request_time since they're in the order_by # and we're asking for distinct values @@ -1417,14 +1417,12 @@ sub retrieve_hold_queue_status_impl { my $qpos = 1; - if (!$hold->capture_time) { - for my $h (@$q_holds) { - last if $h->{id} == $hold->id; - $qpos++; - } + for my $h (@$q_holds) { + last if $h->{id} == $hold->id; + $qpos++; } - my $hold_data = $hold->capture_time ? [] : $e->json_query({ + my $hold_data = $e->json_query({ select => { acp => [ {column => 'id', transform => 'count', aggregate => 1, alias => 'count'} ], ccm => [ {column =>'avg_wait_time'} ] @@ -1464,7 +1462,6 @@ sub retrieve_hold_queue_status_impl { $num_potentials += $count; } - $num_potentials = 1 if $hold->capture_time; my $estimated_wait = -1; if($num_potentials) { -- 2.11.0