← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19961: ER, ER, valueType, WIP

 

------------------------------------------------------------
revno: 19961
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-09-03 12:15:10 +0200
message:
  ER, ER, valueType, WIP
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/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-event-reports/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js	2015-08-08 10:16:11 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js	2015-09-03 10:15:10 +0000
@@ -4123,7 +4123,7 @@
                 var layoutWindow = ns.app.aggregateLayoutWindow;
 
                 this.each( function(record) {
-                    if (Ext.Array.contains(['int', 'number'], (record.data.valueType || record.data.type))) {
+                    if (Ext.Array.contains(['int', 'number'], record.data.valueType)) {
                         layoutWindow.valueStore.add(record.data);
                     }
                 });
@@ -4472,7 +4472,7 @@
             }
             else {
                 Ext.Ajax.request({
-                    url: ns.core.init.contextPath + '/api/programStages.json?filter=id:eq:' + stageId + '&fields=programStageDataElements[dataElement[id,' + ns.core.init.namePropertyUrl + ',type,optionSet[id,name]]]',
+                    url: ns.core.init.contextPath + '/api/programStages.json?filter=id:eq:' + stageId + '&fields=programStageDataElements[dataElement[id,' + ns.core.init.namePropertyUrl + ',valueType,optionSet[id,name]]]',
                     success: function(r) {
                         var objects = Ext.decode(r.responseText).programStages,
                             dataElements;
@@ -4688,7 +4688,6 @@
 			var getUxType,
 				ux;
 
-            element.type = element.type || element.valueType;
 			index = index || dataElementSelected.items.items.length;
 
 			getUxType = function(element) {
@@ -4697,19 +4696,19 @@
 					return 'Ext.ux.panel.OrganisationUnitGroupSetContainer';
 				}
 
-				if (element.type === 'int' || element.type === 'number') {
+				if (element.valueType === 'int' || element.valueType === 'number') {
 					return 'Ext.ux.panel.DataElementIntegerContainer';
 				}
 
-				if (element.type === 'string') {
+				if (element.valueType === 'string') {
 					return 'Ext.ux.panel.DataElementStringContainer';
 				}
 
-				if (element.type === 'date') {
+				if (element.valueType === 'date') {
 					return 'Ext.ux.panel.DataElementDateContainer';
 				}
 
-				if (element.type === 'bool' || element.type === 'trueOnly') {
+				if (element.valueType === 'bool' || element.valueType === 'trueOnly') {
 					return 'Ext.ux.panel.DataElementBooleanContainer';
 				}
 
@@ -4788,7 +4787,7 @@
 				element = dataElements[i];
 				allElements.push(element);
 
-				if (element.type === 'int' && element.filter) {
+				if (element.valueType === 'int' && element.filter) {
 					a = element.filter.split(':');
 					numberOfElements = a.length / 2;
 
@@ -4810,7 +4809,6 @@
 			// panel, store
             for (var i = 0, element, ux, store; i < allElements.length; i++) {
 				element = allElements[i];
-                element.type = element.type || element.valueType;
                 element.name = element.name || element.displayName;
                 recordMap[element.id] = element;
 
@@ -4823,7 +4821,7 @@
                     }
                 }
 
-                store = Ext.Array.contains(includeKeys, element.type) || element.optionSet ? aggWindow.rowStore : aggWindow.fixedFilterStore;
+                store = Ext.Array.contains(includeKeys, element.valueType) || element.optionSet ? aggWindow.rowStore : aggWindow.fixedFilterStore;
 
                 aggWindow.addDimension(element, store, valueStore);
                 queryWindow.colStore.add(element);
@@ -4866,7 +4864,7 @@
 					for (var i = 0, store, record, dim; i < layout.filters.length; i++) {
                         dim = layout.filters[i];
 						record = recordMap[dim.dimension];
-						store = Ext.Array.contains(includeKeys, element.type) || element.optionSet ? aggWindow.filterStore : aggWindow.fixedFilterStore;
+						store = Ext.Array.contains(includeKeys, element.valueType) || element.optionSet ? aggWindow.filterStore : aggWindow.fixedFilterStore;
 
                         //aggWindow.addDimension(record || extendDim(Ext.clone(dim)), store, null, true);
                         store.add(record || extendDim(Ext.clone(dim)));

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js	2015-08-09 15:59:13 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js	2015-09-03 10:15:10 +0000
@@ -3795,7 +3795,7 @@
                 var layoutWindow = ns.app.aggregateLayoutWindow;
 
                 this.each( function(record) {
-                    if (Ext.Array.contains(['int', 'number'], (record.data.valueType || record.data.type))) {
+                    if (Ext.Array.contains(['int', 'number'], record.data.valueType)) {
                         layoutWindow.valueStore.add(record.data);
                     }
                 });
@@ -4140,7 +4140,7 @@
             }
             else {
                 Ext.Ajax.request({
-                    url: ns.core.init.contextPath + '/api/programStages.json?filter=id:eq:' + stageId + '&fields=programStageDataElements[dataElement[id,' + ns.core.init.namePropertyUrl + ',type,optionSet[id,name]]]',
+                    url: ns.core.init.contextPath + '/api/programStages.json?filter=id:eq:' + stageId + '&fields=programStageDataElements[dataElement[id,' + ns.core.init.namePropertyUrl + ',valueType,optionSet[id,name]]]',
                     success: function(r) {
                         var objects = Ext.decode(r.responseText).programStages,
                             dataElements;
@@ -4356,7 +4356,6 @@
 			var getUxType,
 				ux;
 
-            element.type = element.type || element.valueType;
 			index = index || dataElementSelected.items.items.length;
 
 			getUxType = function(element) {
@@ -4365,19 +4364,19 @@
 					return 'Ext.ux.panel.OrganisationUnitGroupSetContainer';
 				}
 
-				if (element.type === 'int' || element.type === 'number') {
+				if (element.valueType === 'int' || element.valueType === 'number') {
 					return 'Ext.ux.panel.DataElementIntegerContainer';
 				}
 
-				if (element.type === 'string') {
+				if (element.valueType === 'string') {
 					return 'Ext.ux.panel.DataElementStringContainer';
 				}
 
-				if (element.type === 'date') {
+				if (element.valueType === 'date') {
 					return 'Ext.ux.panel.DataElementDateContainer';
 				}
 
-				if (element.type === 'bool' || element.type === 'trueOnly') {
+				if (element.valueType === 'bool' || element.valueType === 'trueOnly') {
 					return 'Ext.ux.panel.DataElementBooleanContainer';
 				}
 
@@ -4456,7 +4455,7 @@
 				element = dataElements[i];
 				allElements.push(element);
 
-				if (element.type === 'int' && element.filter) {
+				if (element.valueType === 'int' && element.filter) {
 					a = element.filter.split(':');
 					numberOfElements = a.length / 2;
 
@@ -4478,7 +4477,6 @@
 			// panel, store
             for (var i = 0, element, ux, store; i < allElements.length; i++) {
 				element = allElements[i];
-                element.type = element.type || element.valueType;
                 element.name = element.name || element.displayName;
                 recordMap[element.id] = element;
 
@@ -4491,7 +4489,7 @@
                     }
                 }
 
-                store = Ext.Array.contains(includeKeys, element.type) || element.optionSet ? aggWindow.colStore : aggWindow.fixedFilterStore;
+                store = Ext.Array.contains(includeKeys, element.valueType) || element.optionSet ? aggWindow.colStore : aggWindow.fixedFilterStore;
 
                 aggWindow.addDimension(element, store, valueStore);
                 //queryWindow.colStore.add(element);
@@ -4534,7 +4532,7 @@
 					for (var i = 0, store, record, dim; i < layout.filters.length; i++) {
                         dim = layout.filters[i];
 						record = recordMap[dim.dimension];
-						store = Ext.Array.contains(includeKeys, element.type) || element.optionSet ? aggWindow.filterStore : aggWindow.fixedFilterStore;
+						store = Ext.Array.contains(includeKeys, element.valueType) || element.optionSet ? aggWindow.filterStore : aggWindow.fixedFilterStore;
 
                         //aggWindow.addDimension(record || extendDim(Ext.clone(dim)), store, null, true);
                         store.add(record || extendDim(Ext.clone(dim)));