From: gmc Date: Fri, 17 Sep 2010 22:48:11 +0000 (+0000) Subject: enable translation of location name in copy location/status summary X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6dcd77e6da92ba3a5f2f7bf01b71527afbb56205;p=evergreen%2Fbjwebb.git enable translation of location name in copy location/status summary Implementation is iffy because it exposes oils_i18n_xlate outside of cstore. Signed-off-by: Galen Charlton git-svn-id: svn://svn.open-ils.org/ILS/trunk@17784 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm index 42557269c..5b609bee7 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm @@ -444,9 +444,16 @@ sub record_copy_status_location_count { my $cl_table = asset::copy_location->table; my $cs_table = config::copy_status->table; + # FIXME using oils_i18n_xlate here is exposing a hitherto unexposed + # implementation detail of json_query; doing it this way because + # json_query currently doesn't grok joining a function to tables my $sql = <<" SQL"; - SELECT cp.circ_lib, cn.label, cl.name, cp.status, count(cp.id) + SELECT cp.circ_lib, + cn.label, + oils_i18n_xlate('asset.copy_location', 'acpl', 'name', 'id', cl.id::TEXT, ?), + cp.status, + count(cp.id) FROM $cp_table cp, $cn_table cn, $cl_table cl, @@ -465,7 +472,8 @@ sub record_copy_status_location_count { SQL my $sth = biblio::record_entry->db_Main->prepare_cached($sql); - $sth->execute($ou, $depth, "$rec" ); + my $ses_locale = $client->session ? $client->session->session_locale : 'en-US'; + $sth->execute($ses_locale, $ou, $depth, "$rec" ); my %data = (); for my $row (@{$sth->fetchall_arrayref}) {