dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #23402
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11390: add missing files
------------------------------------------------------------
revno: 11390
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-07-12 16:33:19 +0700
message:
add missing files
added:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowDataElementFormAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementForm.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
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowDataElementFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowDataElementFormAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowDataElementFormAction.java 2013-07-12 09:33:19 +0000
@@ -0,0 +1,258 @@
+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 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;
+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 java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Hans S. Toemmerholt
+ * @version $Id: GetDataElementAction.java 2869 2007-02-20 14:26:09Z andegje $
+ */
+public class ShowDataElementFormAction
+ 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;
+ }
+
+ private boolean update;
+
+ public boolean isUpdate()
+ {
+ return update;
+ }
+
+ public void setUpdate( boolean update )
+ {
+ this.update = update;
+ }
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ public String execute()
+ {
+ defaultCategoryCombo = dataElementCategoryService
+ .getDataElementCategoryComboByName( DataElementCategoryCombo.DEFAULT_CATEGORY_COMBO_NAME );
+
+ dataElementCategoryCombos = new ArrayList<DataElementCategoryCombo>( dataElementCategoryService
+ .getAllDataElementCategoryCombos() );
+
+ dataElementGroups = dataElementService.getAllDataElementGroups();
+
+ if ( id != null )
+ {
+ dataElement = dataElementService.getDataElement( id );
+
+ Map<Integer, OrganisationUnitLevel> levelMap = organisationUnitService.getOrganisationUnitLevelMap();
+
+ for ( Integer level : dataElement.getAggregationLevels() )
+ {
+ aggregationLevels.add( levelMap.get( level ) );
+ }
+
+ attributeValues = AttributeUtils.getAttributeValueMap( dataElement.getAttributeValues() );
+ }
+
+ organisationUnitLevels = organisationUnitService.getOrganisationUnitLevels();
+
+ organisationUnitLevels.removeAll( aggregationLevels );
+
+ groupSets = new ArrayList<DataElementGroupSet>( dataElementService
+ .getCompulsoryDataElementGroupSetsWithMembers() );
+
+ attributes = new ArrayList<Attribute>( attributeService.getDataElementAttributes() );
+
+ 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;
+ }
+}
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementForm.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementForm.vm 2013-07-12 09:33:19 +0000
@@ -0,0 +1,291 @@
+<script type="text/javascript">
+ jQuery(document).ready( function() {
+ #if( $update )
+ validation2( 'updateDataElementForm', function( form )
+ #else
+ validation2( 'addDataElementForm', function( form )
+ #end
+ {
+ dhis2.select.selectAll( jQuery( '#aggregationLevels' ) );
+ form.submit();
+ }, {
+ 'beforeValidateHandler' : function()
+ {
+ setFieldValue( 'submitCategoryComboId', getFieldValue( 'selectedCategoryComboId' ) );
+ setFieldValue( 'submitValueType', getFieldValue( 'valueType' ) );
+ enable('aggregationOperatorSelect');
+ #tblDynamicAttributesJavascript()
+ },
+ 'rules' : getValidationRules( "dataElement" )
+ } );
+
+ #if( $update )
+ checkValueIsExist( "name", "validateDataElement.action", {id:getFieldValue('id')});
+ checkValueIsExist( "shortName", "validateDataElement.action", {id:getFieldValue('id')});
+ checkValueIsExist( "code", "validateDataElement.action", {id:getFieldValue('id')});
+
+ updateAggreationOperation( getFieldValue('valueType') );
+ #else
+ checkValueIsExist( "name", "validateDataElement.action" );
+ checkValueIsExist( "shortName", "validateDataElement.action" );
+ checkValueIsExist( "code", "validateDataElement.action" );
+ #end
+ });
+
+ var previousName = '$!encoder.jsEscape( $!dataElement.name, "'" )';
+</script>
+
+#if( $update )
+<h3>$i18n.getString( "edit_data_element" )</h3>
+#else
+<h3>$i18n.getString( "create_new_data_element" )</h3>
+#end
+
+#if( $update )
+<form id="updateDataElementForm" action="updateDataElement.action" method="post" class="inputForm">
+<input type="hidden" id="id" name="id" value="$!dataElement.id"/>
+#else
+<form id="addDataElementForm" action="addDataElement.action" method="POST" class="inputForm">
+#end
+<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>
+ #if( $update )
+ <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>
+ #end
+ <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>
+ #if( $update )
+ <tr id='numberTypeTR' #if( $!dataElement.type != 'int' ) style="display:none" #end>
+ #else
+ <tr id='numberTypeTR'>
+ #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>>
+ #if( $update )
+ #foreach( $dataElementCategoryCombo in $!dataElementCategoryCombos )
+ <option value="$!dataElementCategoryCombo.id" #if( $!dataElementCategoryCombo.id == $!dataElement.categoryCombo.id ) selected="selected" #end>$!encoder.htmlEncode( $!dataElementCategoryCombo.displayName )</option>
+ #end
+ #else
+ #foreach( $dataElementCategoryCombo in $dataElementCategoryCombos )
+ <option value="$dataElementCategoryCombo.id" #if( $dataElementCategoryCombo.id == $defaultCategoryCombo.id ) selected="selected" #end>$encoder.htmlEncode( $dataElementCategoryCombo.displayName )</option>
+ #end
+ #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>
+ #if( $update )
+ <input type="submit" value="$i18n.getString( 'save' )" style="width:10em" />
+ #else
+ <input type="submit" value="$i18n.getString( 'add' )" style="width:10em" />
+ #end
+ <input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='dataElement.action'" style="width:10em" />
+</p>
+
+#if( $update )
+<p>
+ <input type="button" value="$i18n.getString( 'clone' )" onclick="window.location.href='showAddDataElementForm.action?id=$!dataElement.id'" style="width:10em" />
+</p>
+#end
+
+</form>