From 961d2805949f998c912ece344556dcedc192a0fc Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Tue, 15 Jul 2014 17:06:50 -0400 Subject: [PATCH] Search for asset stat cat entries by owner in Evergreen driver _init. Signed-off-by: Jason Stephenson --- lib/NCIP/ILS/Evergreen.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/NCIP/ILS/Evergreen.pm b/lib/NCIP/ILS/Evergreen.pm index 41ac7fc..952b2bf 100644 --- a/lib/NCIP/ILS/Evergreen.pm +++ b/lib/NCIP/ILS/Evergreen.pm @@ -310,13 +310,14 @@ sub _init { my $asce = $e->retrieve_asset_stat_cat_entry($_->{id}); push(@{$self->{asces}}, $asce) if ($asce); } elsif ($_->{asc} && $_->{name}) { - # We may actually want to retrieve the ancestor tree - # beginning with $self->{config}->{work_ou} and limit the - # next search where the owner is one of those org units. + # We want to limit the search to the work org and its + # ancestors. + my $ancestors = $U->get_org_ancestors($self->{config}->{work_ou}); my $result = $e->search_asset_stat_cat_entry( { stat_cat => $_->{asc}, - value => $_->{name} + value => $_->{name}, + owner => $ancestors } ); if ($result && @$result) { -- 2.43.2