[open-ils-commits] r9672 - trunk/Open-ILS/src/extras

svn at svn.open-ils.org svn at svn.open-ils.org
Thu May 22 15:54:48 EDT 2008


Author: miker
Date: 2008-05-22 15:54:45 -0400 (Thu, 22 May 2008)
New Revision: 9672

Modified:
   trunk/Open-ILS/src/extras/org_tree_js.pl
Log:
adding locale param to org unit fetcher

Modified: trunk/Open-ILS/src/extras/org_tree_js.pl
===================================================================
--- trunk/Open-ILS/src/extras/org_tree_js.pl	2008-05-22 19:44:21 UTC (rev 9671)
+++ trunk/Open-ILS/src/extras/org_tree_js.pl	2008-05-22 19:54:45 UTC (rev 9672)
@@ -13,6 +13,8 @@
 die "usage: perl org_tree_js.pl <bootstrap_config>" unless $ARGV[0];
 OpenSRF::System->bootstrap_client(config_file => $ARGV[0]);
 
+my $locale = $ARGV[1];
+
 Fieldmapper->import(IDL => OpenSRF::Utils::SettingsClient->new->config_value("IDL"));
 
 # must be loaded after the IDL is parsed
@@ -20,15 +22,17 @@
 
 warn "removing OrgTree from the cache...\n";
 my $cache = OpenSRF::Utils::Cache->new;
-$cache->delete_cache('orgtree');
+$cache->delete_cache("orgtree.$locale");
 
 # fetch the org_unit's and org_unit_type's
 my $e = OpenILS::Utils::CStoreEditor->new;
+$e->session->session_locale($locale) if ($locale);
+
 my $types = $e->retrieve_all_actor_org_unit_type;
 my $tree = $e->request(
     'open-ils.cstore.direct.actor.org_unit.search.atomic',
     {id => {"!=" => undef}},
-    {order_by => {aou => 'name'}}
+    {order_by => {aou => 'name'}, no_i18n => $locale ? 0 : 1 }
 );
 
 



More information about the open-ils-commits mailing list