From eb03c13a79f79ff46836a07077a963b6bb10ceec Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 14 Nov 2012 09:49:40 -0500 Subject: [PATCH] ou hiding : filter hold counts pickup lib; part 2 Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm index 4497c33d8d..0b96721aca 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm @@ -378,13 +378,24 @@ sub prepare_browse_call_numbers { sub get_hold_copy_summary { my ($self, $rec_id, $org) = @_; + my $ctx = $self->ctx; my $search = OpenSRF::AppSession->create('open-ils.search'); my $req1 = $search->request( 'open-ils.search.biblio.record.copy_count', $org, $rec_id); + # if org unit hiding applies, limit the hold count to holds + # whose pickup library is equal to or "below" the root of + # our hiding depth-scoped tree + my $count_args = {}; + while ($org and $ctx->{org_within_hiding_scope}->($org)) { + $count_args->{pickup_lib_descendant} = $org; + $org = $ctx->{get_aou}->($org)->parent_ou; + } + $self->ctx->{record_hold_count} = $U->simplereq( - 'open-ils.circ', 'open-ils.circ.bre.holds.count', $rec_id); + 'open-ils.circ', 'open-ils.circ.bre.holds.count', + $rec_id, $count_args); $self->ctx->{copy_summary} = $req1->recv->content; -- 2.11.0