← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6140: Potential bugs fixed.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 6140 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-02-29 12:23:39 +0100
message:
  Potential bugs fixed.
modified:
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedValues.vm


--
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-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js	2012-02-29 08:35:52 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/app.js	2012-02-29 11:03:54 +0000
@@ -1126,7 +1126,14 @@
                 r = Ext.JSON.decode(r.responseText),
                 values = [];
                 for (var i = 0; i < r.length; i++) {
-                    values.push({d: r[i][0], p: r[i][1], o: r[i][2], v: r[i][3]});
+					var t = r[i][1];
+                    values.push({
+						value: r[i][0],
+						type: t === 'in' ? DV.conf.finals.dimension.indicator.value : t === 'de' ? DV.conf.finals.dimension.dataelement.value : t === 'ds' ? DV.conf.finals.dimension.dataset.value : t,
+						data: r[i][2],
+						period: r[i][3],
+						organisationunit: r[i][4]
+					});
                 }
                 return values;
             }
@@ -1822,7 +1829,7 @@
             
             Ext.Ajax.request({
                 url: baseurl,
-                success: function(r) {                    
+                success: function(r) {
                     DV.value.values = DV.util.value.jsonfy(r);
                     
                     if (!DV.value.values.length) {
@@ -1830,17 +1837,12 @@
                         DV.util.notification.error(DV.i18n.et_no_data, DV.i18n.em_no_data);
                         return;
                     }
-                    
-                    var storage = Ext.Object.merge(
-						DV.store[DV.conf.finals.dimension.indicator.value].available.storage,
-						DV.store[DV.conf.finals.dimension.dataelement.value].available.storage,
-						DV.store[DV.conf.finals.dimension.dataset.value].available.storage
-					);
+					
                     Ext.Array.each(DV.value.values, function(item) {
-                        item[DV.conf.finals.dimension.data.value] = DV.util.string.getEncodedString(storage[item.d].name);
-                        item[DV.conf.finals.dimension.period.value] = DV.util.string.getEncodedString(DV.util.dimension.period.getNameById(item.p));
-                        item[DV.conf.finals.dimension.organisationunit.value] = DV.util.string.getEncodedString(DV.cmp.dimension.organisationunit.treepanel.findNameById(item.o));
-                        item.v = parseFloat(item.v);
+                        item[DV.conf.finals.dimension.data.value] = DV.util.string.getEncodedString(DV.store[item.type].available.storage[item.data].name);
+                        item[DV.conf.finals.dimension.period.value] = DV.util.string.getEncodedString(DV.util.dimension.period.getNameById(item.period));
+                        item[DV.conf.finals.dimension.organisationunit.value] = DV.util.string.getEncodedString(DV.cmp.dimension.organisationunit.treepanel.findNameById(item.organisationunit));
+                        item.v = parseFloat(item.value);
                     });
                     
                     if (exe) {
@@ -4021,7 +4023,6 @@
                                 }
                             }
                         }
-                    
                     ]
                 },
                 bbar: {

=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedValues.vm'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedValues.vm	2012-02-27 16:33:08 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedValues.vm	2012-02-29 11:03:54 +0000
@@ -1,1 +1,1 @@
-#set($indicatorSize = $indicatorValues.size())#set($dataSize = $dataValues.size())#set($dataSetSize = $dataSetValues.size())[#if ($indicatorSize > 0)#foreach($iv in $indicatorValues)["$!{iv.indicatorId}", "$!{iv.periodId}", "$!{iv.organisationUnitId}", "$!{iv.value}", ]#if ($velocityCount < $indicatorSize), #end#end#end#if ($dataSize > 0)#if ($indicatorSize > 0), #end#foreach($dv in $dataValues)["$!{dv.dataElementId}", "$!{dv.periodId}", "$!{dv.organisationUnitId}", "$!{dv.value}"]#if ($velocityCount < $dataSize), #end#end#end#if ($dataSetSize > 0)#if ($indicatorSize > 0 || $dataSize > 0), #end#foreach($dsv in $dataSetValues)["$!{dsv.dataSetId}", "$!{dsv.periodId}", "$!{dsv.organisationUnitId}", "$!{dsv.value}"]#if ($velocityCount < $dataSetSize), #end#end#end]
\ No newline at end of file
+#set($indicatorSize = $indicatorValues.size())#set($dataSize = $dataValues.size())#set($dataSetSize = $dataSetValues.size())[#if ($indicatorSize > 0)#foreach($iv in $indicatorValues)["$!{iv.value}","in","$!{iv.indicatorId}","$!{iv.periodId}","$!{iv.organisationUnitId}"]#if ($velocityCount < $indicatorSize),#end#end#end#if ($dataSize > 0)#if ($indicatorSize > 0),#end#foreach($dv in $dataValues)["$!{dv.value}","de","$!{dv.dataElementId}","$!{dv.periodId}","$!{dv.organisationUnitId}"]#if ($velocityCount < $dataSize),#end#end#end#if ($dataSetSize > 0)#if ($indicatorSize > 0 || $dataSize > 0),#end#foreach($dsv in $dataSetValues)["$!{dsv.value}","ds","$!{dsv.dataSetId}","$!{dsv.periodId}","$!{dsv.organisationUnitId}"]#if ($velocityCount < $dataSetSize),#end#end#end]
\ No newline at end of file