← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10315: Quick links pt-dv-gis.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 10315 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-03-19 15:09:30 +0100
message:
  Quick links pt-dv-gis.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/styles/style.css
  dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js
  dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js
  dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/plugin.js
  dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/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-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js	2013-03-13 19:53:02 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/scripts/app.js	2013-03-19 14:08:10 +0000
@@ -4838,12 +4838,43 @@
 							}
 						});
 						a.push('->');
-						a.push({
-							text: 'Exit', //i18n
-							handler: function() {
-								window.location.href = '../../dhis-web-commons-about/redirect.action';
-							}
-						});
+
+						a.push({
+							text: 'Table', //i18n
+                            toggleGroup: 'module',
+							handler: function(b) {
+                                window.location.href = '../../dhis-web-pivot/app/index.html';
+							}
+						});
+
+						a.push({
+							text: 'Chart', //i18n
+                            toggleGroup: 'module',
+							handler: function(b) {
+                                window.location.href = '../../dhis-web-visualizer/app/index.html';
+							}
+						});
+
+						a.push({
+							text: 'Map', //i18n
+                            toggleGroup: 'module',
+                            pressed: true
+						});
+
+						a.push({
+							xtype: 'tbseparator',
+							height: 18,
+							style: 'border-color: transparent #d1d1d1 transparent transparent; margin-right: 6px; margin-left: 3px',
+						});
+
+                        a.push({
+                            xtype: 'button',
+                            text: 'Home',
+                            handler: function() {
+                                window.location.href = '../../dhis-web-commons-about/redirect.action';
+                            }
+						});
+
 						a.push(resizeButton);
 
 						return a;

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/styles/style.css'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/styles/style.css	2013-03-13 19:53:02 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/app/styles/style.css	2013-03-19 14:08:10 +0000
@@ -228,10 +228,27 @@
 	background-image: url('../images/arrow.png') !important;
 }
 
-.x-btn-default-toolbar-small-over {
-	border-color: #bbb;
+.x-btn-default-toolbar-small,
+.x-btn-default-toolbar-small-over,
+.x-btn-default-toolbar-small-pressed {
 	border-radius: 1px;
 }
+.x-btn-default-toolbar-small-over,
+.x-btn-default-toolbar-small-pressed {
+	border-color: #bbb;
+}
+
+.x-btn-default-toolbar-small-pressed {
+	border-color: #bbb;
+    background-image: none;
+    background-color: #d6d6d6;
+    background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #d1d1d1), color-stop(100%, #e5e5e5));
+    background-image: -webkit-linear-gradient(top, #d1d1d1,#e5e5e5);
+    background-image: -moz-linear-gradient(top, #d1d1d1,#e5e5e5);
+    background-image: -o-linear-gradient(top, #d1d1d1,#e5e5e5);
+    background-image: -ms-linear-gradient(top, #d1d1d1,#e5e5e5);
+    background-image: linear-gradient(top, #d1d1d1,#e5e5e5);
+}
 
 /* Toolbar */
 

=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js	2013-03-18 20:39:51 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js	2013-03-19 14:08:10 +0000
@@ -58,10 +58,12 @@
 			// Left gui
 			var vph = pt.viewport.westRegion.getHeight(),
 				no = pt.init.ougs.length + pt.init.degs.length,
-				factor = 0;
+				factor = 0,
+				staticHeight = 535,
+				tabHeight = 28;
 
-			if (vph > 535) {
-				var factor = (vph - 535) / 28;
+			if (vph > staticHeight) {
+				var factor = (vph - staticHeight) / tabHeight;
 			}
 
 			if (factor > 7) {
@@ -776,9 +778,14 @@
 			digitGroupSeparator,
 			displayDensity,
 			fontSize,
+			reportingPeriod,
+			organisationUnit,
+			parentOrganisationUnit,
 
 			data,
 			style,
+			parameters,
+
 			window;
 
 		showTotals = Ext.create('Ext.form.field.Checkbox', {
@@ -801,29 +808,9 @@
 		});
 		pt.viewport.hideEmptyRows = hideEmptyRows;
 
-		digitGroupSeparator = Ext.create('Ext.form.field.ComboBox', {
-			labelStyle: 'color:#333',
-			cls: 'pt-combo',
-			width: 250,
-			labelWidth: 130,
-			fieldLabel: 'Digit group separator', //i18n
-			queryMode: 'local',
-			valueField: 'id',
-			editable: false,
-			value: 'space',
-			store: Ext.create('Ext.data.Store', {
-				fields: ['id', 'text'],
-				data: [
-					{id: 'comma', text: 'Comma'},
-					{id: 'space', text: 'Space'},
-					{id: 'none', text: 'None'}
-				]
-			})
-		});
-		pt.viewport.digitGroupSeparator = digitGroupSeparator;
-
 		displayDensity = Ext.create('Ext.form.field.ComboBox', {
 			cls: 'pt-combo',
+			style: 'margin-bottom:3px',
 			width: 250,
 			labelWidth: 130,
 			fieldLabel: 'Display density', //i18n
@@ -845,6 +832,7 @@
 
 		fontSize = Ext.create('Ext.form.field.ComboBox', {
 			cls: 'pt-combo',
+			style: 'margin-bottom:3px',
 			width: 250,
 			labelWidth: 130,
 			fieldLabel: 'Font size', //i18n
@@ -864,6 +852,46 @@
 		});
 		pt.viewport.fontSize = fontSize;
 
+		digitGroupSeparator = Ext.create('Ext.form.field.ComboBox', {
+			labelStyle: 'color:#333',
+			cls: 'pt-combo',
+			style: 'margin-bottom:3px',
+			width: 250,
+			labelWidth: 130,
+			fieldLabel: 'Digit group separator', //i18n
+			queryMode: 'local',
+			valueField: 'id',
+			editable: false,
+			value: 'space',
+			store: Ext.create('Ext.data.Store', {
+				fields: ['id', 'text'],
+				data: [
+					{id: 'comma', text: 'Comma'},
+					{id: 'space', text: 'Space'},
+					{id: 'none', text: 'None'}
+				]
+			})
+		});
+		pt.viewport.digitGroupSeparator = digitGroupSeparator;
+
+		reportingPeriod = Ext.create('Ext.form.field.Checkbox', {
+			boxLabel: 'Reporting period', //i18n
+			style: 'margin-bottom:4px',
+		});
+		pt.viewport.reportingPeriod = reportingPeriod;
+
+		organisationUnit = Ext.create('Ext.form.field.Checkbox', {
+			boxLabel: 'Organisation unit', //i18n
+			style: 'margin-bottom:4px',
+		});
+		pt.viewport.organisationUnit = organisationUnit;
+
+		parentOrganisationUnit = Ext.create('Ext.form.field.Checkbox', {
+			boxLabel: 'Parent organisation unit', //i18n
+			style: 'margin-bottom:4px',
+		});
+		pt.viewport.parentOrganisationUnit = parentOrganisationUnit;
+
 		data = {
 			bodyStyle: 'border:0 none',
 			style: 'margin-left:14px',
@@ -884,9 +912,19 @@
 			]
 		};
 
+		parameters = {
+			bodyStyle: 'border:0 none',
+			style: 'margin-left:14px',
+			items: [
+				reportingPeriod,
+				organisationUnit,
+				parentOrganisationUnit
+			]
+		};
+
 		window = Ext.create('Ext.window.Window', {
 			title: 'Table options', //i18n
-			bodyStyle: 'background-color:#fff; padding:8px 8px 3px',
+			bodyStyle: 'background-color:#fff; padding:8px 8px 8px',
 			closeAction: 'hide',
 			autoShow: true,
 			modal: true,
@@ -899,12 +937,15 @@
 					hideEmptyRows: hideEmptyRows.getValue(),
 					displayDensity: displayDensity.getValue(),
 					fontSize: fontSize.getValue(),
-					digitGroupSeparator: digitGroupSeparator.getValue()
+					digitGroupSeparator: digitGroupSeparator.getValue(),
+					reportingPeriod: reportingPeriod.getValue(),
+					organisationUnit: organisationUnit.getValue(),
+					parentOrganisationUnit: parentOrganisationUnit.getValue()
 				};
 			},
 			items: [
 				{
-					bodyStyle: 'border:0 none; color:#444; font-size:12px; font-weight:bold',
+					bodyStyle: 'border:0 none; color:#222; font-size:12px; font-weight:bold',
 					style: 'margin-bottom:6px',
 					html: 'Data'
 				},
@@ -913,11 +954,20 @@
 					bodyStyle: 'border:0 none; padding:7px'
 				},
 				{
-					bodyStyle: 'border:0 none; color:#444; font-size:12px; font-weight:bold',
+					bodyStyle: 'border:0 none; color:#222; font-size:12px; font-weight:bold',
 					style: 'margin-bottom:6px',
 					html: 'Style'
 				},
-				style
+				style,
+				{
+					bodyStyle: 'border:0 none; padding:7px'
+				},
+				{
+					bodyStyle: 'border:0 none; color:#222; font-size:12px',
+					style: 'margin-bottom:6px',
+					html: '<b>Parameters</b> <span style="font-size:11px"> (for standard reports only)</span>'
+				},
+				parameters
 			],
 			bbar: [
 				'->',
@@ -1004,7 +1054,19 @@
 
 				// Server sync
 				favorite.totals = favorite.showTotals;
+				delete favorite.showTotals;
+
 				favorite.subtotals = favorite.showSubTotals;
+				delete favorite.showSubTotals;
+
+				favorite.reportParams = {
+					paramReportingMonth: favorite.reportingPeriod,
+					paramOrganisationUnit: favorite.organisationUnit,
+					paramParentOrganisationUnit: favorite.parentOrganisationUnit
+				};
+				delete favorite.reportingPeriod;
+				delete favorite.organisationUnit;
+				delete favorite.parentOrganisationUnit;
 
 				// Dimensions
 				for (var i = 0, obj, key, items; i < pt.xLayout.objects.length; i++) {
@@ -1867,16 +1929,18 @@
 				userOrganisationUnitChildren,
 				treePanel,
 				organisationUnit,
-				groupSetIdAvailableStoreMap,
-				groupSetIdSelectedStoreMap,
+				groupSetIdAvailableStoreMap = {},
+				groupSetIdSelectedStoreMap = {},
 				getGroupSetPanels,
 				validateSpecialCases,
 				update,
 
 				layoutButton,
 				optionsButton,
+				favoriteButton,
 				downloadButton,
 
+				accordionBody,
 				accordion,
 				westRegion,
 				centerRegion,
@@ -3155,9 +3219,6 @@
 				}
 			};
 
-			groupSetIdAvailableStoreMap = {};
-			groupSetIdSelectedStoreMap = {};
-
 			getGroupSetPanels = function(groupSets, objectName, iconCls) {
 				var	getAvailableStore,
 					getSelectedStore,
@@ -3615,9 +3676,33 @@
 						favoriteButton,
 						downloadButton,
                         '->',
+						{
+							text: 'Table', //i18n
+                            toggleGroup: 'module',
+							pressed: true
+						},
+						{
+							text: 'Chart', //i18n
+                            toggleGroup: 'module',
+							handler: function(b) {
+                                window.location.href = '../../dhis-web-visualizer/app/index.html';
+							}
+						},
+						{
+							text: 'Map', //i18n
+                            toggleGroup: 'module',
+							handler: function(b) {
+                                window.location.href = '../../dhis-web-mapping/app/index.html';
+							}
+						},
+						{
+							xtype: 'tbseparator',
+							height: 18,
+							style: 'border-color: transparent #d1d1d1 transparent transparent; margin-right: 6px; margin-left: 3px',
+						},
                         {
                             xtype: 'button',
-                            text: 'Exit',
+                            text: 'Home',
                             handler: function() {
                                 window.location.href = '../../dhis-web-commons-about/redirect.action';
                             }
@@ -3785,6 +3870,23 @@
 				pt.viewport.fontSize.setValue(r.fontSize);
 				pt.viewport.digitGroupSeparator.setValue(r.digitGroupSeparator);
 
+				if (Ext.isObject(r.reportParams)) {
+					pt.viewport.reportingPeriod.setValue(r.reportParams.paramReportingMonth);
+					pt.viewport.organisationUnit.setValue(r.reportParams.paramOrganisationUnit);
+					pt.viewport.parentOrganisationUnit.setValue(r.reportParams.paramParentOrganisationUnit);
+				}
+
+				// Upgrade fixes
+				if (!Ext.isArray(r.organisationUnits) || !r.organisationUnits.length) {
+					if (Ext.isObject(r.reportParams) && r.reportParams.paramOrganisationUnit) {
+						userOrganisationUnit.setValue(true);
+					}
+
+					if (Ext.isObject(r.reportParams) && r.reportParams.paramParentOrganisationUnit) {
+						userOrganisationUnit.setValue(true);
+					}
+				}
+
 				update();
 			};
 
@@ -3802,7 +3904,6 @@
 				userOrganisationUnit: userOrganisationUnit,
 				userOrganisationUnitChildren: userOrganisationUnitChildren,
 				setFavorite: setFavorite,
-				//groupSetIdStoreMap: groupSetIdStoreMap,
 				items: [
 					westRegion,
 					centerRegion

=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js	2013-03-18 18:48:35 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js	2013-03-19 12:51:01 +0000
@@ -1697,7 +1697,10 @@
 				hideEmptyRows: false,
 				displayDensity: 'normal',
 				fontSize: 'normal',
-				digitGroupSeparator: 'space'
+				digitGroupSeparator: 'space',
+				reportingPeriod: false,
+				organisationUnit: false,
+				parentOrganisationUnit: false
 			};
 
 		removeEmptyDimensions = function(axis) {
@@ -1761,6 +1764,9 @@
 			options.displayDensity = options.displayDensity || defaultOptions.displayDensity;
 			options.fontSize = options.fontSize || defaultOptions.fontSize;
 			options.digitGroupSeparator = Ext.isDefined(options.digitGroupSeparator) ? options.digitGroupSeparator : defaultOptions.digitGroupSeparator;
+			options.reportingPeriod = Ext.isDefined(options.reportingPeriod) ? options.reportingPeriod : defaultOptions.reportingPeriod;
+			options.organisationUnit = Ext.isDefined(options.organisationUnit) ? options.organisationUnit : defaultOptions.organisationUnit;
+			options.parentOrganisationUnit = Ext.isDefined(options.parentOrganisationUnit) ? options.parentOrganisationUnit : defaultOptions.parentOrganisationUnit;
 
 			return options;
 		};

=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/plugin.js'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/plugin.js	2013-03-14 14:33:39 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/plugin.js	2013-03-19 10:53:51 +0000
@@ -19,6 +19,9 @@
 		displayDensity: 'normal',
 		fontSize: 'normal',
 		digitGroupSeparator: 'space',
+		reportingPeriod: false,
+		organisationUnit: false,
+		parentOrganisationUnit: false,
 		userOrganisationUnit: true,
 		userOrganisationUnitChildren: false
 	}
@@ -67,7 +70,12 @@
 		hideEmptyRows: false,
 		displayDensity: 'normal',
 		fontSize: 'normal',
-		digitGroupSeparator: 'space'
+		digitGroupSeparator: 'space',
+		reportingPeriod: false,
+		organisationUnit: false,
+		parentOrganisationUnit: false,
+		userOrganisationUnit: true,
+		userOrganisationUnitChildren: false
 	}
 };
 

=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js	2013-03-15 16:23:26 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js	2013-03-19 14:08:10 +0000
@@ -5414,9 +5414,33 @@
                             }
                         },
                         '->',
+						{
+							text: 'Table', //i18n
+                            toggleGroup: 'module',
+							handler: function(b) {
+                                window.location.href = '../../dhis-web-pivot/app/index.html';
+							}
+						},
+						{
+							text: 'Chart', //i18n
+                            toggleGroup: 'module',
+                            pressed: true
+						},
+						{
+							text: 'Map', //i18n
+                            toggleGroup: 'module',
+							handler: function(b) {
+                                window.location.href = '../../dhis-web-mapping/app/index.html';
+							}
+						},
+						{
+							xtype: 'tbseparator',
+							height: 18,
+							style: 'border-color: transparent #d1d1d1 transparent transparent; margin-right: 6px; margin-left: 3px',
+						},
                         {
                             xtype: 'button',
-                            text: 'Exit',
+                            text: 'Home',
                             handler: function() {
                                 window.location.href = '../../dhis-web-commons-about/redirect.action';
                             }