[open-ils-commits] r17784 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher (gmc)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Sep 17 18:48:11 EDT 2010


Author: gmc
Date: 2010-09-17 18:48:11 -0400 (Fri, 17 Sep 2010)
New Revision: 17784

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm
Log:
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 <gmc at esilibrary.com>


Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm	2010-09-17 22:16:47 UTC (rev 17783)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/biblio.pm	2010-09-17 22:48:11 UTC (rev 17784)
@@ -444,9 +444,16 @@
 	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 @@
 	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}) {



More information about the open-ils-commits mailing list