[open-ils-commits] r12503 - branches/rel_1_4_0/Open-ILS/src/perlmods/OpenILS/Application (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Mar 12 21:41:39 EDT 2009


Author: dbs
Date: 2009-03-12 21:41:38 -0400 (Thu, 12 Mar 2009)
New Revision: 12503

Modified:
   branches/rel_1_4_0/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
Log:
Backport r12489 from trunk: enable get_org_tree() to generate localized org tree


Modified: branches/rel_1_4_0/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
===================================================================
--- branches/rel_1_4_0/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm	2009-03-13 01:24:51 UTC (rev 12502)
+++ branches/rel_1_4_0/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm	2009-03-13 01:41:38 UTC (rev 12503)
@@ -1377,12 +1377,15 @@
 }
 
 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 @@
 		]
 	)->[0];
 
-	$cache->put_cache("orgtree.$cache_diff", $tree);
+	$cache->put_cache("orgtree.$locale", $tree);
 	return $tree;
 }
 



More information about the open-ils-commits mailing list