[open-ils-commits] r9337 -
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Apr 14 10:08:47 EDT 2008
Author: erickson
Date: 2008-04-14 09:30:49 -0400 (Mon, 14 Apr 2008)
New Revision: 9337
Modified:
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
Log:
augmented the org descendants retrieval method to take an optional list of orgs
Modified: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2008-04-14 13:24:05 UTC (rev 9336)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2008-04-14 13:30:49 UTC (rev 9337)
@@ -1045,11 +1045,26 @@
# depth is optional. org_unit is the id
sub get_org_descendants {
my( $self, $client, $org_unit, $depth ) = @_;
- my $orglist = $apputils->simple_scalar_request(
- "open-ils.storage",
- "open-ils.storage.actor.org_unit.descendants.atomic",
- $org_unit, $depth );
- return $U->build_org_tree($orglist);
+
+ if(ref $org_unit eq 'ARRAY') {
+ $depth ||= [];
+ my @trees;
+ for my $i (0..scalar(@$org_unit)-1) {
+ my $list = $U->simple_scalar_request(
+ "open-ils.storage",
+ "open-ils.storage.actor.org_unit.descendants.atomic",
+ $org_unit->[$i], $depth->[$i] );
+ push(@trees, $U->build_org_tree($list));
+ }
+ return \@trees;
+
+ } else {
+ my $orglist = $apputils->simple_scalar_request(
+ "open-ils.storage",
+ "open-ils.storage.actor.org_unit.descendants.atomic",
+ $org_unit, $depth );
+ return $U->build_org_tree($orglist);
+ }
}
More information about the open-ils-commits
mailing list