allow differentiation of orgtree cache keys; use this to cache per-locale trees
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 21 May 2008 16:37:30 +0000 (16:37 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 21 May 2008 16:37:30 +0000 (16:37 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@9654 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index a38ad7e..768d7e5 100644 (file)
@@ -1035,8 +1035,9 @@ __PACKAGE__->register_method(
 );
 
 sub get_org_tree {
-       my( $self, $client) = @_;
-    return $U->get_org_tree();
+       my $self = shift;
+       my $client = shift;
+    return $U->get_org_tree($client->session->session_locale);
 }
 
 
index 1404008..91237b4 100644 (file)
@@ -1368,8 +1368,9 @@ sub get_org_types {
 }
 
 sub get_org_tree {
+       my $cache_diff = shift || '';
        my $cache = OpenSRF::Utils::Cache->new("global", 0);
-       my $tree = $cache->get_cache('orgtree');
+       my $tree = $cache->get_cache("orgtree.$cache_diff");
        return $tree if $tree;
 
        $tree = OpenILS::Utils::CStoreEditor->new->search_actor_org_unit( 
@@ -1383,7 +1384,7 @@ sub get_org_tree {
                ]
        )->[0];
 
-       $cache->put_cache('orgtree', $tree);
+       $cache->put_cache("orgtree.$cache_diff", $tree);
        return $tree;
 }