------------------------------------------------------------ revno: 19998 committer: Jan Henrik Overland <janhenrik.overl...@gmail.com> branch nick: dhis2 timestamp: Fri 2015-09-04 16:37:08 +0200 message: PT DV value types updated. modified: dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/core.js 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/core.js dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js 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-event-reports/scripts/core.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/core.js 2015-09-03 10:58:40 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/core.js 2015-09-04 14:37:08 +0000 @@ -159,7 +159,7 @@ booleanTypes: ['BOOLEAN','TRUE_ONLY'], dateTypes: ['DATE','DATETIME'], aggregateTypes: ['NUMBER','UNIT_INTERVAL','PERCENTAGE','INTEGER','INTEGER_POSITIVE','INTEGER_NEGATIVE','INTEGER_ZERO_OR_POSITIVE','BOOLEAN','TRUE_ONLY'] - } + }; for (var i = 0, obj; i < conf.aggregationType.data.length; i++) { obj = conf.aggregationType.data[i]; === 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-09-04 09:07:52 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js 2015-09-04 14:37:08 +0000 @@ -4415,7 +4415,7 @@ teas = isO(program) && isA(program.programTrackedEntityAttributes) ? Ext.Array.pluck(program.programTrackedEntityAttributes, 'trackedEntityAttribute') : [], dataElements = [], attributes = [], - types = ['int', 'string', 'bool', 'trueonly', 'number', 'optionSet'], + types = ns.core.conf.valueType.aggregateTypes, data; // data elements @@ -4423,25 +4423,22 @@ stage = stages[i]; if (isA(stage.programStageDataElements) && stage.programStageDataElements.length) { - //elements = Ext.Array.pluck(stage.programStageDataElements, 'dataElement') || []; - dataElements = dataElements.concat(Ext.Array.pluck(stage.programStageDataElements, 'dataElement') || []); + elements = 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].valueType)) { + 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]); - //} - //} - attributes = teas; + for (i = 0; i < teas.length; i++) { + if (Ext.Array.contains(types, teas[i].valueType)) { + attributes.push(teas[i]); + } + } data = ns.core.support.prototype.array.sort(Ext.Array.clean([].concat(dataElements, attributes))) || []; === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core.js 2015-09-02 18:25:31 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core.js 2015-09-04 14:37:08 +0000 @@ -174,6 +174,14 @@ relativePeriods: [] }; + conf.valueType = { + numericTypes: ['NUMBER','UNIT_INTERVAL','PERCENTAGE','INTEGER','INTEGER_POSITIVE','INTEGER_NEGATIVE','INTEGER_ZERO_OR_POSITIVE'], + textTypes: ['TEXT','LONG_TEXT','LETTER','PHONE_NUMBER','EMAIL'], + booleanTypes: ['BOOLEAN','TRUE_ONLY'], + dateTypes: ['DATE','DATETIME'], + aggregateTypes: ['NUMBER','UNIT_INTERVAL','PERCENTAGE','INTEGER','INTEGER_POSITIVE','INTEGER_NEGATIVE','INTEGER_ZERO_OR_POSITIVE','BOOLEAN','TRUE_ONLY'] + }; + conf.layout = { west_width: 424, west_fieldset_width: 418, === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js 2015-08-19 21:30:33 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/app.js 2015-09-04 14:37:08 +0000 @@ -4476,7 +4476,7 @@ } Ext.Ajax.request({ - url: ns.core.init.contextPath + '/api/programs.json?paging=false&fields=programTrackedEntityAttributes[trackedEntityAttribute[id,name]],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); @@ -4487,7 +4487,7 @@ teas = isO(program) && isA(program.programTrackedEntityAttributes) ? Ext.Array.pluck(program.programTrackedEntityAttributes, 'trackedEntityAttribute') : [], dataElements = [], attributes = [], - types = ['int', 'number', 'string', 'bool', 'trueonly'], + types = ns.core.conf.valueType.aggregateTypes, data; // data elements @@ -4498,7 +4498,7 @@ elements = Ext.Array.pluck(stage.programStageDataElements, 'dataElement') || []; for (var j = 0; j < elements.length; j++) { - if (Ext.Array.contains(types, (elements[j].type || '').toLowerCase())) { + if (Ext.Array.contains(types, elements[j].valueType)) { dataElements.push(elements[j]); } } @@ -4507,7 +4507,7 @@ // attributes for (i = 0; i < teas.length; i++) { - if (Ext.Array.contains(types, (teas[i].type || '').toLowerCase())) { + if (Ext.Array.contains(types, teas[i].valueType)) { attributes.push(teas[i]); } } === 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-09-02 18:25:31 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/core.js 2015-09-04 14:37:08 +0000 @@ -668,6 +668,14 @@ ] }; + conf.valueType = { + numericTypes: ['NUMBER','UNIT_INTERVAL','PERCENTAGE','INTEGER','INTEGER_POSITIVE','INTEGER_NEGATIVE','INTEGER_ZERO_OR_POSITIVE'], + textTypes: ['TEXT','LONG_TEXT','LETTER','PHONE_NUMBER','EMAIL'], + booleanTypes: ['BOOLEAN','TRUE_ONLY'], + dateTypes: ['DATE','DATETIME'], + aggregateTypes: ['NUMBER','UNIT_INTERVAL','PERCENTAGE','INTEGER','INTEGER_POSITIVE','INTEGER_NEGATIVE','INTEGER_ZERO_OR_POSITIVE','BOOLEAN','TRUE_ONLY'] + }; + conf.layout = { west_width: 424, west_fieldset_width: 418,
_______________________________________________ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp