From a22b4ca185b890bbdd25bdd1a8a4f93e18513c24 Mon Sep 17 00:00:00 2001 From: miker Date: Thu, 22 May 2008 19:54:45 +0000 Subject: [PATCH] adding locale param to org unit fetcher git-svn-id: svn://svn.open-ils.org/ILS/trunk@9672 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/extras/org_tree_js.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/extras/org_tree_js.pl b/Open-ILS/src/extras/org_tree_js.pl index 342b576cdb..670e6ca4c1 100644 --- a/Open-ILS/src/extras/org_tree_js.pl +++ b/Open-ILS/src/extras/org_tree_js.pl @@ -13,6 +13,8 @@ use OpenSRF::Utils::Cache; die "usage: perl org_tree_js.pl " 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 @@ require OpenILS::Utils::CStoreEditor; 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 } ); -- 2.43.2