[open-ils-commits] r12489 - trunk/Open-ILS/src/perlmods/OpenILS/Application (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Mar 12 11:55:47 EDT 2009


Author: dbs
Date: 2009-03-12 11:55:45 -0400 (Thu, 12 Mar 2009)
New Revision: 12489

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
Log:
Enable get_org_tree to return an org tree with a locale based on a locale code,
rather than a reference to a variable :)


Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm	2009-03-12 01:13:42 UTC (rev 12488)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm	2009-03-12 15:55:45 UTC (rev 12489)
@@ -1306,12 +1306,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 },
 			{
@@ -1322,7 +1325,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