[open-ils-commits] r9339 -
trunk/Open-ILS/src/perlmods/OpenILS/Application
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Apr 14 10:10:04 EDT 2008
Author: erickson
Date: 2008-04-14 09:32:05 -0400 (Mon, 14 Apr 2008)
New Revision: 9339
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
Log:
augmented the org descendants retrieval method to take an optional list of orgs
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2008-04-14 13:32:00 UTC (rev 9338)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2008-04-14 13:32:05 UTC (rev 9339)
@@ -1048,11 +1048,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