← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2089: Validating that report table cannot use current and parent orgunit as param

 

------------------------------------------------------------
revno: 2089
committer: Lars <larshelg@larshelg-laptop>
branch nick: trunk
timestamp: Mon 2010-07-05 23:00:54 +0200
message:
  Validating that report table cannot use current and parent orgunit as param
modified:
  dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addTableForm.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/table.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-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties	2010-07-04 23:55:46 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties	2010-07-05 21:00:54 +0000
@@ -75,6 +75,7 @@
 must_select_at_least_one_unit= Please select at least one organisation unit
 must_select_at_least_one_period= Please select at least one period
 cannot_include_more_organisation_unit_regression = Cannot include more that one organisation unit with regression
+cannot_select_orgunit_and_parent_orgunit_param= Cannot select both current and parent organisation unit parameter
 must_enter_name= Please enter a name
 yes= Yes
 no= No

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addTableForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addTableForm.vm	2010-06-23 17:50:25 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addTableForm.vm	2010-07-05 21:00:54 +0000
@@ -409,6 +409,7 @@
     var i18n_must_select_at_least_one_indicator = '$encoder.jsEscape( $i18n.getString( "must_select_at_least_one_indicator" ), "'")';
     var i18n_must_select_at_least_one_unit = '$encoder.jsEscape( $i18n.getString( "must_select_at_least_one_unit" ), "'")';
     var i18n_must_select_at_least_one_period = '$encoder.jsEscape( $i18n.getString( "must_select_at_least_one_period" ), "'")';
+    var i18n_cannot_select_orgunit_and_parent_orgunit_param = '$encoder.jsEscape( $i18n.getString( "cannot_select_orgunit_and_parent_orgunit_param" ), "'")';
 </script>
 
 #if ( $dimension )

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/table.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/table.js	2010-07-03 17:20:48 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/table.js	2010-07-05 21:00:54 +0000
@@ -182,13 +182,20 @@
         return false;
     }
     
+    if ( bothOrganisationUnitReportParamsChecked() )
+    {
+    	setMessage( i18n_cannot_select_orgunit_and_parent_orgunit_param );
+    	
+    	return false;
+    }
+    
     if ( !hasElements( "selectedPeriods" ) && !relativePeriodsChecked() )
     {
         setMessage( i18n_must_select_at_least_one_period );
         
         return false;
     }
-    
+        
     return true;
 }
 
@@ -230,6 +237,17 @@
     return false;
 }
 
+function bothOrganisationUnitReportParamsChecked()
+{
+	if ( isChecked( "paramParentOrganisationUnit" ) == true &&
+         isChecked( "paramOrganisationUnit" ) == true )
+    {
+        return true;
+    }
+    
+    return false;
+}
+
 // -----------------------------------------------------------------------------
 // Details
 // -----------------------------------------------------------------------------