dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #41813
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21337: ER EV support for db translations.
------------------------------------------------------------
revno: 21337
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-12-04 15:38:50 +0100
message:
ER EV support for db translations.
modified:
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/plugin.html
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/core.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/eventreport.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/plugin.html
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/core.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/eventchart.js
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventchart.js
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventreport.js
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/table.js
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventchart.js
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventreport.js
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.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/plugin.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/plugin.html 2015-09-11 20:35:00 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/plugin.html 2015-12-04 14:38:50 +0000
@@ -21,7 +21,7 @@
DHIS.getEventReport({
url: url,
el: 'table1',
- uid: 'Eb7MEQK3AVq'
+ uid: 'aDrb9UMVxt0'
});
});
</script>
=== 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-10-21 15:24:49 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js 2015-12-04 14:38:50 +0000
@@ -3200,7 +3200,7 @@
this.currentValue = this.getValue();
var value = this.getValue(),
- url = value ? ns.core.init.contextPath + '/api/eventReports.json?fields=id,name,access&filter=name:like:' + value : null;
+ url = value ? ns.core.init.contextPath + '/api/eventReports.json?fields=id,name,access&filter=name:ilike:' + value : null;
store = ns.app.stores.eventReport;
store.page = 1;
@@ -3216,7 +3216,7 @@
text: NS.i18n.prev,
handler: function() {
var value = searchTextfield.getValue(),
- url = value ? ns.core.init.contextPath + '/api/eventReports?fields=id,name,access' + (value ? '&filter=name:like:' + value : '') : null,
+ url = value ? ns.core.init.contextPath + '/api/eventReports?fields=id,name,access' + (value ? '&filter=name:ilike:' + value : '') : null,
store = ns.app.stores.eventReport;
store.page = store.page <= 1 ? 1 : store.page - 1;
@@ -3228,7 +3228,7 @@
text: NS.i18n.next,
handler: function() {
var value = searchTextfield.getValue(),
- url = value ? ns.core.init.contextPath + '/api/eventReports.json?fields=id,name,access' + (value ? '&filter=name:like:' + value : '') : null,
+ url = value ? ns.core.init.contextPath + '/api/eventReports.json?fields=id,name,access' + (value ? '&filter=name:ilike:' + value : '') : null,
store = ns.app.stores.eventReport;
store.page = store.page + 1;
@@ -4068,7 +4068,10 @@
accBaseWidth = baseWidth - 2,
conf = ns.core.conf,
- rp = conf.period.relativePeriods;
+ rp = conf.period.relativePeriods,
+
+ namePropertyUrl = ns.core.init.namePropertyUrl,
+ nameProperty = ns.core.init.userAccount.settings.keyAnalysisDisplayProperty;
// stores
@@ -4076,7 +4079,7 @@
fields: ['id', 'name'],
proxy: {
type: 'ajax',
- url: ns.core.init.contextPath + '/api/programs.json?fields=id,name&paging=false',
+ url: ns.core.init.contextPath + '/api/programs.json?fields=id,' + namePropertyUrl + '&paging=false',
reader: {
type: 'json',
root: 'programs'
@@ -4385,7 +4388,7 @@
}
else {
Ext.Ajax.request({
- url: ns.core.init.contextPath + '/api/programs.json?filter=id:eq:' + programId + '&fields=programStages[id,name],programIndicators[id,name],programTrackedEntityAttributes[trackedEntityAttribute[id,' + ns.core.init.namePropertyUrl + ',valueType,optionSet[id,name],legendSet[id,name]]]&paging=false',
+ url: ns.core.init.contextPath + '/api/programs.json?filter=id:eq:' + programId + '&fields=programStages[id,displayName|rename(name)],programIndicators[id,' + namePropertyUrl + '],programTrackedEntityAttributes[trackedEntityAttribute[id,' + namePropertyUrl + ',valueType,optionSet[id,displayName|rename(name)],legendSet[id,displayName|rename(name)]]]&paging=false',
success: function(r) {
var program = Ext.decode(r.responseText).programs[0],
stages,
@@ -4511,7 +4514,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 + ',valueType,optionSet[id,name],legendSet|rename(storageLegendSet)[id,name]]]',
+ url: ns.core.init.contextPath + '/api/programStages.json?filter=id:eq:' + stageId + '&fields=programStageDataElements[dataElement[id,' + namePropertyUrl + ',valueType,optionSet[id,displayName|rename(name)],legendSet|rename(storageLegendSet)[id,displayName|rename(name)]]]',
success: function(r) {
var objects = Ext.decode(r.responseText).programStages,
dataElements;
@@ -8428,20 +8431,26 @@
// init
var defaultKeyUiLocale = 'en',
- defaultKeyAnalysisDisplayProperty = 'name',
+ defaultKeyAnalysisDisplayProperty = 'displayName',
+ displayPropertyMap = {
+ 'name': 'displayName',
+ 'displayName': 'displayName',
+ 'shortName': 'displayShortName',
+ 'displayShortName': 'displayShortName'
+ },
namePropertyUrl,
contextPath,
keyUiLocale,
dateFormat;
init.userAccount.settings.keyUiLocale = init.userAccount.settings.keyUiLocale || defaultKeyUiLocale;
- init.userAccount.settings.keyAnalysisDisplayProperty = init.userAccount.settings.keyAnalysisDisplayProperty || defaultKeyAnalysisDisplayProperty;
+ init.userAccount.settings.keyAnalysisDisplayProperty = displayPropertyMap[init.userAccount.settings.keyAnalysisDisplayProperty] || defaultKeyAnalysisDisplayProperty;
// local vars
contextPath = init.contextPath;
keyUiLocale = init.userAccount.settings.keyUiLocale;
keyAnalysisDisplayProperty = init.userAccount.settings.keyAnalysisDisplayProperty;
- namePropertyUrl = keyAnalysisDisplayProperty === defaultKeyAnalysisDisplayProperty ? keyAnalysisDisplayProperty : keyAnalysisDisplayProperty + '|rename(' + defaultKeyAnalysisDisplayProperty + ')';
+ namePropertyUrl = keyAnalysisDisplayProperty + '|rename(name)';
dateFormat = init.systemInfo.dateFormat;
init.namePropertyUrl = namePropertyUrl;
@@ -8514,7 +8523,7 @@
// root nodes
requests.push({
- url: contextPath + '/api/organisationUnits.json?userDataViewFallback=true&paging=false&fields=id,' + namePropertyUrl + ',children[id,' + namePropertyUrl + ']',
+ url: contextPath + '/api/organisationUnits.json?userDataViewFallback=true&paging=false&fields=id,' + namePropertyUrl,
success: function(r) {
init.rootNodes = Ext.decode(r.responseText).organisationUnits || [];
fn();
@@ -8523,7 +8532,7 @@
// organisation unit levels
requests.push({
- url: contextPath + '/api/organisationUnitLevels.json?fields=id,name,level&paging=false',
+ url: contextPath + '/api/organisationUnitLevels.json?fields=id,' + namePropertyUrl + ',level&paging=false',
success: function(r) {
init.organisationUnitLevels = Ext.decode(r.responseText).organisationUnitLevels || [];
@@ -8568,7 +8577,7 @@
// legend sets
requests.push({
- url: contextPath + '/api/legendSets.json?fields=id,name,legends[id,name,startValue,endValue,color]&paging=false',
+ url: contextPath + '/api/legendSets.json?fields=id,displayName|rename(name),legends[id,displayName|rename(name),startValue,endValue,color]&paging=false',
success: function(r) {
init.legendSets = Ext.decode(r.responseText).legendSets || [];
fn();
@@ -8577,7 +8586,7 @@
// dimensions
requests.push({
- url: init.contextPath + '/api/organisationUnitGroupSets.json?fields=id,' + namePropertyUrl + '&paging=false',
+ url: contextPath + '/api/dimensions.json?fields=id,' + namePropertyUrl + '&paging=false',
success: function(r) {
init.dimensions = Ext.decode(r.responseText).organisationUnitGroupSets || [];
fn();
=== 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-10-20 15:42:15 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/core.js 2015-12-04 14:38:50 +0000
@@ -2478,7 +2478,15 @@
dimensions = Ext.Array.clean([].concat(view.columns || [], view.rows || [])),
ignoreKeys = ['dy', 'longitude', 'latitude'],
dataTypeMap = {},
- nameItemsMap;
+ nameItemsMap,
+ propertyMap = {
+ 'name': 'name',
+ 'displayName': 'name',
+ 'shortName': 'shortName',
+ 'displayShortName': 'shortName'
+ },
+ keyAnalysisDisplayProperty = init.userAccount.settings.keyAnalysisDisplayProperty,
+ displayProperty = propertyMap[keyAnalysisDisplayProperty] || propertyMap[xLayout.displayProperty] || 'name';
dataTypeMap[conf.finals.dataType.aggregated_values] = 'aggregate';
dataTypeMap[conf.finals.dataType.individual_cases] = 'query';
@@ -2601,7 +2609,7 @@
}
// display property
- paramString += '&displayProperty=' + init.userAccount.settings.keyAnalysisDisplayProperty.toUpperCase();
+ paramString += '&displayProperty=' + displayProperty.toUpperCase();
// collapse data items
if (view.collapseDataDimensions) {
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/eventreport.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/eventreport.js 2015-10-12 11:52:06 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/eventreport.js 2015-12-04 14:38:50 +0000
@@ -2509,7 +2509,15 @@
dimensions = Ext.Array.clean([].concat(view.columns || [], view.rows || [])),
ignoreKeys = ['dy', 'longitude', 'latitude'],
dataTypeMap = {},
- nameItemsMap;
+ nameItemsMap,
+ propertyMap = {
+ 'name': 'name',
+ 'displayName': 'name',
+ 'shortName': 'shortName',
+ 'displayShortName': 'shortName'
+ },
+ keyAnalysisDisplayProperty = init.userAccount.settings.keyAnalysisDisplayProperty,
+ displayProperty = propertyMap[keyAnalysisDisplayProperty] || propertyMap[xLayout.displayProperty] || 'name';
dataTypeMap[conf.finals.dataType.aggregated_values] = 'aggregate';
dataTypeMap[conf.finals.dataType.individual_cases] = 'query';
@@ -2632,7 +2640,7 @@
}
// display property
- paramString += '&displayProperty=' + init.userAccount.settings.keyAnalysisDisplayProperty.toUpperCase();
+ paramString += '&displayProperty=' + displayProperty.toUpperCase();
// collapse data items
if (view.collapseDataDimensions) {
@@ -3607,8 +3615,9 @@
for (var j = 0, str, header, name; j < dimensionHeaders.length; j++) {
header = dimensionHeaders[j];
+ isBoolean = header.type === 'java.lang.Boolean';
str = row[header.index];
- str = optionNames[header.name + str] || optionNames[str] || booleanNames[str] || names[str] || str;
+ str = optionNames[header.name + str] || optionNames[str] || (isBoolean ? booleanNames[str] : null) || names[str] || str;
name = web.report.query.format(str);
//if (header.name === 'ouname' && layout.showHierarchy) {
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/plugin.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/plugin.html 2015-10-15 11:18:43 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/plugin.html 2015-12-04 14:38:50 +0000
@@ -28,7 +28,7 @@
DHIS.getEventChart({
url: url,
el: 'report1',
- id: 'lUhwbwHKnSe'
+ id: 'WIxuUpm5m4U'
});
//DHIS.getEventChart({
=== 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-10-15 11:18:43 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js 2015-12-04 14:38:50 +0000
@@ -3669,6 +3669,7 @@
// cache
stageStorage = {},
attributeStorage = {},
+ programIndicatorStorage = {},
dataElementStorage = {},
// gui
@@ -3751,7 +3752,10 @@
accBaseWidth = baseWidth - 2,
conf = ns.core.conf,
- rp = conf.period.relativePeriods;
+ rp = conf.period.relativePeriods,
+
+ namePropertyUrl = ns.core.init.namePropertyUrl,
+ nameProperty = ns.core.init.userAccount.settings.keyAnalysisDisplayProperty;
// stores
@@ -3759,7 +3763,7 @@
fields: ['id', 'name'],
proxy: {
type: 'ajax',
- url: ns.core.init.contextPath + '/api/programs.json?fields=id,name&paging=false',
+ url: ns.core.init.contextPath + '/api/programs.json?fields=id,' + namePropertyUrl + '&paging=false',
reader: {
type: 'json',
root: 'programs'
@@ -4041,11 +4045,12 @@
}
else {
Ext.Ajax.request({
- url: ns.core.init.contextPath + '/api/programs.json?filter=id:eq:' + programId + '&fields=programStages[id,name],programTrackedEntityAttributes[trackedEntityAttribute[id,' + ns.core.init.namePropertyUrl + ',valueType,optionSet[id,name]]]&paging=false',
+ url: ns.core.init.contextPath + '/api/programs.json?filter=id:eq:' + programId + '&fields=programStages[id,displayName|rename(name)],programIndicators[id,' + namePropertyUrl + '],programTrackedEntityAttributes[trackedEntityAttribute[id,' + namePropertyUrl + ',valueType,optionSet[id,displayName|rename(name)],legendSet[id,displayName|rename(name)]]]&paging=false',
success: function(r) {
var program = Ext.decode(r.responseText).programs[0],
stages,
attributes,
+ programIndicators,
stageId;
if (!program) {
@@ -4054,6 +4059,7 @@
stages = program.programStages;
attributes = Ext.Array.pluck(program.programTrackedEntityAttributes, 'trackedEntityAttribute');
+ programIndicators = program.programIndicators;
// mark as attribute
for (var i = 0; i < attributes.length; i++) {
@@ -4065,6 +4071,16 @@
attributeStorage[programId] = attributes;
}
+ // mark as program indicator
+ for (var i = 0; i < programIndicators.length; i++) {
+ programIndicators[i].isProgramIndicator = true;
+ }
+
+ // program indicator cache
+ if (Ext.isArray(programIndicators) && programIndicators.length) {
+ programIndicatorStorage[programId] = programIndicators;
+ }
+
if (Ext.isArray(stages) && stages.length) {
// stages cache
@@ -4154,7 +4170,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 + ',valueType,optionSet[id,name]]]',
+ url: ns.core.init.contextPath + '/api/programStages.json?filter=id:eq:' + stageId + '&fields=programStageDataElements[dataElement[id,' + namePropertyUrl + ',valueType,optionSet[id,displayName|rename(name)],legendSet|rename(storageLegendSet)[id,displayName|rename(name)]]]',
success: function(r) {
var objects = Ext.decode(r.responseText).programStages,
dataElements;
@@ -5436,7 +5452,7 @@
format: 'json',
noCache: false,
extraParams: {
- fields: 'children[id,' + ns.core.init.namePropertyUrl + ',children::isNotEmpty|rename(hasChildren)&paging=false'
+ fields: 'children[id,' + namePropertyUrl + ',children::isNotEmpty|rename(hasChildren)&paging=false'
},
url: ns.core.init.contextPath + '/api/organisationUnits',
reader: {
@@ -8067,20 +8083,26 @@
// init
var defaultKeyUiLocale = 'en',
- defaultKeyAnalysisDisplayProperty = 'name',
+ defaultKeyAnalysisDisplayProperty = 'displayName',
+ displayPropertyMap = {
+ 'name': 'displayName',
+ 'displayName': 'displayName',
+ 'shortName': 'displayShortName',
+ 'displayShortName': 'displayShortName'
+ },
namePropertyUrl,
contextPath,
keyUiLocale,
dateFormat;
init.userAccount.settings.keyUiLocale = init.userAccount.settings.keyUiLocale || defaultKeyUiLocale;
- init.userAccount.settings.keyAnalysisDisplayProperty = init.userAccount.settings.keyAnalysisDisplayProperty || defaultKeyAnalysisDisplayProperty;
+ init.userAccount.settings.keyAnalysisDisplayProperty = displayPropertyMap[init.userAccount.settings.keyAnalysisDisplayProperty] || defaultKeyAnalysisDisplayProperty;
// local vars
contextPath = init.contextPath;
keyUiLocale = init.userAccount.settings.keyUiLocale;
keyAnalysisDisplayProperty = init.userAccount.settings.keyAnalysisDisplayProperty;
- namePropertyUrl = keyAnalysisDisplayProperty === defaultKeyAnalysisDisplayProperty ? keyAnalysisDisplayProperty : keyAnalysisDisplayProperty + '|rename(' + defaultKeyAnalysisDisplayProperty + ')';
+ namePropertyUrl = keyAnalysisDisplayProperty + '|rename(name)';
dateFormat = init.systemInfo.dateFormat;
init.namePropertyUrl = namePropertyUrl;
@@ -8153,7 +8175,7 @@
// root nodes
requests.push({
- url: contextPath + '/api/organisationUnits.json?userDataViewFallback=true&paging=false&fields=id,' + namePropertyUrl + ',children[id,' + namePropertyUrl + ']',
+ url: contextPath + '/api/organisationUnits.json?userDataViewFallback=true&paging=false&fields=id,' + namePropertyUrl,
success: function(r) {
init.rootNodes = Ext.decode(r.responseText).organisationUnits || [];
fn();
@@ -8162,7 +8184,7 @@
// organisation unit levels
requests.push({
- url: contextPath + '/api/organisationUnitLevels.json?fields=id,name,level&paging=false',
+ url: contextPath + '/api/organisationUnitLevels.json?fields=id,' + namePropertyUrl + ',level&paging=false',
success: function(r) {
init.organisationUnitLevels = Ext.decode(r.responseText).organisationUnitLevels || [];
@@ -8207,7 +8229,7 @@
// legend sets
requests.push({
- url: contextPath + '/api/legendSets.json?fields=id,name,legends[id,name,startValue,endValue,color]&paging=false',
+ url: contextPath + '/api/legendSets.json?fields=id,displayName|rename(name),legends[id,displayName|rename(name),startValue,endValue,color]&paging=false',
success: function(r) {
init.legendSets = Ext.decode(r.responseText).legendSets || [];
fn();
@@ -8216,7 +8238,7 @@
// dimensions
requests.push({
- url: init.contextPath + '/api/organisationUnitGroupSets.json?fields=id,' + namePropertyUrl + '&paging=false',
+ url: contextPath + '/api/dimensions.json?fields=id,' + namePropertyUrl + '&paging=false',
success: function(r) {
init.dimensions = Ext.decode(r.responseText).organisationUnitGroupSets || [];
fn();
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/core.js 2015-10-15 11:18:43 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/core.js 2015-12-04 14:38:50 +0000
@@ -3060,7 +3060,15 @@
dataTypeMap = {
'aggregated_values': 'aggregate'
},
- nameItemsMap;
+ nameItemsMap,
+ propertyMap = {
+ 'name': 'name',
+ 'displayName': 'name',
+ 'shortName': 'shortName',
+ 'displayShortName': 'shortName'
+ },
+ keyAnalysisDisplayProperty = init.userAccount.settings.keyAnalysisDisplayProperty,
+ displayProperty = propertyMap[keyAnalysisDisplayProperty] || propertyMap[xLayout.displayProperty] || 'name';
paramString = '/api/analytics/events/aggregate/' + layout.program.id + '.' + (format || 'json') + '?';
@@ -3157,7 +3165,7 @@
}
// display property
- paramString += '&displayProperty=' + init.userAccount.settings.keyAnalysisDisplayProperty.toUpperCase();
+ paramString += '&displayProperty=' + displayProperty.toUpperCase();
// collapse data items
if (layout.collapseDataDimensions) {
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/eventchart.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/eventchart.js 2015-10-15 11:18:43 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/eventchart.js 2015-12-04 14:38:50 +0000
@@ -1017,7 +1017,7 @@
// sortOrder: number
- // outputType: string ('EVENT') - 'EVENT', 'TRACKED_ENTITY_IEVTANCE', 'ENROLLMENT'
+ // outputType: string ('EVENT') - 'EVENT', 'TRACKED_ENTITY_INSTANCE', 'ENROLLMENT'
// rangeAxisMaxValue: number
@@ -3117,7 +3117,15 @@
dataTypeMap = {
'aggregated_values': 'aggregate'
},
- nameItemsMap;
+ nameItemsMap,
+ propertyMap = {
+ 'name': 'name',
+ 'displayName': 'name',
+ 'shortName': 'shortName',
+ 'displayShortName': 'shortName'
+ },
+ keyAnalysisDisplayProperty = init.userAccount.settings.keyAnalysisDisplayProperty,
+ displayProperty = propertyMap[keyAnalysisDisplayProperty] || propertyMap[xLayout.displayProperty] || 'name';
paramString = '/api/analytics/events/aggregate/' + layout.program.id + '.' + (format || 'json') + '?';
@@ -3214,7 +3222,7 @@
}
// display property
- paramString += '&displayProperty=' + init.userAccount.settings.keyAnalysisDisplayProperty.toUpperCase();
+ paramString += '&displayProperty=' + displayProperty.toUpperCase();
// collapse data items
if (layout.collapseDataDimensions) {
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventchart.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventchart.js 2015-10-15 11:18:43 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventchart.js 2015-12-04 14:38:50 +0000
@@ -1017,7 +1017,7 @@
// sortOrder: number
- // outputType: string ('EVENT') - 'EVENT', 'TRACKED_ENTITY_IEVTANCE', 'ENROLLMENT'
+ // outputType: string ('EVENT') - 'EVENT', 'TRACKED_ENTITY_INSTANCE', 'ENROLLMENT'
// rangeAxisMaxValue: number
@@ -3117,7 +3117,15 @@
dataTypeMap = {
'aggregated_values': 'aggregate'
},
- nameItemsMap;
+ nameItemsMap,
+ propertyMap = {
+ 'name': 'name',
+ 'displayName': 'name',
+ 'shortName': 'shortName',
+ 'displayShortName': 'shortName'
+ },
+ keyAnalysisDisplayProperty = init.userAccount.settings.keyAnalysisDisplayProperty,
+ displayProperty = propertyMap[keyAnalysisDisplayProperty] || propertyMap[xLayout.displayProperty] || 'name';
paramString = '/api/analytics/events/aggregate/' + layout.program.id + '.' + (format || 'json') + '?';
@@ -3214,7 +3222,7 @@
}
// display property
- paramString += '&displayProperty=' + init.userAccount.settings.keyAnalysisDisplayProperty.toUpperCase();
+ paramString += '&displayProperty=' + displayProperty.toUpperCase();
// collapse data items
if (layout.collapseDataDimensions) {
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventreport.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventreport.js 2015-10-12 11:52:06 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/eventreport.js 2015-12-04 14:38:50 +0000
@@ -2509,7 +2509,15 @@
dimensions = Ext.Array.clean([].concat(view.columns || [], view.rows || [])),
ignoreKeys = ['dy', 'longitude', 'latitude'],
dataTypeMap = {},
- nameItemsMap;
+ nameItemsMap,
+ propertyMap = {
+ 'name': 'name',
+ 'displayName': 'name',
+ 'shortName': 'shortName',
+ 'displayShortName': 'shortName'
+ },
+ keyAnalysisDisplayProperty = init.userAccount.settings.keyAnalysisDisplayProperty,
+ displayProperty = propertyMap[keyAnalysisDisplayProperty] || propertyMap[xLayout.displayProperty] || 'name';
dataTypeMap[conf.finals.dataType.aggregated_values] = 'aggregate';
dataTypeMap[conf.finals.dataType.individual_cases] = 'query';
@@ -2632,7 +2640,7 @@
}
// display property
- paramString += '&displayProperty=' + init.userAccount.settings.keyAnalysisDisplayProperty.toUpperCase();
+ paramString += '&displayProperty=' + displayProperty.toUpperCase();
// collapse data items
if (view.collapseDataDimensions) {
@@ -3607,8 +3615,9 @@
for (var j = 0, str, header, name; j < dimensionHeaders.length; j++) {
header = dimensionHeaders[j];
+ isBoolean = header.type === 'java.lang.Boolean';
str = row[header.index];
- str = optionNames[header.name + str] || optionNames[str] || booleanNames[str] || names[str] || str;
+ str = optionNames[header.name + str] || optionNames[str] || (isBoolean ? booleanNames[str] : null) || names[str] || str;
name = web.report.query.format(str);
//if (header.name === 'ouname' && layout.showHierarchy) {
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/table.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/table.js 2015-12-03 15:58:11 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/table.js 2015-12-04 14:38:50 +0000
@@ -3208,7 +3208,6 @@
keyUiLocale = init.userAccount.settings.keyUiLocale;
keyAnalysisDisplayProperty = init.userAccount.settings.keyAnalysisDisplayProperty;
namePropertyUrl = keyAnalysisDisplayProperty + '|rename(name)';
- dateFormat = init.systemInfo.dateFormat;
init.namePropertyUrl = namePropertyUrl;
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventchart.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventchart.js 2015-10-15 11:18:43 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventchart.js 2015-12-04 14:38:50 +0000
@@ -1017,7 +1017,7 @@
// sortOrder: number
- // outputType: string ('EVENT') - 'EVENT', 'TRACKED_ENTITY_IEVTANCE', 'ENROLLMENT'
+ // outputType: string ('EVENT') - 'EVENT', 'TRACKED_ENTITY_INSTANCE', 'ENROLLMENT'
// rangeAxisMaxValue: number
@@ -3117,7 +3117,15 @@
dataTypeMap = {
'aggregated_values': 'aggregate'
},
- nameItemsMap;
+ nameItemsMap,
+ propertyMap = {
+ 'name': 'name',
+ 'displayName': 'name',
+ 'shortName': 'shortName',
+ 'displayShortName': 'shortName'
+ },
+ keyAnalysisDisplayProperty = init.userAccount.settings.keyAnalysisDisplayProperty,
+ displayProperty = propertyMap[keyAnalysisDisplayProperty] || propertyMap[xLayout.displayProperty] || 'name';
paramString = '/api/analytics/events/aggregate/' + layout.program.id + '.' + (format || 'json') + '?';
@@ -3214,7 +3222,7 @@
}
// display property
- paramString += '&displayProperty=' + init.userAccount.settings.keyAnalysisDisplayProperty.toUpperCase();
+ paramString += '&displayProperty=' + displayProperty.toUpperCase();
// collapse data items
if (layout.collapseDataDimensions) {
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventreport.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventreport.js 2015-10-12 11:52:06 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/eventreport.js 2015-12-04 14:38:50 +0000
@@ -2509,7 +2509,15 @@
dimensions = Ext.Array.clean([].concat(view.columns || [], view.rows || [])),
ignoreKeys = ['dy', 'longitude', 'latitude'],
dataTypeMap = {},
- nameItemsMap;
+ nameItemsMap,
+ propertyMap = {
+ 'name': 'name',
+ 'displayName': 'name',
+ 'shortName': 'shortName',
+ 'displayShortName': 'shortName'
+ },
+ keyAnalysisDisplayProperty = init.userAccount.settings.keyAnalysisDisplayProperty,
+ displayProperty = propertyMap[keyAnalysisDisplayProperty] || propertyMap[xLayout.displayProperty] || 'name';
dataTypeMap[conf.finals.dataType.aggregated_values] = 'aggregate';
dataTypeMap[conf.finals.dataType.individual_cases] = 'query';
@@ -2632,7 +2640,7 @@
}
// display property
- paramString += '&displayProperty=' + init.userAccount.settings.keyAnalysisDisplayProperty.toUpperCase();
+ paramString += '&displayProperty=' + displayProperty.toUpperCase();
// collapse data items
if (view.collapseDataDimensions) {
@@ -3607,8 +3615,9 @@
for (var j = 0, str, header, name; j < dimensionHeaders.length; j++) {
header = dimensionHeaders[j];
+ isBoolean = header.type === 'java.lang.Boolean';
str = row[header.index];
- str = optionNames[header.name + str] || optionNames[str] || booleanNames[str] || names[str] || str;
+ str = optionNames[header.name + str] || optionNames[str] || (isBoolean ? booleanNames[str] : null) || names[str] || str;
name = web.report.query.format(str);
//if (header.name === 'ouname' && layout.showHierarchy) {
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.js 2015-12-03 15:58:11 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.js 2015-12-04 14:38:50 +0000
@@ -3208,7 +3208,6 @@
keyUiLocale = init.userAccount.settings.keyUiLocale;
keyAnalysisDisplayProperty = init.userAccount.settings.keyAnalysisDisplayProperty;
namePropertyUrl = keyAnalysisDisplayProperty + '|rename(name)';
- dateFormat = init.systemInfo.dateFormat;
init.namePropertyUrl = namePropertyUrl;