dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #37178
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19022: PT system info window + PT DV plugin fixes.
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 19022 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2015-04-25 13:25:13 +0200
message:
PT system info window + PT DV plugin fixes.
modified:
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/i18n/i18n_app.properties
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-pivot/scripts/table.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/chart.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/core.js
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/chart.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/chart.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-pivot/i18n/i18n_app.properties'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/i18n/i18n_app.properties 2015-04-12 20:00:37 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/i18n/i18n_app.properties 2015-04-25 11:22:40 +0000
@@ -185,3 +185,4 @@
column_dimensions=Column dimensions
row_dimensions=Row dimensions
report_filter=Report filter
+info=Info
=== 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-04-22 12:10:13 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js 2015-04-25 11:22:40 +0000
@@ -1914,6 +1914,46 @@
return;
};
+ InfoWindow = function() {
+ var html = '',
+ window;
+
+ window = Ext.create('Ext.window.Window', {
+ title: 'System info',
+ bodyStyle: 'background:#fff; padding:6px',
+ modal: true,
+ hideOnBlur: true,
+ listeners: {
+ show: function(w) {
+ Ext.Ajax.request({
+ url: ns.core.init.contextPath + '/api/system/info.json',
+ success: function(r) {
+ var info = Ext.decode(r.responseText),
+ divStyle = 'padding:3px';
+
+ html += '<div style="' + divStyle + '"><b>Data was updated: </b>' + info.intervalSinceLastAnalyticsTableSuccess + ' <b>ago</b></div>';
+ html += '<div style="' + divStyle + '"><b>Version: </b>' + info.version + '</div>';
+ html += '<div style="' + divStyle + '"><b>Revision: </b>' + info.revision + '</div>';
+ html += '<div style="' + divStyle + '"><b>Build time: </b>' + info.buildTime.slice(0,19).replace('T', ' ') + '</div>';
+
+ w.update(html);
+ }
+ });
+
+ if (ns.app.infoButton.rendered) {
+ ns.core.web.window.setAnchorPosition(w, ns.app.infoButton);
+
+ if (!w.hasHideOnBlurHandler) {
+ ns.core.web.window.addHideOnBlurHandler(w);
+ }
+ }
+ }
+ }
+ });
+
+ return window;
+ };
+
// core
extendCore = function(core) {
var conf = core.conf,
@@ -6007,6 +6047,23 @@
}
});
+ infoButton = Ext.create('Ext.button.Button', {
+ text: NS.i18n.info,
+ handler: function() {
+ if (ns.app.infoWindow && ns.app.infoWindow.destroy) {
+ ns.app.infoWindow.destroy();
+ }
+
+ ns.app.infoWindow = InfoWindow();
+ ns.app.infoWindow.show();
+ },
+ listeners: {
+ added: function() {
+ ns.app.infoButton = this;
+ }
+ }
+ });
+
defaultButton = Ext.create('Ext.button.Button', {
text: NS.i18n.table,
iconCls: 'ns-button-icon-table',
@@ -6092,6 +6149,12 @@
favoriteButton,
downloadButton,
shareButton,
+ {
+ xtype: 'tbseparator',
+ height: 18,
+ style: 'border-color:transparent; border-right-color:#d1d1d1; margin-right:4px',
+ },
+ infoButton,
'->',
defaultButton,
{
=== 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-04-16 08:51:08 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core.js 2015-04-23 15:36:12 +0000
@@ -358,6 +358,8 @@
// topLimit: integer (100) //5, 10, 20, 50, 100
+ // displayProperty: string ('name') // 'name', 'shortname', null
+
getValidatedDimensionArray = function(dimensionArray) {
var dimensionArray = Ext.clone(dimensionArray);
@@ -523,6 +525,10 @@
layout.sortOrder = Ext.isNumber(config.sortOrder) ? config.sortOrder : 0;
layout.topLimit = Ext.isNumber(config.topLimit) ? config.topLimit : 0;
+ if (Ext.isString(config.displayProperty)) {
+ layout.displayProperty = config.displayProperty;
+ }
+
if (!validateSpecialCases()) {
return;
}
@@ -1947,7 +1953,8 @@
map = xLayout.dimensionNameItemsMap,
dx = dimConf.indicator.dimensionName,
co = dimConf.category.dimensionName,
- aggTypes = ['COUNT', 'SUM', 'STDDEV', 'VARIANCE', 'MIN', 'MAX'];
+ aggTypes = ['COUNT', 'SUM', 'STDDEV', 'VARIANCE', 'MIN', 'MAX'],
+ displayProperty = xLayout.displayProperty || init.userAccount.settings.keyAnalysisDisplayProperty || 'name';
for (var i = 0, dimName, items; i < axisDimensionNames.length; i++) {
dimName = axisDimensionNames[i];
@@ -2000,7 +2007,7 @@
}
// display property
- paramString += '&displayProperty=' + init.userAccount.settings.keyAnalysisDisplayProperty.toUpperCase();
+ paramString += '&displayProperty=' + displayProperty.toUpperCase();
return paramString;
};
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/table.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/table.js 2015-03-23 12:48:05 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/table.js 2015-04-23 15:36:12 +0000
@@ -546,6 +546,10 @@
layout.sortOrder = Ext.isNumber(config.sortOrder) ? config.sortOrder : 0;
layout.topLimit = Ext.isNumber(config.topLimit) ? config.topLimit : 0;
+ if (Ext.isString(config.displayProperty)) {
+ layout.displayProperty = config.displayProperty;
+ }
+
if (!validateSpecialCases()) {
return;
}
@@ -1956,7 +1960,8 @@
'variance': 'VARIANCE',
'min': 'MIN',
'max': 'MAX'
- };
+ },
+ displayProperty = xLayout.displayProperty || init.userAccount.settings.keyAnalysisDisplayProperty || 'name';
for (var i = 0, dimName, items; i < axisDimensionNames.length; i++) {
dimName = axisDimensionNames[i];
@@ -2008,7 +2013,7 @@
}
// display property
- paramString += '&displayProperty=' + init.userAccount.settings.keyAnalysisDisplayProperty.toUpperCase();
+ paramString += '&displayProperty=' + displayProperty.toUpperCase();
return paramString;
};
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/chart.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/chart.js 2015-03-30 13:36:53 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/chart.js 2015-04-23 15:36:12 +0000
@@ -1175,6 +1175,10 @@
layout.parentGraphMap = Ext.isObject(config.parentGraphMap) ? config.parentGraphMap : null;
+ if (Ext.isString(config.displayProperty)) {
+ layout.displayProperty = config.displayProperty;
+ }
+
// style
if (Ext.isObject(config.domainAxisStyle)) {
layout.domainAxisStyle = config.domainAxisStyle;
@@ -2236,7 +2240,8 @@
paramString = '?',
addCategoryDimension = false,
map = xLayout.dimensionNameItemsMap,
- dx = dimConf.indicator.dimensionName;
+ dx = dimConf.indicator.dimensionName,
+ displayProperty = xLayout.displayProperty || init.userAccount.settings.keyAnalysisDisplayProperty || 'name';
for (var i = 0, dimName, items; i < axisDimensionNames.length; i++) {
dimName = axisDimensionNames[i];
@@ -2280,7 +2285,7 @@
}
// display property
- paramString += '&displayProperty=' + init.userAccount.settings.keyAnalysisDisplayProperty.toUpperCase();
+ paramString += '&displayProperty=' + displayProperty.toUpperCase();
return paramString;
};
=== 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-04-22 12:10:13 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-visualizer/scripts/core.js 2015-04-23 15:36:12 +0000
@@ -891,6 +891,8 @@
// parentGraphMap: object
+ // displayProperty: string ('name') // 'name', 'shortname', null
+
getValidatedDimensionArray = function(dimensionArray) {
var dimensionArray = Ext.clone(dimensionArray);
@@ -1134,6 +1136,10 @@
layout.parentGraphMap = Ext.isObject(config.parentGraphMap) ? config.parentGraphMap : null;
+ if (Ext.isString(config.displayProperty)) {
+ layout.displayProperty = config.displayProperty;
+ }
+
// style
if (Ext.isObject(config.domainAxisStyle)) {
layout.domainAxisStyle = config.domainAxisStyle;
@@ -2222,7 +2228,8 @@
addCategoryDimension = false,
map = xLayout.dimensionNameItemsMap,
dx = dimConf.indicator.dimensionName,
- aggTypes = ['COUNT', 'SUM', 'STDDEV', 'VARIANCE', 'MIN', 'MAX'];
+ aggTypes = ['COUNT', 'SUM', 'STDDEV', 'VARIANCE', 'MIN', 'MAX'],
+ displayProperty = xLayout.displayProperty || init.userAccount.settings.keyAnalysisDisplayProperty || 'name';
for (var i = 0, dimName, items; i < axisDimensionNames.length; i++) {
dimName = axisDimensionNames[i];
@@ -2271,7 +2278,7 @@
}
// display property
- paramString += '&displayProperty=' + init.userAccount.settings.keyAnalysisDisplayProperty.toUpperCase();
+ paramString += '&displayProperty=' + displayProperty.toUpperCase();
return paramString;
};
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/chart.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/chart.js 2015-03-30 13:36:53 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/chart.js 2015-04-23 15:36:12 +0000
@@ -1175,6 +1175,10 @@
layout.parentGraphMap = Ext.isObject(config.parentGraphMap) ? config.parentGraphMap : null;
+ if (Ext.isString(config.displayProperty)) {
+ layout.displayProperty = config.displayProperty;
+ }
+
// style
if (Ext.isObject(config.domainAxisStyle)) {
layout.domainAxisStyle = config.domainAxisStyle;
@@ -2236,7 +2240,8 @@
paramString = '?',
addCategoryDimension = false,
map = xLayout.dimensionNameItemsMap,
- dx = dimConf.indicator.dimensionName;
+ dx = dimConf.indicator.dimensionName,
+ displayProperty = xLayout.displayProperty || init.userAccount.settings.keyAnalysisDisplayProperty || 'name';
for (var i = 0, dimName, items; i < axisDimensionNames.length; i++) {
dimName = axisDimensionNames[i];
@@ -2280,7 +2285,7 @@
}
// display property
- paramString += '&displayProperty=' + init.userAccount.settings.keyAnalysisDisplayProperty.toUpperCase();
+ paramString += '&displayProperty=' + displayProperty.toUpperCase();
return paramString;
};
=== 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-03-23 12:48:05 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/table.js 2015-04-23 15:36:12 +0000
@@ -546,6 +546,10 @@
layout.sortOrder = Ext.isNumber(config.sortOrder) ? config.sortOrder : 0;
layout.topLimit = Ext.isNumber(config.topLimit) ? config.topLimit : 0;
+ if (Ext.isString(config.displayProperty)) {
+ layout.displayProperty = config.displayProperty;
+ }
+
if (!validateSpecialCases()) {
return;
}
@@ -1956,7 +1960,8 @@
'variance': 'VARIANCE',
'min': 'MIN',
'max': 'MAX'
- };
+ },
+ displayProperty = xLayout.displayProperty || init.userAccount.settings.keyAnalysisDisplayProperty || 'name';
for (var i = 0, dimName, items; i < axisDimensionNames.length; i++) {
dimName = axisDimensionNames[i];
@@ -2008,7 +2013,7 @@
}
// display property
- paramString += '&displayProperty=' + init.userAccount.settings.keyAnalysisDisplayProperty.toUpperCase();
+ paramString += '&displayProperty=' + displayProperty.toUpperCase();
return paramString;
};
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/chart.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/chart.js 2015-03-30 13:36:53 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/chart.js 2015-04-23 15:36:12 +0000
@@ -1175,6 +1175,10 @@
layout.parentGraphMap = Ext.isObject(config.parentGraphMap) ? config.parentGraphMap : null;
+ if (Ext.isString(config.displayProperty)) {
+ layout.displayProperty = config.displayProperty;
+ }
+
// style
if (Ext.isObject(config.domainAxisStyle)) {
layout.domainAxisStyle = config.domainAxisStyle;
@@ -2229,7 +2233,8 @@
paramString = '?',
addCategoryDimension = false,
map = xLayout.dimensionNameItemsMap,
- dx = dimConf.indicator.dimensionName;
+ dx = dimConf.indicator.dimensionName,
+ displayProperty = xLayout.displayProperty || init.userAccount.settings.keyAnalysisDisplayProperty || 'name';
for (var i = 0, dimName, items; i < axisDimensionNames.length; i++) {
dimName = axisDimensionNames[i];
@@ -2273,7 +2278,7 @@
}
// display property
- paramString += '&displayProperty=' + init.userAccount.settings.keyAnalysisDisplayProperty.toUpperCase();
+ paramString += '&displayProperty=' + displayProperty.toUpperCase();
return paramString;
};
=== 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-03-23 12:48:05 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.js 2015-04-23 15:36:12 +0000
@@ -546,6 +546,10 @@
layout.sortOrder = Ext.isNumber(config.sortOrder) ? config.sortOrder : 0;
layout.topLimit = Ext.isNumber(config.topLimit) ? config.topLimit : 0;
+ if (Ext.isString(config.displayProperty)) {
+ layout.displayProperty = config.displayProperty;
+ }
+
if (!validateSpecialCases()) {
return;
}
@@ -1949,7 +1953,8 @@
'variance': 'VARIANCE',
'min': 'MIN',
'max': 'MAX'
- };
+ },
+ displayProperty = xLayout.displayProperty || init.userAccount.settings.keyAnalysisDisplayProperty || 'name';
for (var i = 0, dimName, items; i < axisDimensionNames.length; i++) {
dimName = axisDimensionNames[i];
@@ -2001,7 +2006,7 @@
}
// display property
- paramString += '&displayProperty=' + init.userAccount.settings.keyAnalysisDisplayProperty.toUpperCase();
+ paramString += '&displayProperty=' + displayProperty.toUpperCase();
return paramString;
};