From: dbs Date: Thu, 12 Mar 2009 15:55:45 +0000 (+0000) Subject: Enable get_org_tree to return an org tree with a locale based on a locale code, X-Git-Tag: sprint4-merge-nov22~10544 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7e761578d5a1c3ea0a51597d6d6f2d0c3fe3e316;p=working%2FEvergreen.git Enable get_org_tree to return an org tree with a locale based on a locale code, rather than a reference to a variable :) git-svn-id: svn://svn.open-ils.org/ILS/trunk@12489 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm index c1518cf3fd..8735c1b118 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm @@ -1306,12 +1306,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 }, { @@ -1322,7 +1325,7 @@ sub get_org_tree { ] )->[0]; - $cache->put_cache("orgtree.$cache_diff", $tree); + $cache->put_cache("orgtree.$locale", $tree); return $tree; }