From 7ac3db5220ca3be05abde3415f62ac72e1991c06 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 27 Mar 2018 17:53:29 -0400 Subject: [PATCH] JBAS-2005 Hold queue pos API uses rhrr Consistent with BC hold queue pos function, we now determine the hold queue position by comparing holds that target the same bib. Uses the newly materialized (as of 2.12) reporter.hold_request_record table. Signed-off-by: Bill Erickson --- .../perlmods/lib/OpenILS/Application/Circ/Holds.pm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 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 83a8faa791..43f4bbd308 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -1373,21 +1373,27 @@ sub retrieve_hold_queue_status_impl { # fetch cut_in_line and request_time since they're in the order_by # and we're asking for distinct values + # + # KCLS JBAS-2005 Pull hold queue position from newly + # materialized reporter.hold_request_record grouping + # in targeted bib record. select => {ahr => ['id', 'cut_in_line', 'request_time']}, from => 'ahr', where => { + fulfillment_time => undef, + cancel_time => undef, id => { in => { - select => { ahcm => ['hold'] }, + select => { rhrr => ['id'] }, from => { - 'ahcm' => { - 'ahcm2' => { - 'class' => 'ahcm', - 'field' => 'target_copy', - 'fkey' => 'target_copy' + 'rhrr' => { + 'rhrr2' => { + 'class' => 'rhrr', + 'field' => 'bib_record', + 'fkey' => 'bib_record' } } }, - where => { '+ahcm2' => { hold => $hold->id } }, + where => { '+rhrr2' => { id => $hold->id } }, distinct => 1 }} }, -- 2.11.0