=== 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 2010-07-07 10:22:14 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/FormAction.java 2010-07-21 10:31:21 +0000 @@ -292,6 +292,18 @@ { return optionComboId; } + + private String displayMode; + + public String getDisplayMode() + { + return displayMode; + } + + public void setDisplayMode( String displayMode ) + { + this.displayMode = displayMode; + } // ------------------------------------------------------------------------- // Action implementation === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SectionFormAction.java' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SectionFormAction.java 2010-06-27 15:47:33 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SectionFormAction.java 2010-07-21 10:31:21 +0000 @@ -311,6 +311,18 @@ return zeroValueSaveMode; } + private String displayMode; + + public String getDisplayMode() + { + return displayMode; + } + + public void setDisplayMode( String displayMode ) + { + this.displayMode = displayMode; + } + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -367,6 +379,7 @@ for ( Section section : sections ) { + if ( section.getDataElements().size() > 0 ) { orderedCategoryCombos.add( section.getDataElements().iterator().next().getCategoryCombo() ); === 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-06-27 15:47:33 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SelectAction.java 2010-07-21 10:31:21 +0000 @@ -61,8 +61,12 @@ public class SelectAction 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 Log log = LogFactory.getLog( SelectAction.class ); // ------------------------------------------------------------------------- @@ -161,18 +165,6 @@ return haveSection; } - private String useSectionForm; - - public String getUseSectionForm() - { - return useSectionForm; - } - - public void setUseSectionForm( String useSectionForm ) - { - this.useSectionForm = useSectionForm; - } - private Boolean customDataEntryFormExists; public Boolean getCustomDataEntryFormExists() @@ -180,16 +172,16 @@ return this.customDataEntryFormExists; } - private String useDefaultForm; + private String displayMode; - public String getUseDefaultForm() + public String getDisplayMode() { - return useDefaultForm; + return displayMode; } - public void setUseDefaultForm( String useDefaultForm ) + public void setDisplayMode( String displayMode ) { - this.useDefaultForm = useDefaultForm; + this.displayMode = displayMode; } private Integer selectedDataSetId; @@ -216,18 +208,6 @@ return selectedPeriodIndex; } - private String useShortName; - - public void setUseShortName( String useShortName ) - { - this.useShortName = useShortName; - } - - public String getUseShortName() - { - return useShortName; - } - private Collection calculatedDataElementIds; public Collection getCalculatedDataElementIds() @@ -347,7 +327,7 @@ period = selectedStateManager.getSelectedPeriod(); DataSetLock dataSetLock = dataSetLockService.getDataSetLockByDataSetAndPeriod( selectedDataSet, period ); - + if ( dataSetLock != null && dataSetLock.getSources().contains( organisationUnit ) ) { locked = true; @@ -366,12 +346,6 @@ period = selectedStateManager.getSelectedPeriod(); // --------------------------------------------------------------------- - // Get Section Information - // --------------------------------------------------------------------- - - haveSection = dataEntryScreenManager.hasSection( selectedDataSet ); - - // --------------------------------------------------------------------- // Get CalculatedDataElementInformation // --------------------------------------------------------------------- @@ -379,6 +353,12 @@ calculatedDataElementMap = dataEntryScreenManager.getNonSavedCalculatedDataElements( selectedDataSet ); // --------------------------------------------------------------------- + // Get Section Information + // --------------------------------------------------------------------- + + haveSection = dataEntryScreenManager.hasSection( selectedDataSet ); + + // --------------------------------------------------------------------- // Get the custom data entry form if any // --------------------------------------------------------------------- @@ -392,12 +372,30 @@ if ( selectedDataSetId != null && selectedPeriodIndex != null && organisationUnit != null ) { - registration = registrationService.getCompleteDataSetRegistration( selectedDataSet, period, organisationUnit ); + registration = registrationService.getCompleteDataSetRegistration( selectedDataSet, period, + organisationUnit ); registrationDate = registration != null ? registration.getDate() : new Date(); - } - - if ( useSectionForm != null ) + } + + if ( displayMode == null ) + { + if ( customDataEntryFormExists ) + { + displayMode = CUSTOM_FORM; + } + else if ( haveSection ) + { + displayMode = SECTION_FORM; + } + } + + if( !customDataEntryFormExists && !haveSection ) + { + displayMode = DEFAULT_FORM; + } + + if ( displayMode.equals( SECTION_FORM ) && haveSection ) { return SECTION_FORM; } === 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 2010-07-07 10:22:14 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/multidimensional/FormAction.java 2010-07-21 10:31:21 +0000 @@ -74,7 +74,7 @@ */ public class FormAction implements Action -{ +{ // ------------------------------------------------------------------------- // Dependencies @@ -361,6 +361,18 @@ private String disabled = " "; + private String displayMode; + + public String getDisplayMode() + { + return displayMode; + } + + public void setDisplayMode( String displayMode ) + { + this.displayMode = displayMode; + } + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DefaultDataEntryScreenManager.java' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DefaultDataEntryScreenManager.java 2010-07-10 12:15:44 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DefaultDataEntryScreenManager.java 2010-07-21 10:31:21 +0000 @@ -73,7 +73,7 @@ private static final String DEFAULT_FORM = "defaultform"; - private static final String MULTI_DIMENSIONAL_FORM = "multidimensionalform"; + private static final String MULTI_DIMENSIONAL_FORM = "multidimensionalform"; private static final String EMPTY = ""; === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties 2010-07-12 15:24:04 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties 2010-07-21 10:31:21 +0000 @@ -95,6 +95,7 @@ no_period_selected = No Period Selected no_dataelement_selected = No Data Element Selected use_default_form = Use Default Form +use_custom_form = Use Custom Form complete = Complete undo = Undo confirm_complete = Are you sure this dataset is complete? === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm 2009-12-21 05:32:40 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm 2010-07-21 10:31:21 +0000 @@ -9,7 +9,7 @@
-#if ( $customDataEntryFormExists && !$useDefaultForm ) +#if ( $customDataEntryFormExists && $displayMode=="customform" ) #foreach( $optionCombo in $orderdCategoryOptionCombos ) === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/multidimensional/form.vm' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/multidimensional/form.vm 2010-02-05 09:05:13 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/multidimensional/form.vm 2010-07-21 10:31:21 +0000 @@ -24,7 +24,7 @@ #else - #if ( $customDataEntryFormExists && !$useDefaultForm ) + #if ( $customDataEntryFormExists && $displayMode=="customform" ) #foreach( $optionCombo in $allOptionCombos ) === 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-07-12 15:24:04 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm 2010-07-21 10:31:21 +0000 @@ -18,21 +18,33 @@

- -
+
+ +
- +
- -

+ +
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addSection.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addSection.vm 2010-07-10 12:45:22 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addSection.vm 2010-07-21 10:31:21 +0000 @@ -101,8 +101,8 @@ - + +