[open-ils-commits] r8666 -
trunk/Open-ILS/src/perlmods/OpenILS/Application
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Feb 6 13:02:20 EST 2008
Author: erickson
Date: 2008-02-06 12:33:51 -0500 (Wed, 06 Feb 2008)
New Revision: 8666
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
Log:
using shared build_org_tree in apputils
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2008-02-06 17:14:41 UTC (rev 8665)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2008-02-06 17:33:51 UTC (rev 8666)
@@ -1036,33 +1036,6 @@
}
-# turns an org list into an org tree
-sub build_org_tree {
-
- my( $self, $orglist) = @_;
-
- return $orglist unless ref $orglist;
- return $$orglist[0] if @$orglist == 1;
-
- my @list = sort {
- $a->ou_type <=> $b->ou_type ||
- $a->name cmp $b->name } @$orglist;
-
- for my $org (@list) {
-
- next unless ($org and defined($org->parent_ou));
- my ($parent) = grep { $_->id == $org->parent_ou } @list;
- next unless $parent;
-
- $parent->children([]) unless defined($parent->children);
- push( @{$parent->children}, $org );
- }
-
- return $list[0];
-
-}
-
-
__PACKAGE__->register_method(
method => "get_org_descendants",
api_name => "open-ils.actor.org_tree.descendants.retrieve"
@@ -1075,7 +1048,7 @@
"open-ils.storage",
"open-ils.storage.actor.org_unit.descendants.atomic",
$org_unit, $depth );
- return $self->build_org_tree($orglist);
+ return $U->build_org_tree($orglist);
}
@@ -1091,7 +1064,7 @@
"open-ils.storage",
"open-ils.storage.actor.org_unit.ancestors.atomic",
$org_unit, $depth );
- return $self->build_org_tree($orglist);
+ return $U->build_org_tree($orglist);
}
More information about the open-ils-commits
mailing list