[open-ils-commits] r8636 -
trunk/Open-ILS/src/perlmods/OpenILS/Application
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Feb 5 11:21:08 EST 2008
Author: erickson
Date: 2008-02-05 10:52:44 -0500 (Tue, 05 Feb 2008)
New Revision: 8636
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
Log:
repaired descendant logic for initial high perm org
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm 2008-02-05 15:25:14 UTC (rev 8635)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm 2008-02-05 15:52:44 UTC (rev 8636)
@@ -1304,17 +1304,19 @@
return [] if $high_org_id == -1; # not allowed anywhere
- push(@allowed_orgs, $high_org_id);
+
my $high_org = $self->find_org($org_tree, $high_org_id);
-
my ($high_org_type) = grep { $_->id == $high_org->ou_type } @$org_types;
- return [$high_org_id] if $high_org_type->depth == 0;
+ my $org_depth = $high_org_type->depth;
- # now that we have the highest depth, find the org in the tree relative to
- # each work org at that depth.
- my ($org_type) = grep { $_->id == $high_org->ou_type } @$org_types;
- my $org_depth = $org_type->depth;
+ if($$options{descendants}) {
+ push(@allowed_orgs, @{$self->get_org_descendants($high_org_id, $org_depth)});
+ } else {
+ push(@allowed_orgs, $high_org_id);
+ }
+ return \@allowed_orgs if $org_depth == 0;
+
for my $org (@$work_orgs) {
$logger->debug("work org looking at $org");
More information about the open-ils-commits
mailing list