← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19991: PT removed value type filtering for data items.

 

------------------------------------------------------------
revno: 19991
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-09-04 11:06:49 +0200
message:
  PT removed value type filtering for data items.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.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-pivot/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js	2015-08-19 21:26:45 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js	2015-09-04 09:06:49 +0000
@@ -4404,7 +4404,7 @@
             }
 
             Ext.Ajax.request({
-                url: ns.core.init.contextPath + '/api/programs.json?paging=false&fields=programTrackedEntityAttributes[trackedEntityAttribute[id,name,valueType]],programStages[programStageDataElements[dataElement[id,name,type]]]&filter=id:eq:' + programId,
+                url: ns.core.init.contextPath + '/api/programs.json?paging=false&fields=programTrackedEntityAttributes[trackedEntityAttribute[id,name,valueType]],programStages[programStageDataElements[dataElement[id,name,valueType]]]&filter=id:eq:' + programId,
                 success: function(r) {
                     r = Ext.decode(r.responseText);
 
@@ -4423,22 +4423,25 @@
                         stage = stages[i];
 
                         if (isA(stage.programStageDataElements) && stage.programStageDataElements.length) {
-                            elements = Ext.Array.pluck(stage.programStageDataElements, 'dataElement') || [];
+                            //elements = Ext.Array.pluck(stage.programStageDataElements, 'dataElement') || [];
+                            dataElements = dataElements.concat(Ext.Array.pluck(stage.programStageDataElements, 'dataElement') || []);
 
-                            for (var j = 0; j < elements.length; j++) {
-                                if (Ext.Array.contains(types, (elements[j].type || '').toLowerCase())) {
-                                    dataElements.push(elements[j]);
-                                }
-                            }
+                            //for (var j = 0; j < elements.length; j++) {
+                                //if (Ext.Array.contains(types, (elements[j].type || '').toLowerCase())) {
+                                    //dataElements.push(elements[j]);
+                                //}
+                            //}
                         }
                     }
 
                     // attributes
-                    for (i = 0; i < teas.length; i++) {
-                        if (Ext.Array.contains(types, (teas[i].valueType || '').toLowerCase())) {
-                            attributes.push(teas[i]);
-                        }
-                    }
+
+                    //for (i = 0; i < teas.length; i++) {
+                        //if (Ext.Array.contains(types, (teas[i].valueType || '').toLowerCase())) {
+                            //attributes.push(teas[i]);
+                        //}
+                    //}
+                    attributes = teas;
 
                     data = ns.core.support.prototype.array.sort(Ext.Array.clean([].concat(dataElements, attributes))) || [];