=== 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 minMaxDataElements = minMaxDataElementService.getMinMaxDataElements( - organisationUnit, dataElements ); + Collection minMaxDataElements = minMaxDataElementService.getMinMaxDataElements( organisationUnit, dataElements ); minMaxMap = new HashMap( minMaxDataElements.size() ); @@ -344,8 +338,7 @@ // Get the DataValues and create a map // --------------------------------------------------------------------- - Collection dataValues = dataValueService.getDataValues( organisationUnit, period, dataElements, - defaultOptionCombo ); + Collection dataValues = dataValueService.getDataValues( organisationUnit, period, dataElements, defaultOptionCombo ); dataValueMap = new HashMap( 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 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 optionsMap = new TreeMap(); @@ -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 cols = new ArrayList( 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