← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9879: Fix bug when to run favorites without userorgunit and userOrgunitChildren as true.

 

------------------------------------------------------------
revno: 9879
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-02-22 20:29:25 +0700
message:
   Fix bug when to run favorites without userorgunit and userOrgunitChildren as true.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveAggregateReportAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveTabularReportAction.java


--
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/SaveAggregateReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveAggregateReportAction.java	2013-01-30 09:34:29 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveAggregateReportAction.java	2013-02-22 13:29:25 +0000
@@ -229,6 +229,9 @@
     public String execute()
         throws Exception
     {
+        userOrganisationUnit = (userOrganisationUnit == null) ? false : userOrganisationUnit;
+        userOrganisationUnitChildren = (userOrganisationUnitChildren = null) ? false : userOrganisationUnitChildren;
+
         PatientAggregateReport aggregateReport = new PatientAggregateReport();
 
         aggregateReport.setName( name );
@@ -262,7 +265,7 @@
         {
             aggregateReport.setDeGroupBy( dataElementService.getDataElement( deGroupBy ) );
         }
-        
+
         if ( deSum != null )
         {
             aggregateReport.setDeSum( dataElementService.getDataElement( deSum ) );
@@ -273,15 +276,9 @@
             aggregateReport.setUseCompletedEvents( useCompletedEvents );
         }
 
-        if ( userOrganisationUnit != null )
-        {
-            aggregateReport.setUserOrganisationUnit( userOrganisationUnit );
-        }
 
-        if ( userOrganisationUnitChildren != null )
-        {
-            aggregateReport.setUserOrganisationUnitChildren( userOrganisationUnitChildren );
-        }
+        aggregateReport.setUserOrganisationUnit( userOrganisationUnit );
+        aggregateReport.setUserOrganisationUnitChildren( userOrganisationUnitChildren );
 
         aggregateReport.setAggregateType( aggregateType );
         aggregateReport.setUser( currentUserService.getCurrentUser() );

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveTabularReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveTabularReportAction.java	2013-02-22 04:49:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveTabularReportAction.java	2013-02-22 13:29:25 +0000
@@ -232,6 +232,9 @@
     public String execute()
         throws Exception
     {
+        userOrganisationUnit = (userOrganisationUnit == null) ? false : userOrganisationUnit;
+        userOrganisationUnitChildren = (userOrganisationUnitChildren = null) ? false : userOrganisationUnitChildren;
+
         Set<OrganisationUnit> orgunits = new HashSet<OrganisationUnit>(
             organisationUnitService.getOrganisationUnits( orgunitIds ) );
         ProgramStage programStage = programStageService.getProgramStage( programStageId );
@@ -254,15 +257,8 @@
             tabularReport.setUseCompletedEvents( useCompletedEvents );
         }
 
-        if ( userOrganisationUnit != null )
-        {
-            tabularReport.setUserOrganisationUnit( userOrganisationUnit );
-        }
-
-        if ( userOrganisationUnitChildren != null )
-        {
-            tabularReport.setUserOrganisationUnitChildren( userOrganisationUnitChildren );
-        }
+        tabularReport.setUserOrganisationUnit( userOrganisationUnit );
+        tabularReport.setUserOrganisationUnitChildren( userOrganisationUnitChildren );
 
         // ---------------------------------------------------------------------
         // Get searching-keys