← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20085: EV option: completed events only.

 

------------------------------------------------------------
revno: 20085
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-09-11 02:58:01 +0200
message:
  EV option: completed events only.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/i18n/i18n_app.properties
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/core.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-event-visualizer/i18n/i18n_app.properties'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/i18n/i18n_app.properties	2015-05-06 17:52:12 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/i18n/i18n_app.properties	2015-09-11 00:58:01 +0000
@@ -232,3 +232,5 @@
 no_values_found_for_current_selection=No values found for the current selection
 error=Error
 warning=Warning
+completed_only=Completed only
+include_only_completed_events_only=Include only completed events

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js	2015-09-03 17:30:24 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/app.js	2015-09-11 00:58:01 +0000
@@ -2104,9 +2104,10 @@
 
     AggregateOptionsWindow = function() {
 		var showValues,
+            showTrendLine,
             hideEmptyRows,
             hideNaData,
-            showTrendLine,
+            completedOnly,
 			targetLineValue,
 			targetLineTitle,
 			baseLineValue,
@@ -2144,6 +2145,11 @@
 			checked: true
 		});
 
+		showTrendLine = Ext.create('Ext.form.field.Checkbox', {
+			boxLabel: NS.i18n.trend_line,
+			style: 'margin-bottom:' + checkboxBottomMargin + 'px'
+		});
+
 		hideEmptyRows = Ext.create('Ext.form.field.Checkbox', {
 			boxLabel: NS.i18n.hide_empty_category_items,
 			style: 'margin-bottom:' + checkboxBottomMargin + 'px'
@@ -2154,9 +2160,9 @@
 			style: 'margin-bottom:' + checkboxBottomMargin + 'px',
 		});
 
-		showTrendLine = Ext.create('Ext.form.field.Checkbox', {
-			boxLabel: NS.i18n.trend_line,
-			style: 'margin-bottom:' + checkboxBottomMargin + 'px'
+		completedOnly = Ext.create('Ext.form.field.Checkbox', {
+			boxLabel: NS.i18n.include_only_completed_events_only,
+			style: 'margin-bottom:' + checkboxBottomMargin + 'px',
 		});
 
 		targetLineValue = Ext.create('Ext.form.field.Number', {
@@ -2335,9 +2341,10 @@
 			style: 'margin-left:14px',
 			items: [
 				showValues,
+				showTrendLine,
 				hideEmptyRows,
                 hideNaData,
-				showTrendLine,
+                completedOnly,
 				{
 					xtype: 'container',
 					layout: 'column',
@@ -2417,9 +2424,10 @@
 			getOptions: function() {
 				return {
 					showValues: showValues.getValue(),
+					showTrendLine: showTrendLine.getValue(),
                     hideEmptyRows: hideEmptyRows.getValue(),
                     hideNaData: hideNaData.getValue(),
-					showTrendLine: showTrendLine.getValue(),
+					completedOnly: completedOnly.getValue(),
 					targetLineValue: targetLineValue.getValue(),
 					targetLineTitle: targetLineTitle.getValue(),
 					baseLineValue: baseLineValue.getValue(),
@@ -2439,8 +2447,10 @@
 			},
 			setOptions: function(layout) {
 				showValues.setValue(Ext.isBoolean(layout.showValues) ? layout.showValues : false);
+				showTrendLine.setValue(Ext.isBoolean(layout.showTrendLine) ? layout.showTrendLine : false);
 				hideEmptyRows.setValue(Ext.isBoolean(layout.hideEmptyRows) ? layout.hideEmptyRows : false);
-				showTrendLine.setValue(Ext.isBoolean(layout.showTrendLine) ? layout.showTrendLine : false);
+				hideNaData.setValue(Ext.isBoolean(layout.hideNaData) ? layout.hideNaData : false);
+                completedOnly.setValue(Ext.isBoolean(layout.completedOnly) ? layout.completedOnly : false);
 
 				// target line
 				if (Ext.isNumber(layout.targetLineValue)) {
@@ -2589,9 +2599,10 @@
 
 					// cmp
 					w.showValues = showValues;
+					w.showTrendLine = showTrendLine;
                     w.hideEmptyRows = hideEmptyRows;
                     w.hideNaData = hideNaData;
-					w.showTrendLine = showTrendLine;
+                    w.completedOnly = completedOnly;
 					w.targetLineValue = targetLineValue;
 					w.targetLineTitle = targetLineTitle;
 					w.baseLineValue = baseLineValue;

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/core.js	2015-09-03 11:03:34 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-visualizer/scripts/core.js	2015-09-11 00:58:01 +0000
@@ -899,6 +899,8 @@
 
                 // hideNaData: boolean (false)
 
+				// completedOnly: boolean (false)
+
                 // aggregationType: string ('default') - 'default', 'count', 'sum'
 
                 // showHierarchy: boolean (false)
@@ -1101,9 +1103,10 @@
 
 					// properties
                     layout.showValues = Ext.isBoolean(config.showData) ? config.showData : (Ext.isBoolean(config.showValues) ? config.showValues : true);
+                    layout.showTrendLine = Ext.isBoolean(config.regression) ? config.regression : (Ext.isBoolean(config.showTrendLine) ? config.showTrendLine : false);
                     layout.hideEmptyRows = Ext.isBoolean(config.hideEmptyRows) ? config.hideEmptyRows : (Ext.isBoolean(config.hideEmptyRows) ? config.hideEmptyRows : true);
                     layout.hideNaData = Ext.isBoolean(config.hideNaData) ? config.hideNaData : false;
-                    layout.showTrendLine = Ext.isBoolean(config.regression) ? config.regression : (Ext.isBoolean(config.showTrendLine) ? config.showTrendLine : false);
+                    layout.completedOnly = Ext.isBoolean(config.completedOnly) ? config.completedOnly : false;
                     layout.targetLineValue = Ext.isNumber(config.targetLineValue) ? config.targetLineValue : null;
                     layout.targetLineTitle = Ext.isString(config.targetLineLabel) && !Ext.isEmpty(config.targetLineLabel) ? config.targetLineLabel :
                         (Ext.isString(config.targetLineTitle) && !Ext.isEmpty(config.targetLineTitle) ? config.targetLineTitle : null);
@@ -3056,6 +3059,11 @@
                     paramString += '&outputType=' + layout.outputType;
                 }
 
+                // completed only
+				if (layout.completedOnly) {
+					paramString += '&completedOnly=true';
+				}
+                
                 // display property
                 paramString += '&displayProperty=' + init.userAccount.settings.keyAnalysisDisplayProperty.toUpperCase();