← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2036: Removed the default non-multidimensional form from data entry

 

------------------------------------------------------------
revno: 2036
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2010-11-11 19:03:00 +0100
message:
  Removed the default non-multidimensional form from data entry
removed:
  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/webapp/dhis-web-dataentry/form.vm
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/java/org/hisp/dhis/de/screen/DataEntryScreenManager.java
  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/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml


--
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
=== removed 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-11-11 17:36:25 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/FormAction.java	1970-01-01 00:00:00 +0000
@@ -1,395 +0,0 @@
-package org.hisp.dhis.de.action;
-
-/*
- * Copyright (c) 2004-2010, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import static org.hisp.dhis.options.SystemSettingManager.KEY_ZERO_VALUE_SAVE_MODE;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.hisp.dhis.customvalue.CustomValue;
-import org.hisp.dhis.customvalue.CustomValueService;
-import org.hisp.dhis.dataelement.CalculatedDataElement;
-import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
-import org.hisp.dhis.dataelement.DataElementCategoryService;
-import org.hisp.dhis.dataentryform.DataEntryForm;
-import org.hisp.dhis.datalock.DataSetLock;
-import org.hisp.dhis.datalock.DataSetLockService;
-import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.datavalue.DataValue;
-import org.hisp.dhis.datavalue.DataValueService;
-import org.hisp.dhis.de.comments.StandardCommentsManager;
-import org.hisp.dhis.de.screen.DataEntryScreenManager;
-import org.hisp.dhis.de.state.SelectedStateManager;
-import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.minmax.MinMaxDataElement;
-import org.hisp.dhis.minmax.MinMaxDataElementService;
-import org.hisp.dhis.options.SystemSettingManager;
-import org.hisp.dhis.options.displayproperty.DisplayPropertyHandler;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.period.Period;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Torgeir Lorange Ostby
- * @version $Id: FormAction.java 6216 2008-11-06 18:06:42Z eivindwa $
- */
-public class FormAction
-    implements Action
-{
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private CustomValueService customValueService;
-
-    public CustomValueService getCustomValueService()
-    {
-        return customValueService;
-    }
-
-    public void setCustomValueService( CustomValueService customValueService )
-    {
-        this.customValueService = customValueService;
-    }
-
-    private SystemSettingManager systemSettingManager;
-
-    public void setSystemSettingManager( SystemSettingManager systemSettingManager )
-    {
-        this.systemSettingManager = systemSettingManager;
-    }
-
-    private DataValueService dataValueService;
-
-    public void setDataValueService( DataValueService dataValueService )
-    {
-        this.dataValueService = dataValueService;
-    }
-
-    private StandardCommentsManager standardCommentsManager;
-
-    public void setStandardCommentsManager( StandardCommentsManager standardCommentsManager )
-    {
-        this.standardCommentsManager = standardCommentsManager;
-    }
-
-    private MinMaxDataElementService minMaxDataElementService;
-
-    public void setMinMaxDataElementService( MinMaxDataElementService minMaxDataElementService )
-    {
-        this.minMaxDataElementService = minMaxDataElementService;
-    }
-
-    private SelectedStateManager selectedStateManager;
-
-    public void setSelectedStateManager( SelectedStateManager selectedStateManager )
-    {
-        this.selectedStateManager = selectedStateManager;
-    }
-
-    private DataEntryScreenManager dataEntryScreenManager;
-
-    public void setDataEntryScreenManager( DataEntryScreenManager dataEntryScreenManager )
-    {
-        this.dataEntryScreenManager = dataEntryScreenManager;
-    }
-
-    private I18n i18n;
-
-    public void setI18n( I18n i18n )
-    {
-        this.i18n = i18n;
-    }
-
-    private DataSetLockService dataSetLockService;
-
-    public void setDataSetLockService( DataSetLockService dataSetLockService )
-    {
-        this.dataSetLockService = dataSetLockService;
-    }
-
-    private DataElementCategoryService categoryService;
-
-    public void setCategoryService( DataElementCategoryService categoryService )
-    {
-        this.categoryService = categoryService;
-    }
-
-    // -------------------------------------------------------------------------
-    // DisplayPropertyHandler
-    // -------------------------------------------------------------------------
-
-    private DisplayPropertyHandler displayPropertyHandler;
-
-    public void setDisplayPropertyHandler( DisplayPropertyHandler displayPropertyHandler )
-    {
-        this.displayPropertyHandler = displayPropertyHandler;
-    }
-
-    // -------------------------------------------------------------------------
-    // Output
-    // -------------------------------------------------------------------------
-
-    private List<DataElement> orderedDataElements = new ArrayList<DataElement>();
-
-    public List<DataElement> getOrderedDataElements()
-    {
-        return orderedDataElements;
-    }
-
-    private Map<Integer, DataValue> dataValueMap;
-
-    public Map<Integer, DataValue> getDataValueMap()
-    {
-        return dataValueMap;
-    }
-
-    private Map<CalculatedDataElement, Integer> calculatedValueMap;
-
-    public Map<CalculatedDataElement, Integer> getCalculatedValueMap()
-    {
-        return calculatedValueMap;
-    }
-
-    private List<String> standardComments;
-
-    public List<String> getStandardComments()
-    {
-        return standardComments;
-    }
-
-    private Map<String, String> dataElementValueTypeMap;
-
-    public Map<String, String> getDataElementValueTypeMap()
-    {
-        return dataElementValueTypeMap;
-    }
-
-    private Map<Integer, MinMaxDataElement> minMaxMap;
-
-    public Map<Integer, MinMaxDataElement> getMinMaxMap()
-    {
-        return minMaxMap;
-    }
-
-    private Integer integer = 0;
-
-    public Integer getInteger()
-    {
-        return integer;
-    }
-
-    private Boolean cdeFormExists;
-
-    private DataEntryForm dataEntryForm;
-
-    public DataEntryForm getDataEntryForm()
-    {
-        return this.dataEntryForm;
-    }
-
-    private String customDataEntryFormCode;
-
-    public String getCustomDataEntryFormCode()
-    {
-        return this.customDataEntryFormCode;
-    }
-
-    private Boolean zeroValueSaveMode;
-
-    public Boolean getZeroValueSaveMode()
-    {
-        return zeroValueSaveMode;
-    }
-
-    // -------------------------------------------------------------------------
-    // Input/output
-    // -------------------------------------------------------------------------
-
-    private List<CustomValue> customValues = new ArrayList<CustomValue>();
-
-    public List<CustomValue> getCustomValues()
-    {
-        return customValues;
-    }
-
-    private Integer selectedDataSetId;
-
-    public void setSelectedDataSetId( Integer selectedDataSetId )
-    {
-        this.selectedDataSetId = selectedDataSetId;
-    }
-
-    public Integer getSelectedDataSetId()
-    {
-        return selectedDataSetId;
-    }
-
-    private Integer selectedPeriodIndex;
-
-    public void setSelectedPeriodIndex( Integer selectedPeriodIndex )
-    {
-        this.selectedPeriodIndex = selectedPeriodIndex;
-    }
-
-    public Integer getSelectedPeriodIndex()
-    {
-        return selectedPeriodIndex;
-    }
-
-    private String disabled = " ";
-
-    private Integer optionComboId;
-
-    public Integer getOptionComboId()
-    {
-        return optionComboId;
-    }
-    
-    private String displayMode;
-
-    public String getDisplayMode()
-    {
-        return displayMode;
-    }
-
-    public void setDisplayMode( String displayMode )
-    {
-        this.displayMode = displayMode;
-    }
-
-    // -------------------------------------------------------------------------
-    // Action implementation
-    // -------------------------------------------------------------------------
-
-    public String execute()
-        throws Exception
-    {
-        zeroValueSaveMode = (Boolean) systemSettingManager.getSystemSetting( KEY_ZERO_VALUE_SAVE_MODE, false );
-
-        OrganisationUnit organisationUnit = selectedStateManager.getSelectedOrganisationUnit();
-
-        DataSet dataSet = selectedStateManager.getSelectedDataSet();
-
-        customValues = (List<CustomValue>) customValueService.getCustomValuesByDataSet( dataSet );
-
-        Period period = selectedStateManager.getSelectedPeriod();
-
-        DataSetLock dataSetLock = dataSetLockService.getDataSetLockByDataSetAndPeriod( dataSet, period );
-
-        if ( dataSetLock != null && dataSetLock.getSources().contains( organisationUnit ) )
-        {
-            disabled = "disabled";
-        }
-
-        Collection<DataElement> dataElements = dataSet.getDataElements();
-
-        if ( dataElements.size() == 0 )
-        {
-            return SUCCESS;
-        }
-
-        DataElementCategoryOptionCombo defaultOptionCombo = categoryService.getDefaultDataElementCategoryOptionCombo();
-
-        optionComboId = defaultOptionCombo.getId();
-
-        // ---------------------------------------------------------------------
-        // Get the min/max values
-        // ---------------------------------------------------------------------
-
-        Collection<MinMaxDataElement> minMaxDataElements = minMaxDataElementService.getMinMaxDataElements(
-            organisationUnit, dataElements );
-
-        minMaxMap = new HashMap<Integer, MinMaxDataElement>( minMaxDataElements.size() );
-
-        for ( MinMaxDataElement minMaxDataElement : minMaxDataElements )
-        {
-            minMaxMap.put( minMaxDataElement.getDataElement().getId(), minMaxDataElement );
-        }
-
-        // ---------------------------------------------------------------------
-        // Get the DataValues and create a map
-        // ---------------------------------------------------------------------
-
-        Collection<DataValue> dataValues = dataValueService.getDataValues( organisationUnit, period, dataElements );
-
-        dataValueMap = new HashMap<Integer, DataValue>( dataValues.size() );
-
-        for ( DataValue dataValue : dataValues )
-        {
-            dataValueMap.put( dataValue.getDataElement().getId(), dataValue );
-        }
-
-        // ---------------------------------------------------------------------
-        // Prepare values for unsaved CalculatedDataElements
-        // ---------------------------------------------------------------------
-
-        calculatedValueMap = dataEntryScreenManager.populateValuesForCalculatedDataElements( organisationUnit, dataSet,
-            period );
-
-        // ---------------------------------------------------------------------
-        // Make the standard comments available
-        // ---------------------------------------------------------------------
-
-        standardComments = standardCommentsManager.getStandardComments();
-
-        // ---------------------------------------------------------------------
-        // Make the DataElement types available
-        // ---------------------------------------------------------------------
-
-        dataElementValueTypeMap = new HashMap<String, String>();
-        dataElementValueTypeMap.put( DataElement.VALUE_TYPE_DATE, i18n.getString( "date" ) );
-        dataElementValueTypeMap.put( DataElement.VALUE_TYPE_BOOL, i18n.getString( "yes_no" ) );
-        dataElementValueTypeMap.put( DataElement.VALUE_TYPE_INT, i18n.getString( "int" ) );
-        dataElementValueTypeMap.put( DataElement.VALUE_TYPE_STRING, i18n.getString( "text" ) );
-
-        // ---------------------------------------------------------------------
-        // Get the custom data entry form (if any)
-        // ---------------------------------------------------------------------
-
-        dataEntryForm = dataSet.getDataEntryForm();
-        cdeFormExists = (dataEntryForm != null);
-
-        if ( cdeFormExists )
-        {
-            customDataEntryFormCode = dataEntryScreenManager.populateCustomDataEntryScreen(
-                dataEntryForm.getHtmlCode(), dataValues, calculatedValueMap, minMaxMap, disabled, zeroValueSaveMode,
-                i18n, dataSet );
-        }
-
-        displayPropertyHandler.handle( orderedDataElements );
-
-        return SUCCESS;
-    }
-}

=== 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 17:25:33 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SelectAction.java	2010-11-11 18:03:00 +0000
@@ -65,6 +65,8 @@
     private static final String SECTION_FORM = "sectionform";
 
     private static final String DEFAULT_FORM = "defaultform";
+    
+    private static final String MULTI_DIMENSIONAL_FORM = "multidimensionalform";   
 
     private static final Log log = LogFactory.getLog( SelectAction.class );
 
@@ -392,6 +394,6 @@
             return SECTION_FORM;
         }
 
-        return dataEntryScreenManager.getScreenType( selectedDataSet );
+        return MULTI_DIMENSIONAL_FORM;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DataEntryScreenManager.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DataEntryScreenManager.java	2010-06-23 12:06:35 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DataEntryScreenManager.java	2010-11-11 18:03:00 +0000
@@ -45,13 +45,7 @@
  * @version $Id$
  */
 public interface DataEntryScreenManager 
-{	    
-    String getScreenType( DataSet dataSet );
-    
-    boolean hasMixOfDimensions( DataSet dataset );
-    
-    boolean hasMultiDimensionalDataElement( DataSet dataSet );
-    
+{
     boolean hasMultiDimensionalDataElement( Section section );
     
     boolean hasSection( DataSet dataSet );

=== 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-10-28 09:17:13 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DefaultDataEntryScreenManager.java	2010-11-11 18:03:00 +0000
@@ -71,10 +71,6 @@
 {
     private static final Log log = LogFactory.getLog( DefaultDataEntryScreenManager.class );
     
-    private static final String DEFAULT_FORM = "defaultform";
-
-    private static final String MULTI_DIMENSIONAL_FORM = "multidimensionalform";    
-
     private static final String EMPTY = "";
 
     // -------------------------------------------------------------------------
@@ -112,39 +108,6 @@
     // -------------------------------------------------------------------------
     // DataEntryScreenManager implementation
     // -------------------------------------------------------------------------
-
-    public boolean hasMixOfDimensions( DataSet dataSet )
-    {
-        if ( dataSet.getDataElements().size() > 0 )
-        {
-            Iterator<DataElement> dataElementIterator = dataSet.getDataElements().iterator();
-
-            DataElementCategoryCombo catCombo = dataElementIterator.next().getCategoryCombo();
-
-            for ( DataElement de : dataSet.getDataElements() )
-            {
-                if ( catCombo != de.getCategoryCombo() )
-                {
-                    return true;
-                }
-            }
-        }
-
-        return false;
-    }
-
-    public boolean hasMultiDimensionalDataElement( DataSet dataSet )
-    {
-        for ( DataElement element : dataSet.getDataElements() )
-        {
-            if ( element.isMultiDimensional() )
-            {
-                return true;
-            }
-        }
-
-        return false;
-    }
     
     public boolean hasMultiDimensionalDataElement( Section section )
     {
@@ -159,11 +122,6 @@
         return false;
     }
 
-    public String getScreenType( DataSet dataSet )
-    {
-        return hasMultiDimensionalDataElement( dataSet ) ? MULTI_DIMENSIONAL_FORM : DEFAULT_FORM;
-    }
-
     public Collection<Integer> getAllCalculatedDataElements( DataSet dataSet )
     {
         Collection<Integer> calculatedDataElementIds = new HashSet<Integer>();

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml	2010-11-11 17:36:25 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml	2010-11-11 18:03:00 +0000
@@ -69,23 +69,6 @@
 		<property name="selectedStateManager" ref="org.hisp.dhis.de.state.SelectedStateManager" />
 	</bean>
 
-	<bean id="org.hisp.dhis.de.action.FormAction" class="org.hisp.dhis.de.action.FormAction"
-		scope="prototype">
-		<property name="dataSetLockService" ref="org.hisp.dhis.datalock.DataSetLockService" />
-		<property name="dataValueService" ref="org.hisp.dhis.datavalue.DataValueService" />
-		<property name="standardCommentsManager"
-			ref="org.hisp.dhis.de.comments.StandardCommentsManager" />
-		<property name="minMaxDataElementService"
-			ref="org.hisp.dhis.minmax.MinMaxDataElementService" />
-		<property name="dataEntryScreenManager"
-			ref="org.hisp.dhis.de.screen.DataEntryScreenManager" />
-		<property name="selectedStateManager" ref="org.hisp.dhis.de.state.SelectedStateManager" />
-		<property name="systemSettingManager" ref="org.hisp.dhis.options.SystemSettingManager" />
-		<property name="customValueService" ref="org.hisp.dhis.customvalue.CustomValueService" />
-		<property name="categoryService"
-			ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
-	</bean>
-
 	<bean id="org.hisp.dhis.de.action.multidimensional.FormAction"
 		class="org.hisp.dhis.de.action.multidimensional.FormAction" scope="prototype">
 		<property name="dataSetLockService" ref="org.hisp.dhis.datalock.DataSetLockService" />

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml	2010-11-11 17:25:33 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml	2010-11-11 18:03:00 +0000
@@ -16,12 +16,8 @@
 
 		<action name="select" class="org.hisp.dhis.de.action.SelectAction">
 			<interceptor-ref name="organisationUnitTreeStack" />
-			<result name="defaultform" type="chain">defaultform
-			</result>
-			<result name="sectionform" type="chain">sectionform
-			</result>
-			<result name="multidimensionalform" type="chain">multidimensionalform
-			</result>
+			<result name="sectionform" type="chain">sectionform</result>
+			<result name="multidimensionalform" type="chain">multidimensionalform</result>
 			<result name="success" type="velocity">/main.vm</result>
 			<param name="page">/dhis-web-dataentry/select.vm</param>
 			<param name="menu">/dhis-web-dataentry/menu.vm</param>
@@ -44,22 +40,6 @@
 			</result>
 		</action>
 
-		<action name="defaultform" class="org.hisp.dhis.de.action.FormAction">
-			<interceptor-ref name="organisationUnitTreeStack" />
-			<result name="success" type="velocity">/main.vm</result>
-			<param name="page">/dhis-web-dataentry/form.vm</param>
-			<param name="menu">/dhis-web-dataentry/menu.vm</param>
-			<param name="menuTreeHeight">420</param>
-			<param name="javascripts">
-				../dhis-web-commons/ouwt/ouwt.js,
-				javascript/general.js,javascript/form.js,
-				../dhis-web-commons/calendar/calendar.js,
-				../dhis-web-commons/calendar/calendar-lang.js,
-				../dhis-web-commons/calendar/calendar-setup.js
-			</param>
-			<param name="stylesheets">style/dhis-web-dataentry.css,style/custom_data_entry_form_styles.css</param>
-		</action>
-
 		<action name="sectionform" class="org.hisp.dhis.de.action.SectionFormAction">
 			<interceptor-ref name="organisationUnitTreeStack" />
 			<result name="success" type="velocity">/main.vm</result>

=== removed 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	2010-10-28 09:17:13 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm	1970-01-01 00:00:00 +0000
@@ -1,220 +0,0 @@
-<script>
-    customDataEntryFormExists = "false";
-    #if ( $customDataEntryFormExists)
-        customDataEntryFormExists = "true";
-    #end
-</script>
-
-#parse( "/dhis-web-dataentry/select.vm" )
-
-<div id="entryform">
-
-#if ( $customDataEntryFormExists && $displayMode=="customform" )
-			
-		#foreach( $optionCombo in $orderdCategoryOptionCombos )
-			
-			<td>
-				<span id="value[option$optionCombo.id].name" style="display:none">$optionComboNames.get( $optionCombo.id )</span>							
-			</td>		
-			
-		#end
-	
-	$customDataEntryFormCode	
-
-#else
-
-<table class="mainPageTable">
-	<col id="noCol">
-	<col id="deCol">
-	<col id="minCol">
-    <col id="entryCol">
-	<col id="maxCol">
-	<col id="commentCol">
-	<tr>
-		<th>$i18n.getString( "nr" )</th>
-		<th>$i18n.getString( "data_element" )</th>
-		<th style="display:none">$i18n.getString( "value_type" )</th>
-		<th>$i18n.getString( "min" )</th>
-		<th>$i18n.getString( "entry" )</th>
-		<th>$i18n.getString( "max" )</th>
-		<th>$i18n.getString( "comment" )</th>
-	</tr>
-#set( $count = 0 )
-#set( $mark = 0 )
-#set( $tabIndex = 1 )
-#foreach( $dataElement in $orderedDataElements )
-	#set( $count = $count + 1 )
-	#if( $mark == 1 )
-		#set( $mark = 0 )
-	#else
-		#set( $mark = 1 )
-	#end
-	#set( $dataValue = false )
-	#set( $dataValue = $dataValueMap.get( $dataElement.id ) )
-	#set( $calculatedValue = false )
-	#set( $calculatedValue = $calculatedValueMap.get( $dataElement ) )
-	#set( $minMax = false )
-	#set( $minMax = $minMaxMap.get( $dataElement.id ) )
-	#set( $calculated = false )
-	#set( $calculated = ($calculatedDataElementIds.contains($dataElement.id)) )
-	<tr #if( $mark == 0 ) style="background-color:#dddddd" #end>
-		##count
-		<td style="text-align:right">$count</td>
-		
-		##data element name
-		<td>
-			<span id="value[$dataElement.id].name" title="$!encoder.htmlEncode( $dataElement.description )">
-			#if( $dataElement.type == "int" && $auth.hasAccess( "dhis-web-dataentry", "viewHistory" ) )
-				<a href="javascript:viewHistory( $dataElement.id, $optionComboId, false  )">
-			#end
-			#if( $useShortName )
-				$encoder.htmlEncode( $dataElement.shortName )
-			#else
-				$encoder.htmlEncode( $dataElement.name )
-			#end
-			#if( $dataElement.type == "int" && $auth.hasAccess( "dhis-web-dataentry", "viewHistory" ) )
-				</a>
-			#end
-		    </span>
-		</td>
-		
-		##value type
-		<td style="display:none">$dataElementValueTypeMap.get( $dataElement.type )<span id="value[$dataElement.id].type" style="display:none">$dataElement.getDetailedNumberType()</span></td>
-		
-		##min value
-		<td>
-		#if( $dataElement.type == "int" )			 
-			<div id="value[$dataElement.id:$optionComboId].min" style="text-align:center">$!minMax.min</div>
-		#end
-		</td>
-		
-		##entry		
-		<td>				
-				
-		#if( $dataElement.type == "bool" )
-			<select name="entryselect" id="value[$dataElement.id].boolean" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue" )) onchange="saveBoolean( $dataElement.id, $optionComboId, this )" #else disabled="disabled" #end style="width:100%" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>				
-				<option value="">[$i18n.getString( "no_value" )]</option>
-				<option value="true" #if( $dataValue.value == "true" ) selected="selected" #end>$i18n.getString( "yes" )</option>
-				<option value="false" #if( $dataValue.value == "false" ) selected="selected" #end>$i18n.getString( "no" )</option>
-			</select>				
-		
-		#elseif( $dataElement.type == "date" )
-			<input name="entryfield" id="value[$dataElement.id].date" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue") ) onchange="saveDate( $dataElement.id, '$encoder.jsEncode( $dataElement.name )' )" #else disabled="disabled" #end>
-            <img src="../images/calendar_icon.gif" width="16" height="16" id="getValueDate" style="cursor: pointer;" title="$i18n.getString("date_selector")" onmouseover="this.style.background='orange';" onmouseout="this.style.background=''" alt="$i18n.getString( "value_date" )">
-            <script type="text/javascript">
-            	Calendar.setup({
-                	inputField     :    "value[$dataElement.id].date",      // id of the input field
-                    ifFormat       :    "$i18n.getString("format.date.label")",       // format of the input field
-                    button         :    "getValueDate"   // trigger for the calendar (button ID)
-                });
-            </script>                    
-        #else           
-            #if( $dataElement.type == "string" )
-				#set( $dataEntryId = "value[$dataElement.id].value:value[$optionComboId].value" )
-                #set( $coun = 0 ) 
-                #foreach($customValue in $customValues)
-                    #if($dataElement.id == $customValue.dataElement.id && $optionComboId == $customValue.optionCombo.id)                                    
-                        #set( $coun = $coun +1 )
-                    #end
-                #end  
-                    #if($coun>0)   
-                        <select name="entryselect" id="$dataEntryId" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue" )) onchange="saveBoolean($dataElement.id,$optionComboId, this )"  #else disabled="disabled" #end style="width:100%" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>
-                        <option value="" </option>                
-                            #foreach($customValue in $customValues)
-                                #if($dataElement.id == $customValue.dataElement.id && $optionComboId == $customValue.optionCombo.id)
-                            <option value="$customValue.customValue" #if( $dataValue.value == $customValue.customValue ) selected="selected" #end>$customValue.customValue</option>   
-                                #end
-                            #end 
-                        </select>
-                    #else
-                        <input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue") ) onchange="saveValue( $dataElement.id, $optionComboId, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode )" ondblclick="viewHistory( $dataElement.id, $optionComboId, true  )" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end #if( $dataElement.type == "int" ) ;text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>                                
-                    #end    
-            #end            
-            
-			#set( $minMaxError = false )
-			#if( $dataElement.type == "int" && $dataValue && $minMax )			
-				#if( $integer.parseInt( $dataValue.value ) < $minMax.min || $integer.parseInt( $dataValue.value ) > $minMax.max )
-					#set( $minMaxError = true )
-				#end
-			#end
-			#if ( $calculated )
-				<input name="entryfield" id="value[$dataElement.id].value" class="calculated" type="text" value="#if($dataValue) $!encoder.htmlEncode( $dataValue.value ) #elseif( $calculatedValue )$!encoder.htmlEncode( $calculatedValue ) #end" disabled="disabled" onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end #if( $dataElement.type == "int" ) ;text-align:center #end">
-			#else
-				#set( $dataEntryId = "value[$dataElement.id].value:value[$optionComboId].value" )	
-				#if( $dataElement.aggregationOperator == "sum"  && $dataElement.type != "string")
-					<input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue") ) onchange="saveValue( $dataElement.id, $optionComboId, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode)" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end #if( $dataElement.type == "int" ) ;text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>
-				#elseif( $dataElement.type != "string")
-				    <input name="entryfield" id="$dataEntryId" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue") ) onchange="saveValue( $dataElement.id, $optionComboId, '$encoder.jsEncode( $dataElement.name )', $zeroValueSaveMode)" #else disabled="disabled" #end onkeypress="return keyPress(event, this)" style="width:100% #if( $minMaxError ) ;background-color:#ffcccc #end #if( $dataElement.type == "int" ) ;text-align:center #end" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>
-				#end
-            #end
-		#end
-		</td>
-		
-		##max value
-		<td>
-		#if( $dataElement.type == "int" )
-			<div id="value[$dataElement.id:$optionComboId].max" style="text-align:center">$!minMax.max</div>
-		#end
-		</td>
-		
-		##comment
-		<td>
-			<select id="value[$dataElement.id:$optionComboId].comments" #if( $auth.hasAccess( "dhis-web-dataentry", "saveComment" ) ) onchange="commentSelected( $dataElement.id, $optionComboId )" #else disabled="disabled" #end #if( $dataValue.comment && !$standardComments.contains( $dataValue.comment ) ) style="display:none; width:100%" #end#if( $locked ) disabled="disabled"#end>
-				<option value="">[$i18n.getString( "no_comment" )]</option>
-				<option value="custom">[$i18n.getString( "custom_comment" )]</option>
-			#foreach( $comment in $standardComments )
-				<option value="$encoder.htmlEncode( $comment )" #if( $encoder.htmlEncode( $comment ) == $encoder.htmlEncode( $dataValue.comment ) ) selected="selected" #end>$encoder.htmlEncode( $comment )</option>
-			#end
-			</select>
-			<input id="value[$dataElement.id:$optionComboId].comment" type="text" value="$!encoder.htmlEncode( $dataValue.comment )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveComment" ))
-			    onblur="commentLeft( $dataElement.id, $optionComboId )" #else disabled="disabled" #end style="width:100% #if( !$dataValue.comment || $standardComments.contains( $dataValue.comment )) ;display:none #end">
-		</td>
-	</tr>
-	#set( $tabIndex = $tabIndex + 1 )
-#end
-</table>
-#end
-</div>
-#parse( "/dhis-web-dataentry/completeRegistration.vm" )
-
-<script type="text/javascript">
-	
-	var calculatedDataElementMap = {
-	#set( $count = 1 )
-	#foreach( $cde in $calculatedDataElementMap.keySet() )
-	  #set( $innerCount = 1 )
-	  #set( $factorMap = $calculatedDataElementMap.get($cde) )
-	  $cde.id : {
-	  #foreach ( $de in $factorMap.keySet() )
-        $de.id : $factorMap.get($de) #if ( $innerCount < $factorMap.size() ),#end
-        #set( $innerCount = $innerCount + 1 )
-	  #end
-      } #if ( $count < $calculatedDataElementMap.size() ),#end
-      #set( $count = $count + 1 )
-	#end
-    }
-	#if( $registration || $periods.size() == 0 ) 
-		changeInputTextStatus(true);
-	#end
-
-	function changeInputTextStatus( disabled ){	
-		
-		if($dataEntryFormCompleted){
-			var entryform = document.getElementById("entryform");
-			
-			var inputList = entryform.getElementsByTagName('input');
-			for(var i=0;i<inputList.length;i++){
-				var input = inputList[i];
-					input.disabled = disabled;
-			}	
-			
-			var selectList = entryform.getElementsByTagName('select');
-			for(var i=0;i< selectList.length;i++){
-				var select =  selectList[i];
-					select.disabled = disabled;
-			}	
-		}		
-	
-	}
-
-</script>
\ No newline at end of file