From 592c20daa8442cdeb60713271e9391fa23bd68b6 Mon Sep 17 00:00:00 2001 From: dbs Date: Fri, 13 Mar 2009 01:23:04 +0000 Subject: [PATCH] Backport r12489 from trunk: enable get_org_tree() to generate localized org tree git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_4@12501 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm index 4e5acf6ccc..e9bb29bec5 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm @@ -1377,12 +1377,15 @@ sub get_org_types { } sub get_org_tree { - my $cache_diff = shift || ''; + my $self = shift; + my $locale = shift || ''; my $cache = OpenSRF::Utils::Cache->new("global", 0); - my $tree = $cache->get_cache("orgtree.$cache_diff"); + my $tree = $cache->get_cache("orgtree.$locale"); return $tree if $tree; - $tree = OpenILS::Utils::CStoreEditor->new->search_actor_org_unit( + my $ses = OpenILS::Utils::CStoreEditor->new; + $ses->session->session_locale($locale); + $tree = $ses->search_actor_org_unit( [ {"parent_ou" => undef }, { @@ -1393,7 +1396,7 @@ sub get_org_tree { ] )->[0]; - $cache->put_cache("orgtree.$cache_diff", $tree); + $cache->put_cache("orgtree.$locale", $tree); return $tree; } -- 2.11.0