← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2045: Simplication of logic in SelectAction

 

------------------------------------------------------------
revno: 2045
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2010-11-12 09:09:09 +0100
message:
  Simplication of logic in SelectAction
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SelectAction.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm


--
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-dataentry/src/main/java/org/hisp/dhis/de/action/SelectAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SelectAction.java	2010-11-11 18:03:00 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SelectAction.java	2010-11-12 08:09:09 +0000
@@ -61,11 +61,8 @@
     extends ActionSupport
 {
     private static final String CUSTOM_FORM = "customform";
-
     private static final String SECTION_FORM = "sectionform";
-
-    private static final String DEFAULT_FORM = "defaultform";
-    
+    private static final String DEFAULT_FORM = "defaultform";    
     private static final String MULTI_DIMENSIONAL_FORM = "multidimensionalform";   
 
     private static final Log log = LogFactory.getLog( SelectAction.class );
@@ -152,11 +149,11 @@
     // Input/output
     // -------------------------------------------------------------------------
 
-    private Boolean haveSection;
+    private Boolean hasSection;
 
-    public Boolean getHaveSection()
+    public Boolean getHasSection()
     {
-        return haveSection;
+        return hasSection;
     }
 
     private Boolean customDataEntryFormExists;
@@ -350,7 +347,7 @@
         // Get Section Information
         // ---------------------------------------------------------------------
 
-        haveSection = dataEntryScreenManager.hasSection( selectedDataSet );
+        hasSection = dataEntryScreenManager.hasSection( selectedDataSet );
 
         // ---------------------------------------------------------------------
         // Get the custom data entry form if any
@@ -378,18 +375,17 @@
             {
                 displayMode = CUSTOM_FORM;
             }
-            else if ( haveSection )
+            else if ( hasSection )
             {
                 displayMode = SECTION_FORM;
-            }            
+            }
+            else
+            {
+                displayMode = DEFAULT_FORM;
+            }
         }
         
-        if ( !customDataEntryFormExists && !haveSection )
-        {
-            displayMode = DEFAULT_FORM;
-        }
-
-        if ( displayMode.equals( SECTION_FORM ) && haveSection )
+        if ( displayMode.equals( SECTION_FORM ) && hasSection )
         {
             return SECTION_FORM;
         }

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm	2010-11-11 17:25:33 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm	2010-11-12 08:09:09 +0000
@@ -32,7 +32,7 @@
 	   #if( $displayMode == "sectionform" ) 
 	       checked="checked" 
 	   #end  
-	   #if( !$haveSection ) 
+	   #if( !$hasSection ) 
 	       disabled="disabled" 
 	   #end 
 	   onclick="document.getElementById( 'selectForm' ).submit();"/>
@@ -40,8 +40,7 @@
 
 	<input type="radio" id="displayModeDefault" name="displayMode" value="defaultform"
        #if( $displayMode == "defaultform" ) 
-           checked="checked" 
-           
+           checked="checked"           
        #end       
        onclick="document.getElementById( 'selectForm' ).submit();"/>    
     <label for="displayModeDefault">$i18n.getString( "use_default_form" )</label><br/><br/>