← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11389: wip, implement cloning of dataelements. removed need for separate add/update form.

 

------------------------------------------------------------
revno: 11389
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-07-12 16:21:55 +0700
message:
  wip, implement cloning of dataelements. removed need for separate add/update form.
removed:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowUpdateDataElementFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm
modified:
  dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowAddDataElementForm.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.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-commons/src/main/resources/i18n_global.properties'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties	2013-07-02 17:02:54 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties	2013-07-12 09:21:55 +0000
@@ -146,6 +146,7 @@
 back=Back
 ok=OK
 cancel=Cancel
+clone=Clone
 add=Add
 edit=Edit
 reply=Reply

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowAddDataElementForm.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowAddDataElementForm.java	2012-11-05 18:32:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowAddDataElementForm.java	2013-07-12 09:21:55 +0000
@@ -27,15 +27,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
+import com.opensymphony.xwork2.Action;
 import org.hisp.dhis.attribute.Attribute;
 import org.hisp.dhis.attribute.AttributeService;
 import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator;
 import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
+import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.dataelement.DataElementGroup;
@@ -48,7 +45,10 @@
 import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 
-import com.opensymphony.xwork2.Action;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
 
 /**
  * @author Hans S. Toemmerholt
@@ -163,6 +163,20 @@
         return legendSets;
     }
 
+    private String dataElementId;
+
+    public void setDataElementId( String dataElementId )
+    {
+        this.dataElementId = dataElementId;
+    }
+
+    private DataElement dataElement;
+
+    public DataElement getDataElement()
+    {
+        return dataElement;
+    }
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -187,13 +201,18 @@
         optionSets = new ArrayList<OptionSet>( optionService.getAllOptionSets() );
 
         legendSets = new ArrayList<MapLegendSet>( mappingService.getAllMapLegendSets() );
-        
+
         Collections.sort( dataElementCategoryCombos, IdentifiableObjectNameComparator.INSTANCE );
         Collections.sort( groupSets, IdentifiableObjectNameComparator.INSTANCE );
         Collections.sort( attributes, new AttributeSortOrderComparator() );
         Collections.sort( optionSets, IdentifiableObjectNameComparator.INSTANCE );
         Collections.sort( legendSets, IdentifiableObjectNameComparator.INSTANCE );
-                
+
+        if ( dataElementId != null )
+        {
+            dataElement = dataElementService.getDataElement( dataElementId );
+        }
+
         return SUCCESS;
     }
 }

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowUpdateDataElementFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowUpdateDataElementFormAction.java	2012-11-05 18:32:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowUpdateDataElementFormAction.java	1970-01-01 00:00:00 +0000
@@ -1,242 +0,0 @@
-package org.hisp.dhis.dd.action.dataelement;
-
-/*
- * Copyright (c) 2004-2012, 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 java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.hisp.dhis.attribute.Attribute;
-import org.hisp.dhis.attribute.AttributeService;
-import org.hisp.dhis.attribute.comparator.AttributeSortOrderComparator;
-import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
-import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.dataelement.DataElementCategoryCombo;
-import org.hisp.dhis.dataelement.DataElementCategoryService;
-import org.hisp.dhis.dataelement.DataElementGroup;
-import org.hisp.dhis.dataelement.DataElementGroupSet;
-import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.mapping.MapLegendSet;
-import org.hisp.dhis.mapping.MappingService;
-import org.hisp.dhis.option.OptionService;
-import org.hisp.dhis.option.OptionSet;
-import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.system.util.AttributeUtils;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Hans S. Toemmerholt
- * @version $Id: GetDataElementAction.java 2869 2007-02-20 14:26:09Z andegje $
- */
-public class ShowUpdateDataElementFormAction
-    implements Action
-{
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private DataElementService dataElementService;
-
-    public void setDataElementService( DataElementService dataElementService )
-    {
-        this.dataElementService = dataElementService;
-    }
-
-    private DataElementCategoryService dataElementCategoryService;
-
-    public void setDataElementCategoryService( DataElementCategoryService dataElementCategoryService )
-    {
-        this.dataElementCategoryService = dataElementCategoryService;
-    }
-
-    private OrganisationUnitService organisationUnitService;
-
-    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
-    {
-        this.organisationUnitService = organisationUnitService;
-    }
-
-    private AttributeService attributeService;
-
-    public void setAttributeService( AttributeService attributeService )
-    {
-        this.attributeService = attributeService;
-    }
-
-    private OptionService optionService;
-
-    public void setOptionService( OptionService optionService )
-    {
-        this.optionService = optionService;
-    }
-
-    private MappingService mappingService;
-
-    public void setMappingService( MappingService mappingService )
-    {
-        this.mappingService = mappingService;
-    }
-
-    // -------------------------------------------------------------------------
-    // Input/output
-    // -------------------------------------------------------------------------
-
-    private Integer id;
-
-    public void setId( Integer id )
-    {
-        this.id = id;
-    }
-
-    private DataElement dataElement;
-
-    public DataElement getDataElement()
-    {
-        return dataElement;
-    }
-
-    private Collection<DataElementGroup> dataElementGroups;
-
-    public Collection<DataElementGroup> getDataElementGroups()
-    {
-        return dataElementGroups;
-    }
-
-    private List<DataElementCategoryCombo> dataElementCategoryCombos;
-
-    public List<DataElementCategoryCombo> getDataElementCategoryCombos()
-    {
-        return dataElementCategoryCombos;
-    }
-
-    private List<OrganisationUnitLevel> organisationUnitLevels;
-
-    public List<OrganisationUnitLevel> getOrganisationUnitLevels()
-    {
-        return organisationUnitLevels;
-    }
-
-    private List<OrganisationUnitLevel> aggregationLevels = new ArrayList<OrganisationUnitLevel>();
-
-    public List<OrganisationUnitLevel> getAggregationLevels()
-    {
-        return aggregationLevels;
-    }
-
-    private DataElementCategoryCombo defaultCategoryCombo;
-
-    public DataElementCategoryCombo getDefaultCategoryCombo()
-    {
-        return defaultCategoryCombo;
-    }
-
-    private List<DataElementGroupSet> groupSets;
-
-    public List<DataElementGroupSet> getGroupSets()
-    {
-        return groupSets;
-    }
-
-    private List<Attribute> attributes;
-
-    public List<Attribute> getAttributes()
-    {
-        return attributes;
-    }
-
-    public Map<Integer, String> attributeValues = new HashMap<Integer, String>();
-
-    public Map<Integer, String> getAttributeValues()
-    {
-        return attributeValues;
-    }
-
-    private List<OptionSet> optionSets;
-
-    public List<OptionSet> getOptionSets()
-    {
-        return optionSets;
-    }
-
-    private List<MapLegendSet> legendSets;
-
-    public List<MapLegendSet> getLegendSets()
-    {
-        return legendSets;
-    }
-
-    // -------------------------------------------------------------------------
-    // Action implementation
-    // -------------------------------------------------------------------------
-
-    public String execute()
-    {
-        defaultCategoryCombo = dataElementCategoryService
-            .getDataElementCategoryComboByName( DataElementCategoryCombo.DEFAULT_CATEGORY_COMBO_NAME );
-
-        dataElementCategoryCombos = new ArrayList<DataElementCategoryCombo>( dataElementCategoryService
-            .getAllDataElementCategoryCombos() );
-
-        dataElement = dataElementService.getDataElement( id );
-
-        organisationUnitLevels = organisationUnitService.getOrganisationUnitLevels();
-
-        Map<Integer, OrganisationUnitLevel> levelMap = organisationUnitService.getOrganisationUnitLevelMap();
-
-        for ( Integer level : dataElement.getAggregationLevels() )
-        {
-            aggregationLevels.add( levelMap.get( level ) );
-        }
-
-        organisationUnitLevels.removeAll( aggregationLevels );
-
-        groupSets = new ArrayList<DataElementGroupSet>( dataElementService
-            .getCompulsoryDataElementGroupSetsWithMembers() );
-
-        attributes = new ArrayList<Attribute>( attributeService.getDataElementAttributes() );
-
-        attributeValues = AttributeUtils.getAttributeValueMap( dataElement.getAttributeValues() );
-
-        optionSets = new ArrayList<OptionSet>( optionService.getAllOptionSets() );
-
-        legendSets = new ArrayList<MapLegendSet>( mappingService.getAllMapLegendSets() );
-        
-        Collections.sort( dataElementCategoryCombos, IdentifiableObjectNameComparator.INSTANCE );
-        Collections.sort( groupSets, IdentifiableObjectNameComparator.INSTANCE );
-        Collections.sort( attributes, new AttributeSortOrderComparator() );
-        Collections.sort( optionSets, IdentifiableObjectNameComparator.INSTANCE );
-        Collections.sort( legendSets, IdentifiableObjectNameComparator.INSTANCE );
-
-        return SUCCESS;
-    }
-}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml	2013-03-14 10:55:38 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml	2013-07-12 09:21:55 +0000
@@ -73,7 +73,7 @@
     <property name="mappingService" ref="org.hisp.dhis.mapping.MappingService" />
   </bean>
 
-  <bean id="org.hisp.dhis.dd.action.dataelement.ShowUpdateDataElementFormAction" class="org.hisp.dhis.dd.action.dataelement.ShowUpdateDataElementFormAction"
+  <bean id="org.hisp.dhis.dd.action.dataelement.ShowDataElementFormAction" class="org.hisp.dhis.dd.action.dataelement.ShowDataElementFormAction"
     scope="prototype">
     <property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
     <property name="dataElementCategoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml	2013-03-14 10:55:38 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml	2013-07-12 09:21:55 +0000
@@ -50,9 +50,9 @@
       <param name="requiredAuthorities">F_DATAELEMENT_DELETE</param>
     </action>
 
-    <action name="showAddDataElementForm" class="org.hisp.dhis.dd.action.dataelement.ShowAddDataElementForm">
+    <action name="showAddDataElementForm" class="org.hisp.dhis.dd.action.dataelement.ShowDataElementFormAction">
       <result name="success" type="velocity">/main.vm</result>
-      <param name="page">/dhis-web-maintenance-datadictionary/addDataElementForm.vm</param>
+      <param name="page">/dhis-web-maintenance-datadictionary/dataElementForm.vm</param>
       <param name="javascripts">javascript/shortName.js,javascript/dataElement.js</param>
       <param name="anyAuthorities">F_DATAELEMENT_PUBLIC_ADD, F_DATAELEMENT_PRIVATE_ADD</param>
     </action>
@@ -62,9 +62,9 @@
       <param name="anyAuthorities">F_DATAELEMENT_PUBLIC_ADD, F_DATAELEMENT_PRIVATE_ADD</param>
     </action>
 
-    <action name="showUpdateDataElementForm" class="org.hisp.dhis.dd.action.dataelement.ShowUpdateDataElementFormAction">
+    <action name="showUpdateDataElementForm" class="org.hisp.dhis.dd.action.dataelement.ShowDataElementFormAction">
       <result name="success" type="velocity">/main.vm</result>
-      <param name="page">/dhis-web-maintenance-datadictionary/updateDataElementForm.vm</param>
+      <param name="page">/dhis-web-maintenance-datadictionary/dataElementForm.vm</param>
       <param name="javascripts">javascript/shortName.js,javascript/dataElement.js,javascript/updateLoad.js</param>
       <param name="requiredAuthorities">F_DATAELEMENT_UPDATE</param>
     </action>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm	2013-01-28 06:59:48 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm	2013-07-12 09:21:55 +0000
@@ -1,6 +1,5 @@
 <script type="text/javascript">
-	jQuery( document ).ready( function()
-	{
+	jQuery( document ).ready( function() {
 	    validation2( 'addDataElementForm', function( form )
 	    {
 	        dhis2.select.selectAll( jQuery( '#aggregationLevels' ) );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm	2013-06-29 14:16:34 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElement.vm	2013-07-12 09:21:55 +0000
@@ -72,7 +72,7 @@
 				<tr id="tr${dataElement.id}">
 					<td onclick="showDataElementDetails( $dataElement.id )">$encoder.htmlEncode( $dataElement.displayName )</td>
 					<td style="text-align:right">
-                        <a href="showUpdateDataElementForm.action?id=$dataElement.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"/></a>
+                        <a href="showUpdateDataElementForm.action?id=$dataElement.id&update=true" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"/></a>
                         <a href="javascript:translate( 'DataElement', '$dataElement.id' )" title="$i18n.getString( 'translation_translate' )"><img src="../images/i18n.png" alt="$i18n.getString( 'translation_translate' )"/></a>
                         <a href="javascript:removeDataElement( $dataElement.id, '$encoder.jsEncode( $dataElement.displayName )' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"/></a>
                         <a href="javascript:showDataElementDetails( $dataElement.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"/></a>

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm	2013-01-28 06:59:48 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm	1970-01-01 00:00:00 +0000
@@ -1,251 +0,0 @@
-<script type="text/javascript">
-	jQuery(document).ready(	function() {
-	    validation2( 'updateDataElementForm', function( form )
-	    {
-	        dhis2.select.selectAll( jQuery( '#aggregationLevels' ) );
-	        form.submit();
-	    }, {
-	        'beforeValidateHandler' : function()
-	        {
-	            setFieldValue( 'submitCategoryComboId', getFieldValue( 'selectedCategoryComboId' ) );
-	            setFieldValue( 'submitValueType', getFieldValue( 'valueType' ) );
-				enable('aggregationOperatorSelect');
-				#tblDynamicAttributesJavascript()
-	        },
-	        'rules' : getValidationRules( "dataElement" )
-	    } );
-
-		checkValueIsExist( "name", "validateDataElement.action", {id:getFieldValue('id')});
-		checkValueIsExist( "shortName", "validateDataElement.action", {id:getFieldValue('id')});
-		checkValueIsExist( "code", "validateDataElement.action", {id:getFieldValue('id')});
-
-		updateAggreationOperation( getFieldValue('valueType') );
-	});
-
-	var previousName = '$encoder.jsEscape( $dataElement.name, "'" )';
-</script>
-
-<h3>$i18n.getString( "edit_data_element" )</h3>
-
-<form id="updateDataElementForm" action="updateDataElement.action" method="post" class="inputForm">
-<input type="hidden" id="id" name="id" value="$dataElement.id"/>
-<input type="hidden" id="defaultCategoryCombo" value="$defaultCategoryCombo.id"/>
-<select name="factors" id="factorsSubmit" multiple="multiple" style="display:none"></select>
-
-<table>
-	<tr>
-		<th colspan="2">$i18n.getString( "details" )</th>
-	</tr>
-	<tr>
-		<td><label for="name">$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-		<td><input type="text" id="name" name="name" value="$encoder.htmlEncode( $dataElement.name )" onchange="nameChanged()"></td>
-	</tr>
-	<tr>
-		<td><label for="shortName">$i18n.getString( "short_name" )</label></td>
-		<td><input type="text" id="shortName" name="shortName" value="$encoder.htmlEncode( $dataElement.shortName )"></td>
-	</tr>
-	<tr>
-		<td><label for="code">$i18n.getString( "code" )</label></td>
-		<td><input type="text" id="code" name="code" value="$!encoder.htmlEncode( $dataElement.code )"></td>
-	</tr>
-	<tr>
-		<td><label for="description">$i18n.getString( "description" )</label></td>
-		<td><textarea id="description" name="description">$!encoder.htmlEncode( $dataElement.description )</textarea></td>
-	</tr>
-	<tr>
-		<td><label for="formName">$i18n.getString( "form_name" )</label></td>
-		<td><input type="text" id="formName" name="formName" value="$!encoder.htmlEncode( $dataElement.formName )"></td>
-	</tr>
-	<tr>
-		<td><label for="active">$i18n.getString( "active" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-		<td>
-			<select id="active" name="active">
-				<option value="true" #if( $dataElement.active ) selected="selected" #end>$i18n.getString( "yes" )</option>
-				<option value="false" #if( !$dataElement.active ) selected="selected" #end>$i18n.getString( "no" )</option>
-			</select>
-		</td>
-	</tr>
-	<tr>
-		<td><label for="domainType">$i18n.getString( "domain_type" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-		<td>
-			<select id="domainType" name="domainType" onchange='domainTypeChange(this.value)'>
-				<option value="aggregate" #if( $dataElement.getDomainTypeNullSafe() == 'aggregate' ) selected="selected" #end>$i18n.getString( "aggregate" )</option>
-				<option value="patient" #if( $dataElement.getDomainTypeNullSafe() == 'patient' ) selected="selected" #end>$i18n.getString( "patient" )</option>				
-			</select>
-		</td>
-	</tr>
-	<tr #if( $calculatedDataElement ) style="display:none" #end>
-		<td><label for="valueType">$i18n.getString( "value_type" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-		<td>
-            <select id="valueType" name="valueType" onchange="changeValueType( this.value )">
-				<option value="int" #if( $dataElement.type == 'int' ) selected="selected" #end >$i18n.getString( "number" )</option>
-				<option value="string" #if( $dataElement.type == 'string' ) selected="selected" #end >$i18n.getString( "text" )</option>
-				<option value="trueOnly" #if( $dataElement.type == 'trueOnly' ) selected="selected" #end >$i18n.getString( "yes_only" )</option>
-				<option value="bool" #if( $dataElement.type == 'bool' ) selected="selected" #end >$i18n.getString( "yes_no" )</option>
-				<option value="date" #if( $dataElement.type == 'date' ) selected="selected" #end >$i18n.getString( "date" )</option>
-				<option value="username" #if( $dataElement.type == 'username' ) selected="selected" #end >$i18n.getString( "user_name" )</option>
-			</select>
-		</td>
-	</tr>
-	<tr id='numberTypeTR' #if( $dataElement.type != 'int' ) style="display:none" #end>
-		<td><label for="numberValueType">$i18n.getString( "number_value_type" )</label></td>
-		<td>
-            <select id="numberType" name="numberType">
-				<option value="number" #if( $dataElement.numberType == 'number' ) selected="selected" #end style="min-width:246px;">$i18n.getString( "number" )</option>
-				<option value="int" #if( $dataElement.numberType == 'int' ) selected="selected" #end>$i18n.getString( "int" )</option>
-				<option value="positiveNumber" #if( $dataElement.numberType == 'positiveNumber' ) selected="selected" #end>$i18n.getString( "positiveNumber" )</option>
-				<option value="negativeNumber" #if( $dataElement.numberType == 'negativeNumber' ) selected="selected" #end>$i18n.getString( "negativeNumber" )</option>
-			</select>
-			<script>
-			</script>
- 		</td>
- 	</tr>
-	<tr id='textTypeTR' #if( $dataElement.type != 'string' ) style='display:none;' #end>
-		<td><label for="textValueType">$i18n.getString( "text_type" )</label></td>
-		<td>
-			<select id="textType" name="textType">
-				<option value="text" #if( $dataElement.textType == 'text' ) selected="selected" #end>$i18n.getString( "text" )</option>
-				<option value="longText" #if( $dataElement.textType == 'longText' ) selected="selected" #end >$i18n.getString( "long_text" )</option>
-			</select>
- 		</td>
- 	</tr>
-	<tr>
-		<td><label for="aggregationOperatorSelect" id="lblOperator">$i18n.getString( "aggregation_operator" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-		<td>
-			<select id="aggregationOperatorSelect" name="aggregationOperator">
-				<option value="sum" #if( $dataElement.aggregationOperator == 'sum' ) selected="selected" #end>$i18n.getString( "sum" )</option>
-				<option value="average" #if( $dataElement.aggregationOperator == 'average' ) selected="selected" #end>$i18n.getString( "average" )</option>
-			</select>
-		</td>
-	</tr>
-    <tr>
-   		<td><label for="zeroIsSignificant ">$i18n.getString( "store_zero_data_values" )</label></td>
-   		<td>
-   			<select id="zeroIsSignificant" name="zeroIsSignificant">
-   				<option value="false">$i18n.getString( "no" )</option>
-   				<option value="true" #if( $dataElement.zeroIsSignificant ) selected="selected" #end>$i18n.getString( "yes" )</option>
-   			</select>
-   			<script>
-   				if( '$dataElement.type' == 'int' ){
-   					enable('zeroIsSignificant');
-   				}else{
-   					disable('zeroIsSignificant');
-   				}
-   			</script>
-        </td>
-    </tr>
-    <tr>
-        <td><label for="url">$i18n.getString( "url" )</label></td>
-        <td><input type="text" id="url" name="url" value="$!encoder.htmlEncode( $dataElement.url )"></td>
-    </tr>
-	<tr #if( $calculatedDataElement ) style="display:none" #end >	
-		<td><label for="selectedCategoryComboId">$i18n.getString( "category_combo" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-		<td>
-			<select id="selectedCategoryComboId" #if( $dataElement.getDomainTypeNullSafe()=='patient') disabled #end>>				
-			#foreach( $dataElementCategoryCombo in $dataElementCategoryCombos )
-				<option value="$dataElementCategoryCombo.id" #if( $dataElementCategoryCombo.id == $dataElement.categoryCombo.id ) selected="selected" #end>$encoder.htmlEncode( $dataElementCategoryCombo.displayName )</option>
-			#end
-			</select>
-			<input type="hidden" id="submitCategoryComboId" name="selectedCategoryComboId"/>
-		</td>
-	</tr>
-    <tr>
-        <td style="width:200px">$i18n.getString( "aggregation_levels" )</td>
-        <td><input type="checkbox" #if ( $dataElement.hasAggregationLevels() )checked="checked"#end onclick="toggleById( 'aggregationLevelsContainer' )"/></td>
-    </tr>
-	<tr>
-		<td>$i18n.getString( 'option_set' )</td>			
-		<td>
-			<select id="selectedOptionSetId" name="selectedOptionSetId">
-				<option value="0">[$i18n.getString('please_select')]</option>
-				#foreach ( $optionSet in $optionSets )
-				<option value="$optionSet.id" #if( $dataElement.optionSet && $dataElement.optionSet.id == "$optionSet.id" ) selected #end>$encoder.htmlEncode( $optionSet.displayName )</option>
-				#end
-			</select>
-		</td>
-    </tr>
-    <tr>
-        <td>$i18n.getString( 'legend_set' )</td>            
-        <td>
-            <select id="selectedLegendSetId" name="selectedLegendSetId">
-                <option value="0">[$i18n.getString('please_select')]</option>
-                #foreach ( $legendSet in $legendSets )
-                <option value="$legendSet.id" #if( $dataElement.legendSet && $dataElement.legendSet.id == "$legendSet.id" ) selected #end>$encoder.htmlEncode( $legendSet.name )</option>
-                #end
-            </select>
-        </td>
-    </tr>
-</table>
-
-<div id="aggregationLevelsContainer" style="border:1px solid #808080;padding:10px;width:465px;#if( !$dataElement.hasAggregationLevels() ) display:none;#else display:block;#end">
-
-<table>
-    <tr>
-        <th style="width:450px">$i18n.getString( "available_aggregation_levels" )</th>
-    </tr>
-    <tr>
-        <td>
-            <select multiple size="4" id="organisationUnitLevels" style="width:450px" ondblclick="moveSelectedById( 'organisationUnitLevels', 'aggregationLevels' )">
-            #foreach( $level in $organisationUnitLevels )
-                <option value="$level.level">$level.displayName</option>
-            #end
-            </select>
-        </td>
-    </tr>
-    <tr>
-        <td>
-            <input type="button" value="$i18n.getString( 'add_selected' )" title="$i18n.getString( 'add' )" style="width:120px" onclick="moveSelectedById( 'organisationUnitLevels', 'aggregationLevels' )"/><input 
-                   type="button" value="$i18n.getString( 'remove_selected' )" title="$i18n.getString( 'remove' )" style="width:120px" onclick="moveSelectedById( 'aggregationLevels', 'organisationUnitLevels' )"/>
-        </td>
-    </tr>
-    <tr>
-        <th style="width:450px">$i18n.getString( "selected_aggregation_levels" )</th>
-    </tr>
-    </tr>
-        <td>
-            <select multiple size="4" id="aggregationLevels" name="aggregationLevels" style="width:450px" ondblclick="moveSelectedById( 'aggregationLevels', 'organisationUnitLevels' )">
-            #foreach( $level in $aggregationLevels )
-            	<option value="$level.level">$level.displayName</option>
-            #end
-            </select>
-        </td>
-    </tr>
-</table>
-
-</div>
-
-#tblDynamicAttributes( { "attributes": $attributes, "attributeValues": $attributeValues } )
-
-#if( $groupSets.size() > 0 )
-<table>
-	<tr>
-		<td style="height:15px" colspan="2">
-	</tr>
-
-	<tr>
-		<th colspan="2">$i18n.getString( "data_element_groups" )</th>
-    </tr>
-    
-	#foreach ( $groupSet in $groupSets )
-    <tr>
-		<td>$encoder.htmlEncode( $groupSet.name )</td>
-		<td>
-			<select id="dataElementGroups" name="dataElementGroups">
-				<option value="-1">[ $i18n.getString( "select_group" ) ]</option>
-				#foreach ( $group in $groupSet.getSortedGroups() )
-				<option value="$group.id" #if( $group.members.contains( $dataElement ) ) selected="selected" #end>$group.name</option>
-				#end
-			</select>
-		</td>
-		<td><input type="hidden" name="dataElementGroupSets" value="$groupSet.id"/></td>
-    </tr>
-	#end
-</table>
-#end
-
-<p>
-	<input type="submit" value="$i18n.getString( 'save' )" style="width:10em" />
-	<input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='dataElement.action'" style="width:10em" />
-</p>
-
-</form>