← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 784: Removed unnecessary code.

 

------------------------------------------------------------
revno: 784
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Mon 2009-09-28 01:08:36 +0200
message:
  Removed unnecessary code.
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/FormAction.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/multidimensional/FormAction.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-dataentry/src/main/java/org/hisp/dhis/de/action/FormAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/FormAction.java	2009-09-27 19:34:28 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/FormAction.java	2009-09-27 23:08:36 +0000
@@ -294,11 +294,6 @@
     {
         zeroValueSaveMode = (Boolean) systemSettingManager.getSystemSetting( KEY_ZERO_VALUE_SAVE_MODE, false );
 
-        if ( zeroValueSaveMode == null )
-        {
-            zeroValueSaveMode = false;
-        }
-
         OrganisationUnit organisationUnit = selectedStateManager.getSelectedOrganisationUnit();
 
         DataSet dataSet = selectedStateManager.getSelectedDataSet();
@@ -330,8 +325,7 @@
         // Get the min/max values
         // ---------------------------------------------------------------------
 
-        Collection<MinMaxDataElement> minMaxDataElements = minMaxDataElementService.getMinMaxDataElements(
-            organisationUnit, dataElements );
+        Collection<MinMaxDataElement> minMaxDataElements = minMaxDataElementService.getMinMaxDataElements( organisationUnit, dataElements );
 
         minMaxMap = new HashMap<Integer, MinMaxDataElement>( minMaxDataElements.size() );
 
@@ -344,8 +338,7 @@
         // Get the DataValues and create a map
         // ---------------------------------------------------------------------
 
-        Collection<DataValue> dataValues = dataValueService.getDataValues( organisationUnit, period, dataElements,
-            defaultOptionCombo );
+        Collection<DataValue> dataValues = dataValueService.getDataValues( organisationUnit, period, dataElements, defaultOptionCombo );
 
         dataValueMap = new HashMap<Integer, DataValue>( dataValues.size() );
 
@@ -358,8 +351,7 @@
         // Prepare values for unsaved CalculatedDataElements
         // ---------------------------------------------------------------------
 
-        calculatedValueMap = dataEntryScreenManager.populateValuesForCalculatedDataElements( organisationUnit, dataSet,
-            period );
+        calculatedValueMap = dataEntryScreenManager.populateValuesForCalculatedDataElements( organisationUnit, dataSet, period );
 
         // ---------------------------------------------------------------------
         // Make the standard comments available

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/multidimensional/FormAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/multidimensional/FormAction.java	2009-09-27 19:34:28 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/multidimensional/FormAction.java	2009-09-27 23:08:36 +0000
@@ -376,11 +376,6 @@
 
         zeroValueSaveMode = (Boolean) systemSettingManager.getSystemSetting( KEY_ZERO_VALUE_SAVE_MODE, false );
 
-        if ( zeroValueSaveMode == null )
-        {
-            zeroValueSaveMode = false;
-        }
-
         OrganisationUnit organisationUnit = selectedStateManager.getSelectedOrganisationUnit();
 
         DataSet dataSet = selectedStateManager.getSelectedDataSet();
@@ -403,10 +398,10 @@
             return SUCCESS;
         }
 
-        for ( DataElement de : dataElements )
+        for ( DataElement element : dataElements )
         {
             Collection<DataElementCategoryOptionCombo> optionCombos = dataElementCategoryOptionComboService
-                .sortDataElementCategoryOptionCombos( de.getCategoryCombo() );
+                .sortDataElementCategoryOptionCombos( element.getCategoryCombo() );
 
             for ( DataElementCategoryOptionCombo optionCombo : optionCombos )
             {
@@ -417,13 +412,11 @@
             }
         }
 
-        /*
-         * Perform ordering of categories and their options so that they could
-         * be displayed as in the paper form.
-         * 
-         * Note that the total number of entry cells to be generated are the
-         * multiple of options each category is going to provide.
-         */
+        // ---------------------------------------------------------------------
+        // Perform ordering of categories and their options so that they could
+        // be displayed as in the paper form. Note that the total number of entry 
+        // cells to be generated are the multiple of options fromo each category.
+        // ---------------------------------------------------------------------
 
         DataElement sample = dataElements.iterator().next();
 
@@ -434,8 +427,7 @@
 
         numberOfTotalColumns = orderdCategoryOptionCombos.size();
 
-        for ( DataElementCategory category : categories ) // Get the order of
-        // categories
+        for ( DataElementCategory category : categories ) // Get the order of categories
         {
             DataElementDimensionRowOrder rowOrder = dataElementDimensionRowOrderService
                 .getDataElementDimensionRowOrder( decbo, category );
@@ -452,8 +444,7 @@
 
         orderedCategories = categoryMap.values();
 
-        for ( DataElementCategory dec : orderedCategories ) // Get the order of
-        // options
+        for ( DataElementCategory dec : orderedCategories ) // Get the order of options
         {
             Map<Integer, DataElementCategoryOption> optionsMap = new TreeMap<Integer, DataElementCategoryOption>();
 
@@ -475,10 +466,9 @@
             orderedOptionsMap.put( dec.getId(), optionsMap.values() );
         }
 
-        /*
-         * Calculating the number of times each category is supposed to be
-         * repeated in the dataentry form.
-         */
+        // ---------------------------------------------------------------------
+        // Calculating the number of times each category should be repeated
+        // ---------------------------------------------------------------------
 
         int catColSpan = numberOfTotalColumns;
 
@@ -487,7 +477,7 @@
         for ( DataElementCategory cat : orderedCategories )
         {
             catColSpan = catColSpan / cat.getCategoryOptions().size();
-            int total = numberOfTotalColumns / (catColSpan * cat.getCategoryOptions().size());
+            int total = numberOfTotalColumns / ( catColSpan * cat.getCategoryOptions().size() );
             Collection<Integer> cols = new ArrayList<Integer>( total );
 
             for ( int i = 0; i < total; i++ )
@@ -496,7 +486,7 @@
             }
 
             /*
-             * Cols are made to be a collection simply to facilitate a for loop
+             * TODO Cols are made to be a collection simply to facilitate a for loop
              * in the velocity template - there should be a better way of "for"
              * doing a loop.
              */
@@ -548,8 +538,7 @@
         // Prepare values for unsaved CalculatedDataElements
         // ---------------------------------------------------------------------
 
-        calculatedValueMap = dataEntryScreenManager.populateValuesForCalculatedDataElements( organisationUnit, dataSet,
-            period );
+        calculatedValueMap = dataEntryScreenManager.populateValuesForCalculatedDataElements( organisationUnit, dataSet, period );
 
         // ---------------------------------------------------------------------
         // Make the standard comments available