make aggregate and no_i18n flags perl friendly
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 13 Nov 2008 15:10:25 +0000 (15:10 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 13 Nov 2008 15:10:25 +0000 (15:10 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@11159 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/c-apps/oils_cstore.c

index d739035..a4b5321 100644 (file)
@@ -1953,7 +1953,10 @@ static char* SELECT (
 
                            if (is_agg->size || (flags & SELECT_DISTINCT)) {
 
-                                   if (!jsonBoolIsTrue( jsonObjectGetKey( selfield, "aggregate" ) )) {
+                                   if (
+                        !jsonBoolIsTrue( jsonObjectGetKey( selfield, "aggregate" ) ) ||
+                           ((int)jsonObjectGetNumber(jsonObjectGetKey( selfield, "aggregate" ))) == 1 // support 1/0 for perl's sake
+                    ) {
                                            if (gfirst) {
                                                    gfirst = 0;
                                            } else {
@@ -2321,8 +2324,10 @@ static char* buildSELECT ( jsonObject* search_hash, jsonObject* order_hash, osrf
 
             if (locale) {
                        char* i18n = osrfHashGet(field, "i18n");
-                   if (jsonBoolIsTrue(jsonObjectGetKey( order_hash, "no_i18n" )))
-                    i18n = NULL;
+                           if (
+                    !jsonBoolIsTrue( jsonObjectGetKey( order_hash, "no_i18n" ) ) ||
+                    ((int)jsonObjectGetNumber(jsonObjectGetKey( order_hash, "no_i18n" ))) == 1 // support 1/0 for perl's sake
+                ) i18n = NULL;
 
                        if ( i18n && !strncasecmp("true", i18n, 4)) {
                        char* pkey = osrfHashGet(idlClass, "primarykey");