← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19797: DV operand bug fixed.

 

------------------------------------------------------------
revno: 19797
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-08-19 20:17:02 +0200
message:
  DV operand bug fixed.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/core.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/core.js	2015-08-10 07:42:21 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/core.js	2015-08-19 18:17:02 +0000
@@ -1773,8 +1773,18 @@
 
 						return false;
 					}(),
-					ou = dimConf.organisationUnit.objectName,
-					layout;
+                    co = dimConf.category.objectName,
+                    ou = dimConf.organisationUnit.objectName,
+                    headerNames = function() {
+                        var headerNames = [];
+
+                        for (var i = 0; i < response.headers.length; i++) {
+                            headerNames.push(response.headers[i].name);
+                        }
+
+                        return headerNames;
+                    }(),
+                    layout;
 
 				// set items from init/metaData/xLayout
                 for (var i = 0, dim, metaDataDim, items; i < dimensions.length; i++) {
@@ -2288,33 +2298,35 @@
                     paramString = '?',
                     addCategoryDimension = false,
                     map = xLayout.dimensionNameItemsMap,
-                    dx = dimConf.indicator.dimensionName,
+					dx = dimConf.indicator.dimensionName,
+					co = dimConf.category.dimensionName,
                     aggTypes = ['COUNT', 'SUM', 'STDDEV', 'VARIANCE', 'MIN', 'MAX'],
                     displayProperty = xLayout.displayProperty || init.userAccount.settings.keyAnalysisDisplayProperty || 'name';
 
                 for (var i = 0, dimName, items; i < axisDimensionNames.length; i++) {
                     dimName = axisDimensionNames[i];
 
-                    paramString += 'dimension=' + dimName;
-
-                    items = Ext.clone(dimensionNameIdsMap[dimName]);
-
-                    if (dimName === dx) {
-                        for (var j = 0, index; j < items.length; j++) {
-                            index = items[j].indexOf('#');
-
-                            if (index > 0) {
-                                addCategoryDimension = true;
-                                items[j] = items[j].substr(0, index);
-                            }
-                        }
-
-                        items = Ext.Array.unique(items);
-                    }
-
-                    if (dimName !== dimConf.category.dimensionName) {
-                        paramString += ':' + items.join(';');
-                    }
+					paramString += 'dimension=' + dimName;
+
+					items = Ext.clone(dimensionNameIdsMap[dimName]);
+
+					if (dimName === dx) {
+						//for (var j = 0, index; j < items.length; j++) {
+							//index = items[j].indexOf('#');
+
+							//if (index > 0) {
+								//addCategoryDimension = true;
+								//items[j] = items[j].substr(0, index);
+                                //items[j] = items[j].replace('#', '.');
+							//}
+						//}
+
+						items = Ext.Array.unique(items);
+					}
+
+					if (dimName !== co) {
+						paramString += ':' + items.join(';');
+					}
 
                     if (i < (axisDimensionNames.length - 1)) {
                         paramString += '&';
@@ -2463,7 +2475,7 @@
                         obj[conf.finals.data.domain] = xResponse.metaData.names[category];
 
                         for (var j = 0, id, value; j < columnIds.length; j++) {
-                            id = support.prototype.str.replaceAll(columnIds[j], '#', '') + support.prototype.str.replaceAll(rowIds[i], '#', '');
+                            id = support.prototype.str.replaceAll(columnIds[j], '#', '.') + support.prototype.str.replaceAll(rowIds[i], '#', '.');
                             value = xResponse.idValueMap[id];
                             rowValues.push(value);
 
@@ -2914,7 +2926,10 @@
                     else {
                         for (var i = 0, id, name, mxl, ids; i < store.rangeFields.length; i++) {
                             id = failSafeColumnIdMap[store.rangeFields[i]];
-                            name = xResponse.metaData.names[id];
+
+                            if (Ext.isString(id)) {
+                                name = xResponse.metaData.names[id.replace('#', '.')];
+                            }
 
                             if (ls && ls.labelMaxLength) {
                                 var mxl = parseInt(ls.labelMaxLength);