[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19022: PT system info window + PT DV plugin fixes.

2015-04-25 Thread noreply
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

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 19023: Minor fix

2015-04-25 Thread noreply
Merge authors:
  Jan Henrik Ă˜verland (janhenrik-overland)

revno: 19023 [merge]
committer: Jan Henrik Overland 
branch nick: dhis2
timestamp: Sat 2015-04-25 14:29:02 +0200
message:
  Minor fix
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/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-pivot/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js	2015-04-25 11:22:40 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js	2015-04-25 12:28:25 +
@@ -1931,10 +1931,20 @@
 			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', ' ') + '';
+			if (Ext.isObject(info)) {
+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', ' ') + '';
+			}
+			else {
+html += 'No system info found';
+			}
+
+			w.update(html);
+		},
+		failure: function(r) {
+			html += r.status + '\n' + r.statusText + '\n' + r.responseText;
 
 			w.update(html);
 		}

___
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