From b187c456ebac6f015a5f386dd54cc66050871a8a Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 10 Jul 2009 14:45:50 +0000 Subject: [PATCH] added ancestor at depth util function git-svn-id: svn://svn.open-ils.org/ILS/trunk@13560 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm index c20c18eebf..c69d2e1f4d 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm @@ -1326,6 +1326,14 @@ sub get_org_full_path { 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) = @_; -- 2.11.0