[open-ils-commits] r8020 - trunk/Open-ILS/src/c-apps

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Nov 5 23:12:19 EST 2007


Author: miker
Date: 2007-11-05 22:56:49 -0500 (Mon, 05 Nov 2007)
New Revision: 8020

Modified:
   trunk/Open-ILS/src/c-apps/oils_cstore.c
Log:
ability to turn off i18n

Modified: trunk/Open-ILS/src/c-apps/oils_cstore.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_cstore.c	2007-11-06 03:45:06 UTC (rev 8019)
+++ trunk/Open-ILS/src/c-apps/oils_cstore.c	2007-11-06 03:56:49 UTC (rev 8020)
@@ -18,6 +18,7 @@
 #  define MODULENAME "open-ils.cstore"
 #endif
 
+#define DISABLE_I18N	2
 #define SELECT_DISTINCT	1
 #define AND_OP_JOIN     0
 #define OR_OP_JOIN      1
@@ -1787,6 +1788,8 @@
 				} else {
                     if (locale) {
                 		char* i18n = osrfHashGet(field, "i18n");
+			            if (flags & SELECT_DISTINCT)
+                            i18n = NULL;
 
     	        		if ( i18n && !strncasecmp("true", i18n, 4)) {
         	                char* pkey = osrfHashGet(idlClass, "primarykey");
@@ -2122,6 +2125,8 @@
 
             if (locale) {
         		char* i18n = osrfHashGet(field, "i18n");
+	            if (jsonBoolIsTrue(jsonObjectGetKey( order_hash, "no_i18n" )))
+                    i18n = NULL;
 
     			if ( i18n && !strncasecmp("true", i18n, 4)) {
         	        char* pkey = osrfHashGet(idlClass, "primarykey");
@@ -2312,6 +2317,14 @@
 
 	jsonObject* hash = jsonObjectGetIndex(ctx->params, 0);
 
+    int flags = 0;
+
+	if (jsonBoolIsTrue(jsonObjectGetKey( hash, "distinct" )))
+         flags |= SELECT_DISTINCT;
+
+	if (jsonBoolIsTrue(jsonObjectGetKey( hash, "no_i18n" )))
+         flags |= DISABLE_I18N;
+
 	osrfLogDebug(OSRF_LOG_MARK, "Building SQL ...");
 	char* sql = SELECT(
 			ctx,
@@ -2321,7 +2334,7 @@
 			jsonObjectGetKey( hash, "order_by" ),
 			jsonObjectGetKey( hash, "limit" ),
 			jsonObjectGetKey( hash, "offset" ),
-			jsonBoolIsTrue(jsonObjectGetKey( hash, "distinct" )) ? SELECT_DISTINCT : 0
+			flags
 	);
 
 	if (!sql) {



More information about the open-ils-commits mailing list