← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10240: Fix bug - Tabular report result from downloading is wrong.

 

------------------------------------------------------------
revno: 10240
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-03-15 14:28:55 +0700
message:
  Fix bug - Tabular report result from downloading is wrong.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateAggregateReportAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/index.html


--
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-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateAggregateReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateAggregateReportAction.java	2013-03-14 15:42:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateAggregateReportAction.java	2013-03-15 07:28:55 +0000
@@ -335,7 +335,7 @@
                 }
             }
         }
-
+        
         grid = programStageInstanceService.getAggregateReport( position, programStage, orgunitIds, facilityLB,
             deGroupBy, deSum, deFilterMap, periods, aggregateType, limitRecords, useCompletedEvents, format, i18n );
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2013-03-15 06:47:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2013-03-15 07:28:55 +0000
@@ -1711,8 +1711,13 @@
 				if( type)
 				{
 					TR.state.caseBasedReport.getURLParams();
+					var completedEvent='';
+					if( Ext.getCmp('completedEventsOpt').getValue() == true)
+					{
+						completedEvent = "&completedEventsOpt=true";
+					}
   				    var exportForm = document.getElementById('exportForm');
-					exportForm.action = url + "?type=" + type;
+					exportForm.action = url + "?type=" + type + completedEvent;
 					exportForm.submit();
 				}
 				// Show report on grid
@@ -1777,7 +1782,7 @@
 				p.orgunitIds = TR.state.orgunitIds;
 				p.userOrganisationUnit = Ext.getCmp('userOrgunit').getValue();
 				p.userOrganisationUnitChildren = Ext.getCmp('userOrgunitChildren').getValue();
-				if( Ext.getCmp('completedEventsOpt').getValue() =='true')
+				if( Ext.getCmp('completedEventsOpt').getValue() == true )
 				{
 					p.useCompletedEvents = Ext.getCmp('completedEventsOpt').getValue();
 				}
@@ -1882,14 +1887,6 @@
 				document.getElementById('programStageId').value = TR.cmp.params.programStage.getValue();				
 				document.getElementById('userOrganisationUnit').value = Ext.getCmp('userOrgunit').getValue();
 				document.getElementById('userOrganisationUnitChildren').value = Ext.getCmp('userOrgunitChildren').getValue();
-				if( Ext.getCmp('completedEventsOpt').getValue() =='true')
-				{
-					document.getElementById('useCompletedEvents').value = 'true';
-				}
-				else
-				{
-					document.getElementById('useCompletedEvents').value = '';
-				}
 
 				// orgunits
 				var orgunitIdList = document.getElementById('orgunitIds');
@@ -2061,8 +2058,13 @@
 				if( type)
 				{
 					TR.state.aggregateReport.getURLParams();
+  				    var completedEvent='';
+					if( Ext.getCmp('completedEventsOpt').getValue() == true )
+					{
+						completedEvent = "&completedEventsOpt=true";
+					}
   				    var exportForm = document.getElementById('exportForm');
-					exportForm.action = url + "?type=" + type;
+					exportForm.action = url + "?type=" + type + completedEvent;
 					exportForm.submit();
 				}
 				// Show report on grid
@@ -2258,7 +2260,7 @@
 				
 				p.facilityLB = TR.cmp.settings.facilityLB.getValue();
 				p.position = position;
-				if( Ext.getCmp('completedEventsOpt').getValue() =='true')
+				if( Ext.getCmp('completedEventsOpt').getValue()== true )
 				{
 					p.useCompletedEvents = Ext.getCmp('completedEventsOpt').getValue();
 				}
@@ -2272,14 +2274,6 @@
 				document.getElementById('userOrganisationUnitChildren').value = Ext.getCmp('userOrgunitChildren').getValue();
 				document.getElementById('facilityLB').value = TR.cmp.settings.facilityLB.getValue();
 				document.getElementById('position').value = TR.state.aggregateReport.getPosition();
-				if( Ext.getCmp('completedEventsOpt').getValue() =='true')
-				{
-					document.getElementById('useCompletedEvents').value = true;
-				}
-				else
-				{
-					document.getElementById('useCompletedEvents').value = '';
-				}
 				
 				if( Ext.getCmp('dataElementGroupByCbx').getValue() != null 
 					&& Ext.getCmp('dataElementGroupByCbx').getValue() != '' ){
@@ -3011,7 +3005,10 @@
 													Ext.getCmp('deSumCbx').setVisible(false);
 													Ext.getCmp('caseBasedFavoriteBtn').setVisible(true);
 													Ext.getCmp('levelCombobox').setVisible(true);
-													
+													var level = Ext.getCmp('levelCombobox').getValue();
+													if( level==null || level!='' ){
+														Ext.getCmp('levelCombobox').setValue('1');
+													}
 													Ext.getCmp('dateRangeDiv').setVisible(true);
 													Ext.getCmp('patientPropertiesDiv').setVisible(true);
 													Ext.getCmp('btnSortBy').setVisible(true);
@@ -3019,6 +3016,7 @@
 													Ext.getCmp('fixedPeriodsDiv').setVisible(false);
 													Ext.getCmp('dateRangeDiv').expand();
 													Ext.getCmp('filterPanel').setHeight(155);
+													
 												}
 											}
 										}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/index.html'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/index.html	2013-02-18 13:12:14 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/index.html	2013-03-15 07:28:55 +0000
@@ -20,7 +20,6 @@
 		<input type="hidden" id="deGroupBy" name="deGroupBy" >
 		<input type="hidden" id="facilityLB" name="facilityLB" >
 		<input type="hidden" id="position" name="position" >
-		<input type="hidden" id="useCompletedEvents" name="useCompletedEvents" >
 		<input type="hidden" id="deSum" name="deSum" >
 		<select multiple id="startDates" name="startDates" class="hidden"></select>
 		<input type="hidden" id="startDate" name="startDate" >