← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7134: added ui support for adding attribute values to indicator groups

 

------------------------------------------------------------
revno: 7134
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-06-01 14:17:31 +0200
message:
  added ui support for adding attribute values to indicator groups
removed:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addIndicatorGroupForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateIndicatorGroupForm.js
added:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/ShowAddIndicatorForm.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/ShowAddIndicatorGroupForm.java
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/ShowUpdateIndicatorGroupFormAction.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/addIndicatorForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupForm.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/indicator/ShowAddIndicatorForm.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/ShowAddIndicatorForm.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/indicator/ShowAddIndicatorForm.java	2012-06-01 12:17:31 +0000
@@ -0,0 +1,78 @@
+package org.hisp.dhis.dd.action.indicator;
+
+/*
+ * 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 java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
+ */
+public class ShowAddIndicatorForm
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private AttributeService attributeService;
+
+    public void setAttributeService( AttributeService attributeService )
+    {
+        this.attributeService = attributeService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input/output
+    // -------------------------------------------------------------------------
+
+    private List<Attribute> attributes;
+
+    public List<Attribute> getAttributes()
+    {
+        return attributes;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+    public String execute()
+    {
+        attributes = new ArrayList<Attribute>( attributeService.getIndicatorAttributes() );
+        Collections.sort( attributes, new AttributeSortOrderComparator() );
+
+        return SUCCESS;
+    }
+}

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/ShowAddIndicatorGroupForm.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/ShowAddIndicatorGroupForm.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/indicatorgroup/ShowAddIndicatorGroupForm.java	2012-06-01 12:17:31 +0000
@@ -0,0 +1,78 @@
+package org.hisp.dhis.dd.action.indicatorgroup;
+
+/*
+ * 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 java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
+ */
+public class ShowAddIndicatorGroupForm
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private AttributeService attributeService;
+
+    public void setAttributeService( AttributeService attributeService )
+    {
+        this.attributeService = attributeService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input/output
+    // -------------------------------------------------------------------------
+
+    private List<Attribute> attributes;
+
+    public List<Attribute> getAttributes()
+    {
+        return attributes;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+    public String execute()
+    {
+        attributes = new ArrayList<Attribute>( attributeService.getIndicatorAttributes() );
+        Collections.sort( attributes, new AttributeSortOrderComparator() );
+
+        return SUCCESS;
+    }
+}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/ShowUpdateIndicatorGroupFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/ShowUpdateIndicatorGroupFormAction.java	2012-02-01 10:50:31 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicatorgroup/ShowUpdateIndicatorGroupFormAction.java	2012-06-01 12:17:31 +0000
@@ -27,21 +27,21 @@
 
 package org.hisp.dhis.dd.action.indicatorgroup;
 
-import java.util.ArrayList;
-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.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorService;
+import org.hisp.dhis.system.util.AttributeUtils;
 
-import com.opensymphony.xwork2.Action;
+import java.util.*;
 
 /**
  * @author Chau Thu Tran
  * @version $ ShowUpdateIndicatorGroupFormAction.java May 30, 2011 3:01:41 PM $
- * 
  */
 public class ShowUpdateIndicatorGroupFormAction
     implements Action
@@ -57,6 +57,13 @@
         this.indicatorService = indicatorService;
     }
 
+    private AttributeService attributeService;
+
+    public void setAttributeService( AttributeService attributeService )
+    {
+        this.attributeService = attributeService;
+    }
+
     // -------------------------------------------------------------------------
     // Input/output
     // -------------------------------------------------------------------------
@@ -82,6 +89,20 @@
         return groupMembers;
     }
 
+    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;
+    }
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -92,7 +113,12 @@
 
         groupMembers = new ArrayList<Indicator>( indicatorGroup.getMembers() );
 
+        attributes = new ArrayList<Attribute>( attributeService.getIndicatorGroupAttributes() );
+
+        attributeValues = AttributeUtils.getAttributeValueMap( indicatorGroup.getAttributeValues() );
+
         Collections.sort( groupMembers, new IdentifiableObjectNameComparator() );
+        Collections.sort( attributes, new AttributeSortOrderComparator() );
 
         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	2012-06-01 11:35:55 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml	2012-06-01 12:17:31 +0000
@@ -263,6 +263,10 @@
 
   <!-- Indicator Group -->
 
+  <bean id="org.hisp.dhis.dd.action.indicatorgroup.ShowAddIndicatorGroupForm" class="org.hisp.dhis.dd.action.indicatorgroup.ShowAddIndicatorGroupForm">
+    <property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
+  </bean>
+
   <bean id="org.hisp.dhis.dd.action.indicatorgroup.ShowIndicatorGroupEditorAction" class="org.hisp.dhis.dd.action.indicatorgroup.ShowIndicatorGroupEditorAction"
     scope="prototype">
     <property name="indicatorService">
@@ -304,6 +308,7 @@
     <property name="indicatorService">
       <ref bean="org.hisp.dhis.indicator.IndicatorService" />
     </property>
+    <property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
   </bean>
 
   <bean id="org.hisp.dhis.dd.action.indicatorgroup.UpdateIndicatorGroupAction" class="org.hisp.dhis.dd.action.indicatorgroup.UpdateIndicatorGroupAction"
@@ -434,6 +439,10 @@
 
   <!-- Indicator -->
 
+  <bean id="org.hisp.dhis.dd.action.indicator.ShowAddIndicatorForm" class="org.hisp.dhis.dd.action.indicator.ShowAddIndicatorForm">
+    <property name="attributeService" ref="org.hisp.dhis.attribute.AttributeService" />
+  </bean>
+
   <bean id="org.hisp.dhis.dd.action.indicator.GetIndicatorListAction" class="org.hisp.dhis.dd.action.indicator.GetIndicatorListAction"
     scope="prototype">
     <property name="indicatorService">

=== 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	2012-06-01 11:35:55 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/struts.xml	2012-06-01 12:17:31 +0000
@@ -260,7 +260,7 @@
       <param name="requiredAuthorities">F_INDICATOR_DELETE</param>
     </action>
 
-    <action name="showAddIndicatorForm" class="org.hisp.dhis.dd.action.indicatortype.GetIndicatorTypeListAction">
+    <action name="showAddIndicatorForm" class="org.hisp.dhis.dd.action.indicator.ShowAddIndicatorForm">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-maintenance-datadictionary/addIndicatorForm.vm</param>
       <param name="javascripts">javascript/shortName.js,javascript/indicator.js</param>
@@ -353,7 +353,7 @@
       <param name="requiredAuthorities">F_INDICATORGROUP_DELETE</param>
     </action>
 
-    <action name="showAddIndicatorGroupForm" class="org.hisp.dhis.dd.action.NoAction">
+    <action name="showAddIndicatorGroupForm" class="org.hisp.dhis.dd.action.indicatorgroup.ShowAddIndicatorGroupForm">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-maintenance-datadictionary/addIndicatorGroupForm.vm</param>
 	  <param name="javascripts">javascript/indicatorGroup.js</param>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorForm.vm	2011-10-06 07:57:46 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorForm.vm	2012-06-01 12:17:31 +0000
@@ -28,7 +28,10 @@
 <input type="hidden" id="denominatorDescription" name="denominatorDescription" value=""/>
 
 <table>
-	<tr style="width: 450px;">
+    <col width="200px" />
+   	<col width="240px" />
+
+	<tr>
 		<th colspan="2">$i18n.getString( "details" )</th>
 	</tr>
 	<tr>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupForm.vm	2011-10-06 07:29:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addIndicatorGroupForm.vm	2012-06-01 12:17:31 +0000
@@ -1,6 +1,23 @@
-<script type="text/javascript" src="javascript/addIndicatorGroupForm.js"></script>
 <script type="text/javascript">
 	jQuery(function() {
+        validation2( 'addIndicatorGroupForm', function( form )
+        {
+            form.submit();
+        }, {
+            'beforeValidateHandler' : function()
+            {
+                listValidator( 'memberValidator', 'groupMembers' );
+                #tblDynamicAttributesJavascript()
+            },
+            'rules' : getValidationRules( "indicatorGroup" )
+        } );
+
+        checkValueIsExist( "name", "validateIndicatorGroup.action" );
+
+        var nameField = document.getElementById( 'name' );
+        nameField.select();
+        nameField.focus();
+
 		jQuery("#availableIndicatorsList").dhisAjaxSelect({
 			source: "../dhis-web-commons-ajax-json/getIndicators.action",
 			iterator: "indicators",
@@ -21,18 +38,21 @@
 <form id="addIndicatorGroupForm" action="addIndicatorGroup.action" method="post" >
 
 <table>
-	<tr>
-		<th colspan="2">$i18n.getString( "details" )</th>
-	</tr>
+    <col width="200px" />
+   	<col width="240px" />
+
+    <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" style="width:20em"/></td>
-	</tr>
-	<tr>
-		<td colspan="2" height="15px"></td>
+		<td><input type="text" id="name" name="name" style="width:240px;"/></td>
 	</tr>
 </table>
 
+#tblDynamicAttributes( { "attributes": $attributes } )
+
 <table>
     <col style="width: 450px"/>
     <col/>

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addIndicatorGroupForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addIndicatorGroupForm.js	2011-08-19 21:33:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/addIndicatorGroupForm.js	1970-01-01 00:00:00 +0000
@@ -1,19 +0,0 @@
-jQuery( document ).ready( function()
-{
-    validation2( 'addIndicatorGroupForm', function( form )
-    {
-        form.submit();
-    }, {
-        'beforeValidateHandler' : function()
-        {
-            listValidator( 'memberValidator', 'groupMembers' );
-        },
-        'rules' : getValidationRules( "indicatorGroup" )
-    } );
-
-    checkValueIsExist( "name", "validateIndicatorGroup.action" );
-
-    var nameField = document.getElementById( 'name' );
-    nameField.select();
-    nameField.focus();
-} );

=== removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateIndicatorGroupForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateIndicatorGroupForm.js	2011-08-19 21:33:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateIndicatorGroupForm.js	1970-01-01 00:00:00 +0000
@@ -1,13 +0,0 @@
-jQuery( document ).ready( function()
-{
-    validation2( 'updateIndicatorGroupForm', function( form )
-    {
-        form.submit();
-    }, {
-        'beforeValidateHandler' : function()
-        {
-            listValidator( 'memberValidator', 'groupMembers' );
-        },
-        'rules' : getValidationRules( "indicatorGroup" )
-    } );
-} );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorForm.vm	2011-10-06 07:57:46 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorForm.vm	2012-06-01 12:17:31 +0000
@@ -10,7 +10,7 @@
 	        },
 	        'rules' : getValidationRules( "indicator" )
 	    } );
-	
+
 	    checkValueIsExist( "name", "validateIndicator.action", { id : getFieldValue( 'id' ) } );
 	    checkValueIsExist( "shortName", "validateIndicator.action", { id : getFieldValue( 'id' ) } );
 	    checkValueIsExist( "alternativeName", "validateIndicator.action", { id : getFieldValue( 'id' ) } );
@@ -28,33 +28,36 @@
 <input type="hidden" id="denominatorDescription" name="denominatorDescription" value="$!indicator.denominatorDescription"/>
 
 <table>
+    <col width="200px" />
+   	<col width="275px" />
+
 	<tr>
 		<th colspan="2">$i18n.getString( "details" )</th>
 	</tr>
 	<tr>
 		<td style="width:200px"><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( $indicator.name )" style="width:20em"/></td>
+		<td><input type="text" id="name" name="name" value="$encoder.htmlEncode( $indicator.name )" style="width:240px;"/></td>
 	</tr>
 	<tr>
 		<td><label for="shortName">$i18n.getString( "short_name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-		<td><input type="text" id="shortName" name="shortName" value="$encoder.htmlEncode( $indicator.shortName )" style="width:20em"/></td>
+		<td><input type="text" id="shortName" name="shortName" value="$encoder.htmlEncode( $indicator.shortName )" style="width:240px;"/></td>
 	</tr>
 	<tr>
 		<td><label for="alternativeName">$i18n.getString( "alternative_name" )</label></td>
-		<td><input type="text" id="alternativeName" name="alternativeName" value="$!encoder.htmlEncode( $indicator.alternativeName )" style="width:20em"/></td>
+		<td><input type="text" id="alternativeName" name="alternativeName" value="$!encoder.htmlEncode( $indicator.alternativeName )" style="width:240px;"/></td>
 	</tr>
 	<tr>
 		<td><label for="code">$i18n.getString( "code" )</label></td>
-		<td><input type="text" id="code" name="code" value="$!encoder.htmlEncode( $indicator.code )" style="width:20em"/></td>
+		<td><input type="text" id="code" name="code" value="$!encoder.htmlEncode( $indicator.code )" style="width:240px;"/></td>
 	</tr>
 	<tr>
 		<td><label for="description">$i18n.getString( "description" )</label></td>
-		<td><textarea id="description" name="description" style="width:20em; height:8em">$!encoder.htmlEncode( $indicator.description )</textarea></td>
+		<td><textarea id="description" name="description" style="width:240px;; height:8em">$!encoder.htmlEncode( $indicator.description )</textarea></td>
 	</tr>
 	<tr>
 		<td><label for="annualized">$i18n.getString( "annualized" )</label></td>
 		<td>
-			<select id="annualized" name="annualized" style="width:20em">
+			<select id="annualized" name="annualized" style="width:246px;">
 				<option value="false">$i18n.getString( "no" )</option>
 				<option value="true"#if( $indicator.annualized ) selected="selected"#end>$i18n.getString( "yes" )</option>
 			</select>
@@ -63,7 +66,7 @@
 	<tr>
 		<td><label for="indicatorTypeId">$i18n.getString( "indicator_type" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
 		<td>
-			<select id="indicatorTypeId" name="indicatorTypeId" style="min-width:20em" onchange='indicatorTypeChanged();'>			
+			<select id="indicatorTypeId" name="indicatorTypeId" style="min-width:246px" onchange='indicatorTypeChanged();'>
 			#foreach( $indicatorType in $indicatorTypes )
 				<option value="$indicatorType.id" number="$indicatorType.number" #if( $indicator.indicatorType.id == $indicatorType.id ) selected="selected"#end>$encoder.htmlEncode( $indicatorType.name )</option>
 			#end
@@ -72,7 +75,7 @@
 	</tr>
     <tr>
         <td><label for="url">$i18n.getString( "url" )</label></td>
-        <td><input type="text" id="url" name="url" value="$!encoder.htmlEncode( $indicator.url )" style="width:20em"/></td>
+        <td><input type="text" id="url" name="url" value="$!encoder.htmlEncode( $indicator.url )" style="width:240px"/></td>
     </tr>
 </table>
 
@@ -82,14 +85,14 @@
 	<tr>
 		<td style="width:200px"></td>
 		<td>
-			<input type="button" value="$i18n.getString( 'edit_numerator' )" onclick="indicatorNumeratorForm()" style="width:20em"/>
+			<input type="button" value="$i18n.getString( 'edit_numerator' )" onclick="indicatorNumeratorForm()" style="width:246px"/>
 			<input type="hidden" id="numerator" name="numerator" value="$!indicator.numerator"/>
 		</td>		
 	</tr>
 	<tr>
 		<td style="width:200px"></td>
 		<td>
-			<input type="button" id="denominatorButton" name="denominatorButton" value="$i18n.getString( 'edit_denominator' )" onclick="indicatorDenominatorForm()" style="width:20em"  #if($!indicator.indicatorType.number=='true') disabled #end/>
+			<input type="button" id="denominatorButton" name="denominatorButton" value="$i18n.getString( 'edit_denominator' )" onclick="indicatorDenominatorForm()" style="width:246px"  #if($!indicator.indicatorType.number=='true') disabled #end/>
 			<input type="hidden" id="denominator" name="denominator" value="$!indicator.denominator"/>
 			<input type="hidden" id="denominatorFormula" name="denominatorFormula" value="$!indicator.denominator"/>
 		</td>
@@ -99,7 +102,7 @@
 #if( $groupSets.size() > 0 )
 <table>
 	<col width="200px" />
-	<col width="240px" />
+	<col width="260px" />
 
 	<tr>
 		<td style="height:15px" colspan="2">

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupForm.vm	2012-02-01 10:50:31 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateIndicatorGroupForm.vm	2012-06-01 12:17:31 +0000
@@ -1,6 +1,17 @@
-<script type="text/javascript" src="javascript/updateIndicatorGroupForm.js"></script>
 <script type="text/javascript">
 	jQuery(document).ready(	function(){
+        validation2( 'updateIndicatorGroupForm', function( form )
+        {
+            form.submit();
+        }, {
+            'beforeValidateHandler' : function()
+            {
+                listValidator( 'memberValidator', 'groupMembers' );
+                #tblDynamicAttributesJavascript()
+            },
+            'rules' : getValidationRules( "indicatorGroup" )
+        } );
+
 		jQuery("#availableIndicatorsList").dhisAjaxSelect({
 			source: "../dhis-web-commons-ajax-json/getIndicators.action",
 			iterator: "indicators",
@@ -27,18 +38,20 @@
 </div>
 
 <table>
+    <col width="200px" />
+   	<col width="260px" />
+
 	<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( $indicatorGroup.name )" style="width:20em"/></td>
-	</tr>
-	<tr>
-		<td colspan="2" height="15px"></td>
+		<td><input type="text" id="name" name="name" value="$encoder.htmlEncode( $indicatorGroup.name )" style="width:240px;"/></td>
 	</tr>
 </table>
 
+#tblDynamicAttributes( { "attributes": $attributes, "attributeValues": $attributeValues } )
+
 <table>
     <col style="width: 450px"/>
     <col/>