← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2196: Fix bug: Services/Data Quality/Data Analysis/Validation Rule Analysis.

 

------------------------------------------------------------
revno: 2196
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Wed 2010-09-22 16:14:07 +0700
message:
  Fix bug: Services/Data Quality/Data Analysis/Validation Rule Analysis.
modified:
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/manager/DefaultSelectionTreeManager.java
  dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/ValidateRunValidationAction.java
  dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module.properties
  dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/runValidation.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-commons/src/main/java/org/hisp/dhis/oust/manager/DefaultSelectionTreeManager.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/manager/DefaultSelectionTreeManager.java	2010-08-31 11:40:23 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/manager/DefaultSelectionTreeManager.java	2010-09-22 09:14:07 +0000
@@ -232,7 +232,7 @@
 
     private OrganisationUnit reloadOrganisationUnit( OrganisationUnit unit )
     {
-        return organisationUnitService.getOrganisationUnit( unit.getId() );
+        return unit == null ? null : organisationUnitService.getOrganisationUnit( unit.getId() );
     }
 
     private Collection<OrganisationUnit> reloadOrganisationUnits( Collection<OrganisationUnit> units )

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/ValidateRunValidationAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/ValidateRunValidationAction.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/ValidateRunValidationAction.java	2010-09-22 09:14:07 +0000
@@ -27,7 +27,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
 import java.util.Date;
 
 import org.apache.commons.logging.Log;
@@ -91,6 +90,13 @@
         this.endDate = endDate;
     }
     
+    private boolean aggregate;
+    
+    public void setAggregate( boolean aggregate )
+    {
+        this.aggregate = aggregate;
+    }
+
     // -------------------------------------------------------------------------
     // Output
     // -------------------------------------------------------------------------
@@ -111,14 +117,21 @@
     {
         try
         {           
-            Collection<OrganisationUnit> selectedOrganisationUnits = selectionTreeManager.getSelectedOrganisationUnits();
-    
-            if ( selectedOrganisationUnits.isEmpty() )
+            OrganisationUnit selectedOrganisationUnit = selectionTreeManager.getReloadedSelectedOrganisationUnit() ;
+            
+            if ( selectedOrganisationUnit == null )
             {
                 message = i18n.getString( "specify_organisationunit" );
                 
                 return INPUT;
             }
+
+            if( aggregate && selectedOrganisationUnit.getChildren().size() == 0){
+            	 
+            	message = i18n.getString( "specify_organisationunit_has_children" );
+                 
+                 return INPUT;
+            }
         }
         catch ( Exception e )
         {

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module.properties	2010-09-22 07:54:20 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/resources/org/hisp/dhis/validationrule/i18n_module.properties	2010-09-22 09:14:07 +0000
@@ -179,4 +179,5 @@
 see_statistics = See statistics
 description_not_null = Please specify a description
 expression_not_null = Please specify an expression
-number_of_members = Number of menbers
\ No newline at end of file
+number_of_members = Number of menbers
+specify_organisationunit_has_children = Please specify an organisationunit which has children.
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/runValidation.js'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/runValidation.js	2010-09-06 10:24:08 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/runValidation.js	2010-09-22 09:14:07 +0000
@@ -18,7 +18,7 @@
     request.setCallbackSuccess( runValidationCompleted );
     
     request.send( 'validateRunValidation.action?startDate=' + getFieldValue( 'startDate' ) +
-        '&endDate=' + getFieldValue( 'endDate' ) );
+        '&endDate=' + getFieldValue( 'endDate' ) + '&aggregate=' +  getFieldValue( 'aggregate' ) );
         
     return false;
 }