Merge authors:
Jan Henrik Ă˜verland (janhenrik-overland)
revno: 19022 [merge]
committer: Jan Henrik Overland
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 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/i18n/i18n_app.properties 2015-04-25 11:22:40 +
@@ -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 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js 2015-04-25 11:22:40 +
@@ -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 += 'Data was updated: ' + info.intervalSinceLastAnalyticsTableSuccess + ' ago';
+ html += 'Version: ' + info.version + '';
+ html += 'Revision: ' + info.revision + '';
+ html += 'Build time: ' + info.buildTime.slice(0,19).replace('T', ' ') + '';
+
+ 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 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core.js 2015-04-23 15:36:12 +
@@ -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) ? confi