dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #02986
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 991: Implemented user interface for the DataElement - DataElementGroupSet association.
------------------------------------------------------------
revno: 991
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Fri 2009-11-06 15:08:10 +0100
message:
Implemented user interface for the DataElement - DataElementGroupSet association.
added:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/comparator/
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/comparator/IdentifiableObjectNameComparator.java
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dimension/DimensionSet.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementGroupSet.hbm.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java
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/ShowUpdateDataElementFormAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties
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/javascript/dataElement.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.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 directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/comparator'
=== added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/comparator/IdentifiableObjectNameComparator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/comparator/IdentifiableObjectNameComparator.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/comparator/IdentifiableObjectNameComparator.java 2009-11-06 14:08:10 +0000
@@ -0,0 +1,44 @@
+package org.hisp.dhis.common.comparator;
+
+/*
+ * Copyright (c) 2004-2007, 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.Comparator;
+
+import org.hisp.dhis.common.IdentifiableObject;
+
+/**
+ * @author Lars Helge Overland
+ */
+public class IdentifiableObjectNameComparator
+ implements Comparator<IdentifiableObject>
+{
+ public int compare( IdentifiableObject object0, IdentifiableObject object1 )
+ {
+ return object0.getName().compareTo( object1.getName() );
+ }
+}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java 2009-11-06 11:58:30 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java 2009-11-06 14:08:10 +0000
@@ -151,15 +151,15 @@
private Set<DataSet> dataSets = new HashSet<DataSet>();
/**
+ * A Set of DataElementGroupSets.
+ */
+ private List<DataElementGroupSet> groupSets = new ArrayList<DataElementGroupSet>();
+
+ /**
* The lower organisation unit levels for aggregation.
*/
private List<Integer> aggregationLevels = new ArrayList<Integer>();
- /**
- * A Set of DataElementGroupSets.
- */
- private List<DataElementGroupSet> groupSets = new ArrayList<DataElementGroupSet>();
-
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
@@ -260,6 +260,11 @@
return DIMENSION;
}
+ public String getDimensionSetType()
+ {
+ return DataElement.class.getSimpleName().toUpperCase();
+ }
+
public boolean isDimensionSet()
{
return groupSets != null && groupSets.size() > 0;
@@ -507,6 +512,16 @@
this.dataSets = dataSets;
}
+ public List<DataElementGroupSet> getGroupSets()
+ {
+ return groupSets;
+ }
+
+ public void setGroupSets( List<DataElementGroupSet> groupSets )
+ {
+ this.groupSets = groupSets;
+ }
+
public List<Integer> getAggregationLevels()
{
return aggregationLevels;
@@ -516,14 +531,4 @@
{
this.aggregationLevels = aggregationLevels;
}
-
- public List<DataElementGroupSet> getGroupSets()
- {
- return groupSets;
- }
-
- public void setGroupSets( List<DataElementGroupSet> groupSets )
- {
- this.groupSets = groupSets;
- }
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java 2009-11-06 11:58:30 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java 2009-11-06 14:08:10 +0000
@@ -80,6 +80,11 @@
return new ArrayList<DimensionOptionElement>( optionCombos );
}
+ public String getDimensionSetType()
+ {
+ return DataElementCategoryCombo.class.getSimpleName().toUpperCase();
+ }
+
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dimension/DimensionSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dimension/DimensionSet.java 2009-11-06 11:58:30 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dimension/DimensionSet.java 2009-11-06 14:08:10 +0000
@@ -29,14 +29,24 @@
import java.util.List;
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategoryCombo;
+import org.hisp.dhis.indicator.Indicator;
+
/**
* @author Lars Helge Overland
*/
public interface DimensionSet
{
+ final String TYPE_DATAELEMENT = DataElement.class.getSimpleName().toUpperCase();
+ final String TYPE_INDICATOR = Indicator.class.getSimpleName().toUpperCase();
+ final String TYPE_CATEGORY_COMBO = DataElementCategoryCombo.class.getSimpleName().toUpperCase();
+
String getName();
List<? extends Dimension> getDimensions();
List<? extends DimensionOptionElement> getDimensionOptionElements();
+
+ String getDimensionSetType();
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java 2009-11-06 11:58:30 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java 2009-11-06 14:08:10 +0000
@@ -130,7 +130,12 @@
return dimensionOptionElements;
}
-
+
+ public String getDimensionSetType()
+ {
+ return Indicator.class.getSimpleName().toUpperCase();
+ }
+
public boolean isDimensionSet()
{
return groupSets != null && groupSets.size() > 0;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml 2009-11-06 10:50:01 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml 2009-11-06 14:08:10 +0000
@@ -63,6 +63,13 @@
<key column="dataelementid"/>
<many-to-many class="org.hisp.dhis.dataset.DataSet" column="datasetid"/>
</set>
+
+ <list name="groupSets" table="dataelement_dataelementgroupsetmembers">
+ <key column="dataelementid"/>
+ <list-index column="sort_order" base="0"/>
+ <many-to-many class="org.hisp.dhis.dataelement.DataElementGroupSet"
+ column="dataelementgroupsetid" foreign-key="fk_dataelement_dataelementgroupsetid"/>
+ </list>
<list name="aggregationLevels" table="dataelementaggregationlevels">
<key column="dataelementid"/>
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementGroupSet.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementGroupSet.hbm.xml 2009-11-06 10:43:00 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementGroupSet.hbm.xml 2009-11-06 14:08:10 +0000
@@ -22,7 +22,7 @@
<key column="dataelementgroupsetid"/>
<list-index column="sort_order" base="1"/>
<many-to-many class="org.hisp.dhis.dataelement.DataElementGroup"
- column="dataelementgroupid" unique="true" foreign-key="fk_dataelementgroupset_dataelementgroupid"/>
+ column="dataelementgroupid" unique="true" foreign-key="fk_dataelementgroupset_dataelementgroupid"/>
</list>
</class>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java 2009-11-06 10:50:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java 2009-11-06 14:08:10 +0000
@@ -146,6 +146,13 @@
{
this.url = url;
}
+
+ private Collection<String> dataElementGroupSets = new ArrayList<String>();
+
+ public void setDataElementGroupSets( Collection<String> dataElementGroupSets )
+ {
+ this.dataElementGroupSets = dataElementGroupSets;
+ }
private Collection<String> aggregationLevels;
@@ -267,6 +274,11 @@
{
dataElement = new DataElement();
}
+
+ for ( String id : dataElementGroupSets )
+ {
+ dataElement.getGroupSets().add( dataElementService.getDataElementGroupSet( Integer.parseInt( id ) ) );
+ }
dataElement.setName( name );
dataElement.setAlternativeName( alternativeName );
=== 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 2009-10-18 22:44:41 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowAddDataElementForm.java 2009-11-06 14:08:10 +0000
@@ -31,15 +31,20 @@
import java.util.Collection;
import java.util.List;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
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.dataelement.comparator.DataElementCategoryComboNameComparator;
import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import com.opensymphony.xwork2.Action;
+import edu.emory.mathcs.backport.java.util.Collections;
+
/**
* @author Hans S. Toemmerholt
* @version $Id: GetDataElementAction.java 2869 2007-02-20 14:26:09Z andegje $
@@ -104,6 +109,13 @@
return defaultCategoryCombo;
}
+ private List<DataElementGroupSet> dataElementGroupSets;
+
+ public List<DataElementGroupSet> getDataElementGroupSets()
+ {
+ return dataElementGroupSets;
+ }
+
private List<OrganisationUnitLevel> organisationUnitLevels;
public List<OrganisationUnitLevel> getOrganisationUnitLevels()
@@ -120,9 +132,15 @@
defaultCategoryCombo = dataElementCategoryService.getDataElementCategoryComboByName( DataElementCategoryCombo.DEFAULT_CATEGORY_COMBO_NAME );
dataElementGroups = dataElementService.getAllDataElementGroups();
-
+
dataElementCategoryCombos = new ArrayList<DataElementCategoryCombo>( dataElementCategoryService.getAllDataElementCategoryCombos() );
+ Collections.sort( dataElementCategoryCombos, new DataElementCategoryComboNameComparator() );
+
+ dataElementGroupSets = new ArrayList<DataElementGroupSet>( dataElementService.getAllDataElementGroupSets() );
+
+ Collections.sort( dataElementGroupSets, new IdentifiableObjectNameComparator() );
+
organisationUnitLevels = organisationUnitService.getOrganisationUnitLevels();
return SUCCESS;
=== modified 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 2009-10-18 22:44:41 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowUpdateDataElementFormAction.java 2009-11-06 14:08:10 +0000
@@ -34,12 +34,14 @@
import java.util.List;
import java.util.Map;
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
import org.hisp.dhis.dataelement.CalculatedDataElement;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategoryCombo;
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
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.dataelement.Operand;
import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
@@ -47,6 +49,8 @@
import com.opensymphony.xwork2.ActionSupport;
+import edu.emory.mathcs.backport.java.util.Collections;
+
/**
* @author Hans S. Toemmerholt
* @version $Id: GetDataElementAction.java 2869 2007-02-20 14:26:09Z andegje $
@@ -139,6 +143,13 @@
return dataElementCategoryCombos;
}
+ private List<DataElementGroupSet> dataElementGroupSets;
+
+ public List<DataElementGroupSet> getDataElementGroupSets()
+ {
+ return dataElementGroupSets;
+ }
+
private List<OrganisationUnitLevel> organisationUnitLevels;
public List<OrganisationUnitLevel> getOrganisationUnitLevels()
@@ -196,6 +207,12 @@
}
}
+ dataElementGroupSets = new ArrayList<DataElementGroupSet>( dataElementService.getAllDataElementGroupSets() );
+
+ dataElementGroupSets.removeAll( dataElement.getGroupSets() );
+
+ Collections.sort( dataElementGroupSets, new IdentifiableObjectNameComparator() );
+
return SUCCESS;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java 2009-11-06 10:50:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java 2009-11-06 14:08:10 +0000
@@ -150,6 +150,13 @@
this.url = url;
}
+ private Collection<String> dataElementGroupSets = new ArrayList<String>();
+
+ public void setDataElementGroupSets( Collection<String> dataElementGroupSets )
+ {
+ this.dataElementGroupSets = dataElementGroupSets;
+ }
+
private Collection<String> aggregationLevels;
public void setAggregationLevels( Collection<String> aggregationLevels )
@@ -275,7 +282,14 @@
calculatedDataElement.setSaved( saved != null );
}
+
+ dataElement.getGroupSets().clear();
+ for ( String id : dataElementGroupSets )
+ {
+ dataElement.getGroupSets().add( dataElementService.getDataElementGroupSet( Integer.parseInt( id ) ) );
+ }
+
dataElementService.updateDataElement( dataElement );
return SUCCESS;
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties 2009-11-06 10:50:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties 2009-11-06 14:08:10 +0000
@@ -375,3 +375,6 @@
intro_indicator_group_editor = Easily add or remove indicators to and from indicator groups.
intro_indicator_group_set = Create, modify, view and delete indicator group sets.
intro_data_dictionary = Create, modify, view and delete data dictionaries.
+data_element_group_sets = Data element group sets
+available_data_element_group_sets = Available data element group sets
+selected_data_element_group_sets = Selected data element group sets
=== 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 2009-11-06 10:50:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm 2009-11-06 14:08:10 +0000
@@ -138,6 +138,50 @@
</div>
<table>
+ <tr>
+ <td style="height:10px" colspan="2"></td>
+ </tr>
+ <tr>
+ <td style="width:200px">$i18n.getString( "data_element_group_sets" )</td>
+ <td><input type="checkbox" onclick="toggleById( 'dataElementGroupSetContainer' )"></td>
+ </tr>
+</table>
+
+<div id="dataElementGroupSetContainer" style="border:1px solid #808080; padding:10px; width:465px; display:none;">
+
+<table>
+ <tr>
+ <th style="width:450px">$i18n.getString( "available_data_element_group_sets" )</th>
+ </tr>
+ <tr>
+ <td>
+ <select multiple size="4" id="availableDataElementGroupSets" style="width:450px" ondblclick="moveSelectedById( 'availableDataElementGroupSets', 'dataElementGroupSets' )">
+ #foreach( $groupSet in $dataElementGroupSets )
+ <option value="$groupSet.id">$encoder.htmlEncode( $groupSet.name )</option>
+ #end
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input type="button" value="$i18n.getString( 'add_selected' )" title="$i18n.getString( 'add' )" style="width:120px" onclick="moveSelectedById( 'availableDataElementGroupSets', 'dataElementGroupSets' )"><input
+ type="button" value="$i18n.getString( 'remove_selected' )" title="$i18n.getString( 'remove' )" style="width:120px" onclick="moveSelectedById( 'dataElementGroupSets', 'availableDataElementGroupSets' )">
+ </td>
+ </tr>
+ <tr>
+ <th style="width:450px">$i18n.getString( "selected_data_element_group_sets" )</th>
+ </tr>
+ </tr>
+ <td>
+ <select multiple size="4" id="dataElementGroupSets" name="dataElementGroupSets" style="width:450px" ondblclick="moveSelectedById( 'dataElementGroupSets', 'availableDataElementGroupSets' )">
+ </select>
+ </td>
+ </tr>
+</table>
+
+</div>
+
+<table>
<tr>
<td style="height:10px" colspan="2"></td>
</tr>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js 2009-11-06 10:50:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js 2009-11-06 14:08:10 +0000
@@ -508,6 +508,7 @@
function submitAddDataElement()
{
selectAllById( "aggregationLevels" );
+ selectAllById( "dataElementGroupSets" );
document.getElementById( "addDataElementForm" ).submit();
}
@@ -515,6 +516,7 @@
function submitUpdateDataElement()
{
selectAllById( "aggregationLevels" );
+ selectAllById( "dataElementGroupSets" );
document.getElementById( "updateDataElementForm" ).submit();
}
=== modified 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 2009-11-06 10:50:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm 2009-11-06 14:08:10 +0000
@@ -159,6 +159,53 @@
<td style="height:10px" colspan="2"></td>
</tr>
<tr>
+ <td style="width:200px">$i18n.getString( "data_element_group_sets" )</td>
+ <td><input type="checkbox" onclick="toggleById( 'dataElementGroupSetContainer' )"></td>
+ </tr>
+</table>
+
+<div id="dataElementGroupSetContainer" style="border:1px solid #808080; padding:10px; width:465px; display:none;">
+
+<table>
+ <tr>
+ <th style="width:450px">$i18n.getString( "available_data_element_group_sets" )</th>
+ </tr>
+ <tr>
+ <td>
+ <select multiple size="4" id="availableDataElementGroupSets" style="width:450px" ondblclick="moveSelectedById( 'availableDataElementGroupSets', 'dataElementGroupSets' )">
+ #foreach( $groupSet in $dataElementGroupSets )
+ <option value="$groupSet.id">$encoder.htmlEncode( $groupSet.name )</option>
+ #end
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input type="button" value="$i18n.getString( 'add_selected' )" title="$i18n.getString( 'add' )" style="width:120px" onclick="moveSelectedById( 'availableDataElementGroupSets', 'dataElementGroupSets' )"><input
+ type="button" value="$i18n.getString( 'remove_selected' )" title="$i18n.getString( 'remove' )" style="width:120px" onclick="moveSelectedById( 'dataElementGroupSets', 'availableDataElementGroupSets' )">
+ </td>
+ </tr>
+ <tr>
+ <th style="width:450px">$i18n.getString( "selected_data_element_group_sets" )</th>
+ </tr>
+ </tr>
+ <td>
+ <select multiple size="4" id="dataElementGroupSets" name="dataElementGroupSets" style="width:450px" ondblclick="moveSelectedById( 'dataElementGroupSets', 'availableDataElementGroupSets' )">
+ #foreach( $groupSet in $dataElement.groupSets )
+ <option value="$groupSet.id">$encoder.htmlEncode( $groupSet.name )</option>
+ #end
+ </select>
+ </td>
+ </tr>
+</table>
+
+</div>
+
+<table>
+ <tr>
+ <td style="height:10px" colspan="2"></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>