[open-ils-commits] r13560 - trunk/Open-ILS/src/perlmods/OpenILS/Application (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Jul 10 10:45:52 EDT 2009


Author: erickson
Date: 2009-07-10 10:45:50 -0400 (Fri, 10 Jul 2009)
New Revision: 13560

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
Log:
added ancestor at depth util function

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm	2009-07-09 21:19:04 UTC (rev 13559)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm	2009-07-10 14:45:50 UTC (rev 13560)
@@ -1326,6 +1326,14 @@
     return [ map {$_->{id}} @$org_list ];
 }
 
+# returns the ID of the org unit ancestor at the specified depth
+sub org_unit_ancestor_at_depth {
+    my($class, $org_id, $depth) = @_;
+    my $resp = OpenILS::Utils::CStoreEditor->new->json_query(
+        {from => ['actor.org_unit_ancestor_at_depth', $org_id, $depth]})->[0];
+    return ($resp) ? $resp->{id} : undef;
+}
+
 # returns the user's configured locale as a string.  Defaults to en-US if none is configured.
 sub get_user_locale {
 	my($self, $user_id, $e) = @_;



More information about the open-ils-commits mailing list