From b048818991f7a027d76d8ba7e5abb7f7660e7c58 Mon Sep 17 00:00:00 2001 From: Jason Boyer Date: Fri, 3 Feb 2017 16:23:28 -0500 Subject: [PATCH] LP1661747: get_org_unit_ancestor_at_depth Helper Add a helper to the A/T system to retrieve an ou's ancestor at the specified depth in the tree. Signed-off-by: Jason Boyer Signed-off-by: Mike Rylander --- Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm index 7b96edb7d8..0df0ab08ba 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm @@ -106,6 +106,13 @@ $_TT_helpers = { return new_editor()->retrieve_actor_org_unit($org_id); }, + get_org_unit_ancestor_at_depth => sub { + my $org_id = shift; + my $depth = shift; + $org_id = $org_id->id if ref $org_id; + return new_editor()->retrieve_actor_org_unit($U->org_unit_ancestor_at_depth($org_id, $depth)); + }, + # given a copy, returns the title and author in a hash get_copy_bib_basics => sub { my $copy_id = shift; -- 2.11.0