Enable get_org_tree to return an org tree with a locale based on a locale code,
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 12 Mar 2009 15:55:45 +0000 (15:55 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 12 Mar 2009 15:55:45 +0000 (15:55 +0000)
rather than a reference to a variable :)

git-svn-id: svn://svn.open-ils.org/ILS/trunk@12489 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm

index c1518cf..8735c1b 100644 (file)
@@ -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;
 }