[open-ils-commits] r8637 -
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Feb 5 11:21:12 EST 2008
Author: erickson
Date: 2008-02-05 10:52:52 -0500 (Tue, 05 Feb 2008)
New Revision: 8637
Modified:
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
Log:
repaired descendant logic for initial high perm org
Modified: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm 2008-02-05 15:52:44 UTC (rev 8636)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm 2008-02-05 15:52:52 UTC (rev 8637)
@@ -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