← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10941: (PT) Standard report params.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 10941 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-05-22 18:49:33 +0200
message:
  (PT) Standard report params.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportParams.java
  dhis-2/dhis-web/dhis-web-pivot/src/main/resources/org/hisp/dhis/pivot/i18n_module.properties
  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/i18n.vm


--
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-api/src/main/java/org/hisp/dhis/reporttable/ReportParams.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportParams.java	2013-03-19 11:44:28 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportParams.java	2013-05-22 16:41:30 +0000
@@ -33,6 +33,7 @@
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 import org.hisp.dhis.common.DxfNamespaces;
 import org.hisp.dhis.common.view.DetailedView;
+import org.hisp.dhis.common.view.DimensionalView;
 import org.hisp.dhis.common.view.ExportView;
 
 import java.io.Serializable;
@@ -119,7 +120,7 @@
     // -------------------------------------------------------------------------
 
     @JsonProperty( value = "paramReportingPeriod" )
-    @JsonView( {DetailedView.class, ExportView.class} )
+    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
     public Boolean getParamReportingMonth()
     {
@@ -145,7 +146,7 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
+    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
     public Boolean getParamParentOrganisationUnit()
     {
@@ -158,7 +159,7 @@
     }
 
     @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
+    @JsonView( {DetailedView.class, ExportView.class, DimensionalView.class} )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0)
     public Boolean getParamOrganisationUnit()
     {

=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/resources/org/hisp/dhis/pivot/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/resources/org/hisp/dhis/pivot/i18n_module.properties	2013-04-30 10:04:25 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/resources/org/hisp/dhis/pivot/i18n_module.properties	2013-05-22 16:41:30 +0000
@@ -108,4 +108,10 @@
 layout=Layout
 options=Options
 download=Download
-favorites=Favorites
\ No newline at end of file
+favorites=Favorites
+include_regression=Include regression
+include_cumulative=Include cumulative
+sort_order=Sort order
+low_to_high=Low to high
+high_to_low=High to low
+top_limit=Top limit

=== 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-05-22 14:06:23 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js	2013-05-22 16:41:30 +0000
@@ -890,6 +890,66 @@
 		});
 		pt.viewport.parentOrganisationUnit = parentOrganisationUnit;
 
+		regression = Ext.create('Ext.form.field.Checkbox', {
+			boxLabel: PT.i18n.include_regression,
+			style: 'margin-bottom:4px',
+		});
+		pt.viewport.regression = regression;
+
+		cumulative = Ext.create('Ext.form.field.Checkbox', {
+			boxLabel: PT.i18n.include_cumulative,
+			style: 'margin-bottom:6px',
+		});
+		pt.viewport.cumulative = cumulative;
+
+		sortOrder = Ext.create('Ext.form.field.ComboBox', {
+			cls: 'pt-combo',
+			style: 'margin-bottom:3px',
+			width: 250,
+			labelWidth: 130,
+			fieldLabel: PT.i18n.sort_order,
+			labelStyle: 'color:#333',
+			queryMode: 'local',
+			valueField: 'id',
+			editable: false,
+			value: 0,
+			store: Ext.create('Ext.data.Store', {
+				fields: ['id', 'text'],
+				data: [
+					{id: 0, text: PT.i18n.none},
+					{id: 1, text: PT.i18n.low_to_high},
+					{id: 2, text: PT.i18n.high_to_low}
+				]
+			})
+		});
+		pt.viewport.sortOrder = sortOrder;
+
+		topLimit = Ext.create('Ext.form.field.ComboBox', {
+			cls: 'pt-combo',
+			style: 'margin-bottom:3px',
+			width: 250,
+			labelWidth: 130,
+			fieldLabel: PT.i18n.top_limit,
+			labelStyle: 'color:#333',
+			queryMode: 'local',
+			valueField: 'id',
+			editable: false,
+			value: 0,
+			store: Ext.create('Ext.data.Store', {
+				fields: ['id', 'text'],
+				data: [
+					{id: 0, text: PT.i18n.none},
+					{id: 5, text: 5},
+					{id: 10, text: 10},
+					{id: 20, text: 20},
+					{id: 50, text: 50},
+					{id: 100, text: 100}
+				]
+			})
+		});
+		pt.viewport.topLimit = topLimit;
+
+
 		data = {
 			bodyStyle: 'border:0 none',
 			style: 'margin-left:14px',
@@ -916,7 +976,11 @@
 			items: [
 				reportingPeriod,
 				organisationUnit,
-				parentOrganisationUnit
+				parentOrganisationUnit,
+				regression,
+				cumulative,
+				sortOrder,
+				topLimit
 			]
 		};
 
@@ -938,21 +1002,27 @@
 					digitGroupSeparator: digitGroupSeparator.getValue(),
 					reportingPeriod: reportingPeriod.getValue(),
 					organisationUnit: organisationUnit.getValue(),
-					parentOrganisationUnit: parentOrganisationUnit.getValue()
+					parentOrganisationUnit: parentOrganisationUnit.getValue(),
+					regression: regression.getValue(),
+					cumulative: cumulative.getValue(),
+					sortOrder: sortOrder.getValue(),
+					topLimit: topLimit.getValue()
 				};
 			},
 			setOptions: function(layout) {
 				showTotals.setValue(Ext.isBoolean(layout.showTotals) ? layout.showTotals : true);
 				showSubTotals.setValue(Ext.isBoolean(layout.showSubTotals) ? layout.showSubTotals : true);
 				hideEmptyRows.setValue(Ext.isBoolean(layout.hideEmptyRows) ? layout.hideEmptyRows : false);
-
 				displayDensity.setValue(Ext.isString(layout.displayDensity) ? layout.displayDensity : 'normal');
 				fontSize.setValue(Ext.isString(layout.fontSize) ? layout.fontSize : 'normal');
 				digitGroupSeparator.setValue(Ext.isString(layout.digitGroupSeparator) ? layout.digitGroupSeparator : 'space');
-
 				reportingPeriod.setValue(Ext.isBoolean(layout.reportingPeriod) ? layout.reportingPeriod : false);
 				organisationUnit.setValue(Ext.isBoolean(layout.organisationUnit) ? layout.organisationUnit : false);
 				parentOrganisationUnit.setValue(Ext.isBoolean(layout.parentOrganisationUnit) ? layout.parentOrganisationUnit : false);
+				regression.setValue(Ext.isBoolean(layout.regression) ? layout.regression : false);
+				cumulative.setValue(Ext.isBoolean(layout.cumulative) ? layout.cumulative : false);
+				sortOrder.setValue(Ext.isNumber(layout.sortOrder) ? layout.sortOrder : 0);
+				topLimit.setValue(Ext.isNumber(layout.topLimit) ? layout.topLimit : 0);
 			},
 			items: [
 				{

=== 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-05-22 14:00:22 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js	2013-05-22 16:41:30 +0000
@@ -1922,6 +1922,14 @@
 
 		// parentOrganisationUnit: boolean (false) //report tables only
 
+		// regression: boolean (false)
+
+		// cumulative: boolean (false)
+
+		// sortOrder: integer (0) //-1, 0, 1
+
+		// topLimit: integer (100) //5, 10, 20, 50, 100
+
 		var getValidatedDimensionArray = function(dimensionArray) {
 			var dimensions = [];
 
@@ -1995,10 +2003,14 @@
 
 			layout.parentGraphMap = Ext.isString(config.parentGraphMap) ? config.parentGraphMap : '';
 
-			layout.reportingPeriod = Ext.isBoolean(config.reportingPeriod) ? config.reportingPeriod : false;
-			layout.organisationUnit = Ext.isBoolean(config.organisationUnit) ? config.organisationUnit : false;
-			layout.parentOrganisationUnit = Ext.isBoolean(config.parentOrganisationUnit) ? config.parentOrganisationUnit : false;
+			layout.reportingPeriod = Ext.isBoolean(config.reportParams.paramReportingPeriod) ? config.reportParams.paramReportingPeriod : (Ext.isBoolean(config.reportingPeriod) ? config.reportingPeriod : false);
+			layout.organisationUnit = Ext.isBoolean(config.reportParams.paramOrganisationUnit) ? config.reportParams.paramOrganisationUnit : (Ext.isBoolean(config.organisationUnit) ? config.organisationUnit : false);
+			layout.parentOrganisationUnit = Ext.isBoolean(config.reportParams.paramParentOrganisationUnit) ? config.reportParams.paramParentOrganisationUnit : (Ext.isBoolean(config.parentOrganisationUnit) ? config.parentOrganisationUnit : false);
 
+			layout.regression = Ext.isBoolean(config.regression) ? config.regression : false;
+			layout.cumulative = Ext.isBoolean(config.cumulative) ? config.cumulative : false;
+			layout.sortOrder = Ext.isNumber(config.sortOrder) ? config.sortOrder : 0;
+			layout.topLimit = Ext.isNumber(config.topLimit) ? config.topLimit : 0;
 
 			return Ext.clone(layout);
 		}();

=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/i18n.vm'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/i18n.vm	2013-04-30 10:09:35 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/i18n.vm	2013-05-22 16:41:30 +0000
@@ -109,5 +109,11 @@
     layout: '$encoder.jsEscape($i18n.getString( 'layout' ) , "'")',
     options: '$encoder.jsEscape($i18n.getString( 'options' ) , "'")',
     download: '$encoder.jsEscape($i18n.getString( 'download' ) , "'")',
-    favorites: '$encoder.jsEscape($i18n.getString( 'favorites' ) , "'")'
+    favorites: '$encoder.jsEscape($i18n.getString( 'favorites' ) , "'")',
+    include_regression: '$encoder.jsEscape($i18n.getString( 'include_regression' ) , "'")',
+    include_cumulative: '$encoder.jsEscape($i18n.getString( 'include_cumulative' ) , "'")',
+    sort_order: '$encoder.jsEscape($i18n.getString( 'sort_order' ) , "'")',
+    low_to_high: '$encoder.jsEscape($i18n.getString( 'low_to_high' ) , "'")',
+    high_to_low: '$encoder.jsEscape($i18n.getString( 'high_to_low' ) , "'")',
+    top_limit: '$encoder.jsEscape($i18n.getString( 'top_limit' ) , "'")'
 };