← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 888: Finished new category GUI.

 

------------------------------------------------------------
revno: 888
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Tue 2009-10-20 14:49:32 +0200
message:
  Finished new category GUI.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/GetDataElementCategoryAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/ValidateDataElementCategoryAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/GetDataElementCategoryComboAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/category.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/categoryCombo.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryComboForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryCombo.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryComboForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryForm.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-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryService.java	2009-10-18 22:44:41 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryService.java	2009-10-20 12:49:32 +0000
@@ -141,14 +141,6 @@
     Collection<DataElementCategoryOption> getDataElementCategoryOptions( Collection<Integer> identifiers );
     
     /**
-     * Retrieves the DataElementCategoryOption with the given name.
-     * 
-     * @param name the name of the DataElementCategoryOption.
-     * @return the DataElementCategoryOption.
-     */
-    DataElementCategoryOption getDataElementCategoryOptionByName( String name );
-    
-    /**
      * Returns all DataElementCategoryOptions.
      * 
      * @return a collection of all DataElementCategoryOptions, or an empty collection if there

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java	2009-10-18 22:44:41 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java	2009-10-20 12:49:32 +0000
@@ -62,9 +62,9 @@
         this.dataElementCategoryStore = dataElementCategoryStore;
     }    
 
-    private GenericNameStore<DataElementCategoryOption> dataElementCategoryOptionStore;
+    private GenericStore<DataElementCategoryOption> dataElementCategoryOptionStore;
 
-    public void setDataElementCategoryOptionStore( GenericNameStore<DataElementCategoryOption> dataElementCategoryOptionStore )
+    public void setDataElementCategoryOptionStore( GenericStore<DataElementCategoryOption> dataElementCategoryOptionStore )
     {
         this.dataElementCategoryOptionStore = dataElementCategoryOptionStore;
     }
@@ -211,11 +211,6 @@
         return categoryOptions;
     }
 
-    public DataElementCategoryOption getDataElementCategoryOptionByName( String name )
-    {
-        return dataElementCategoryOptionStore.getByName( name );
-    }
-
     public Collection<DataElementCategoryOption> getAllDataElementCategoryOptions()
     {
         return dataElementCategoryOptionStore.getAll();

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/GetDataElementCategoryAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/GetDataElementCategoryAction.java	2009-10-19 17:10:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/GetDataElementCategoryAction.java	2009-10-20 12:49:32 +0000
@@ -80,8 +80,6 @@
     {
         dataElementCategory = dataElementCategoryService.getDataElementCategory( id );
         
-        System.out.println( "options " + dataElementCategory.getCategoryOptions().size() );
-        
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryAction.java	2009-10-19 17:10:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/UpdateDataElementCategoryAction.java	2009-10-20 12:49:32 +0000
@@ -27,6 +27,9 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.hisp.dhis.dataelement.DataElementCategory;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 
@@ -68,6 +71,13 @@
         this.name = name;
     }
 
+    private List<String> categoryOptions = new ArrayList<String>();
+
+    public void setCategoryOptions( List<String> categoryOptions )
+    {
+        this.categoryOptions = categoryOptions;
+    }
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -75,9 +85,19 @@
     public String execute()
     {
         DataElementCategory dataElementCategory = dataElementCategoryService.getDataElementCategory( id );
-
         dataElementCategory.setName( name );        
         
+        // ---------------------------------------------------------------------
+        // CategoryOptions can only be sorted on update
+        // ---------------------------------------------------------------------
+
+        dataElementCategory.getCategoryOptions().clear();
+        
+        for ( String id : categoryOptions )
+        {
+            dataElementCategory.getCategoryOptions().add( dataElementCategoryService.getDataElementCategoryOption( Integer.parseInt( id ) ) );
+        }
+        
         dataElementCategoryService.updateDataElementCategory( dataElementCategory );        
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/ValidateDataElementCategoryAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/ValidateDataElementCategoryAction.java	2009-10-19 17:10:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/category/ValidateDataElementCategoryAction.java	2009-10-20 12:49:32 +0000
@@ -27,9 +27,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
-import java.util.List;
-
 import org.hisp.dhis.dataelement.DataElementCategory;
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.i18n.I18n;
@@ -78,13 +75,6 @@
     {
         this.name = name;
     }
-    
-    private List<String> categoryOptionNames = new ArrayList<String>();
-
-    public void setCategoryOptionNames( List<String> categoryOptionNames )
-    {
-        this.categoryOptionNames = categoryOptionNames;
-    }
 
     // -------------------------------------------------------------------------
     // Output
@@ -130,13 +120,8 @@
             }
         }
         
-        if ( categoryOptionNames == null || categoryOptionNames.size() == 0 )
-        {
-            message = i18n.getString( "must_include_category_option" );
-            
-            return INPUT;
-        }
-
+        message = "ok";
+        
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/GetDataElementCategoryComboAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/GetDataElementCategoryComboAction.java	2009-10-19 17:10:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/GetDataElementCategoryComboAction.java	2009-10-20 12:49:32 +0000
@@ -92,8 +92,7 @@
 
     public String execute()
     {
-        dataElementCategoryCombo = dataElementCategoryService
-            .getDataElementCategoryCombo( id );
+        dataElementCategoryCombo = dataElementCategoryService.getDataElementCategoryCombo( id );
         
         dataElementCategories = dataElementCategoryCombo.getCategories();
         

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/category.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/category.js	2009-10-19 17:10:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/category.js	2009-10-20 12:49:32 +0000
@@ -79,50 +79,55 @@
 
 function validateAddDataElementCategory()
 {
-  var request = new Request();
-  request.setResponseTypeXML( 'message' );
-  request.setCallbackSuccess( addDataElementCategoryValidationCompleted );
-
-  var requestString = 'validateDataElementCategory.action?name=' + document.getElementById( 'name' ).value;
-  
-  requestString += "&" + getParamString( 'categoryOptionNames' );
-
-  request.send( requestString );
-  
-  return false;
+    var request = new Request();
+    request.setResponseTypeXML( 'message' );
+    request.setCallbackSuccess( addDataElementCategoryValidationCompleted );
+
+    if ( document.getElementById( 'categoryOptionNames' ).options.length == 0 )
+    {
+        setMessage( i18n_must_include_category_option );
+        return;
+    }
+
+    var requestString = 'validateDataElementCategory.action?name=' + htmlEncode( document.getElementById( 'name' ).value );
+  
+    requestString += "&" + getParamString( 'categoryOptionNames' );
+
+    request.send( requestString );
+  
+    return false;
 }
 
 function addDataElementCategoryValidationCompleted( messageElement )
 {
-  var type = messageElement.getAttribute( 'type' );
-  var message = messageElement.firstChild.nodeValue;
+    var type = messageElement.getAttribute( 'type' );
+    var message = messageElement.firstChild.nodeValue;
 
-  if ( type == 'success' )
-  {
-  	  selectAllById( 'categoryOptionNames' );
-      document.forms['addDataElementCategoryForm'].submit();
-  }
-  
-  else if ( type == 'input' )
-  {
-    document.getElementById( 'message' ).innerHTML = message;
-    document.getElementById( 'message' ).style.display = 'block';
-  }
+    if ( type == 'success' )
+    {
+  	    selectAllById( 'categoryOptionNames' );
+        document.getElementById( 'addDataElementCategoryForm' ).submit();
+    }  
+    else if ( type == 'input' )
+    {
+  	    setMessage( message );
+    }
 }
 
 function validateEditDataElementCategory()
 {
-  var request = new Request();
-  request.setResponseTypeXML( 'message' );
-  request.setCallbackSuccess( editDataElementCategoryValidationCompleted );
-
-  var requestString = 'validateDataElementCategory.action?name=' + document.getElementById( 'name' ).value;
-
-  requestString += "&" + getParamString( 'categoryOptionNames' );
-
-  request.send( requestString );
+    var request = new Request();
+    request.setResponseTypeXML( 'message' );
+    request.setCallbackSuccess( editDataElementCategoryValidationCompleted );
+  
+    var requestString = 'validateDataElementCategory.action?id=' + document.getElementById( 'id' ).value + 
+        '&name=' + htmlEncode( document.getElementById( 'name' ).value );
+
+    requestString += "&" + getParamString( 'categoryOptions' );
+  
+    request.send( requestString );
     
-  return false;
+    return false;
 }
 
 function editDataElementCategoryValidationCompleted( messageElement )
@@ -132,13 +137,11 @@
 
     if ( type == 'success' )
     {
-        selectAllById( 'categoryOptionNames' );
-        document.forms['editDataElementCategoryForm'].submit();
+        selectAllById( 'categoryOptions' );
+        document.getElementById( 'editDataElementCategoryForm' ).submit();
     }
     else if ( type == 'input' )
     {
-      document.getElementById( 'message' ).innerHTML = message;
-      document.getElementById( 'message' ).style.display = 'block';
+        setMessage( message );
     }
 }
-

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/categoryCombo.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/categoryCombo.js	2009-09-03 19:34:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/categoryCombo.js	2009-10-20 12:49:32 +0000
@@ -1,10 +1,10 @@
 
-function showDataElementCategoryComboDetails( dataElementCategoryComboId )
+function showDataElementCategoryComboDetails( categoryComboId )
 {
     var request = new Request();
     request.setResponseTypeXML( 'dataElementCategoryCombo' );
     request.setCallbackSuccess( dataElementCategoryComboReceived );
-    request.send( 'getDataElementCategoryCombo.action?dataElementCategoryComboId=' + dataElementCategoryComboId );
+    request.send( 'getDataElementCategoryCombo.action?id=' + categoryComboId );
 }
 
 function dataElementCategoryComboReceived( dataElementCategoryComboElement )
@@ -19,14 +19,14 @@
 // Delete Category
 // -----------------------------------------------------------------------------
 
-function removeDataElementCategoryCombo( dataElementCategoryComboId, dataElementCategoryComboName )
+function removeDataElementCategoryCombo( categoryComboId, categoryComboName )
 {
-  var result = window.confirm( i18n_confirm_delete + '\n\n' + dataElementCategoryComboName );
+    var result = window.confirm( i18n_confirm_delete + '\n\n' + categoryComboName );
 
-  if ( result )
-  {
-    window.location.href = 'removeDataElementCategoryCombo.action?dataElementCategoryComboId=' + dataElementCategoryComboId;
-  }
+    if ( result )
+    {
+        window.location.href = 'removeDataElementCategoryCombo.action?id=' + categoryComboId;
+    }
 }
 
 // ----------------------------------------------------------------------
@@ -35,68 +35,64 @@
 
 function validateAddDataElementCategoryCombo()
 {
-  var request = new Request();
-  request.setResponseTypeXML( 'message' );
-  request.setCallbackSuccess( addDataElementCategoryComboValidationCompleted );
-
-  var requestString = 'validateDataElementCategoryCombo.action';  
-
-  var selectedList = document.getElementById( 'selectedList' );
-  
-  var params = 'name=' + document.getElementById( 'nameField' ).value;
-
-  for ( var i = 0; i < selectedList.options.length; ++i)
-  {  	
-  	params += '&selectedCategories=' + selectedList.options[i].value;
-  }
-  
-  request.sendAsPost( params );
-    
-  request.send( requestString );
-  
-  return false;
+    var request = new Request();
+    request.setResponseTypeXML( 'message' );
+    request.setCallbackSuccess( addDataElementCategoryComboValidationCompleted );
+
+    var requestString = 'validateDataElementCategoryCombo.action';  
+
+    var selectedList = document.getElementById( 'selectedList' );
+  
+    var params = 'name=' + htmlEncode( document.getElementById( 'name' ).value );
+
+    for ( var i = 0; i < selectedList.options.length; ++i)
+    {  	
+        params += '&selectedCategories=' + selectedList.options[i].value;
+    }
+  
+    request.sendAsPost( params );    
+    request.send( requestString );
+  
+    return false;
 }
 
 function addDataElementCategoryComboValidationCompleted( messageElement )
 {
-  var type = messageElement.getAttribute( 'type' );
-  var message = messageElement.firstChild.nodeValue;
+    var type = messageElement.getAttribute( 'type' );
+    var message = messageElement.firstChild.nodeValue;
 
-  if ( type == 'success' )
-  {           
-      document.forms['addDataElementCategoryComboForm'].submit();
-  }
-  
-  else if ( type == 'input' )
-  {
-    document.getElementById( 'message' ).innerHTML = message;
-    document.getElementById( 'message' ).style.display = 'block';
-  }
+    if ( type == 'success' )
+    {           
+        document.getElementById( 'addDataElementCategoryComboForm' ).submit();
+    }  
+    else if ( type == 'input' )
+    {
+  	    setMessage( message );
+    }
 }
 
 function validateEditDataElementCategoryCombo()
 {
-  var request = new Request();
-  request.setResponseTypeXML( 'message' );
-  request.setCallbackSuccess( editDataElementCategoryComboValidationCompleted );
+    var request = new Request();
+    request.setResponseTypeXML( 'message' );
+    request.setCallbackSuccess( editDataElementCategoryComboValidationCompleted );
   
-  var requestString = 'validateDataElementCategoryCombo.action';
+    var requestString = 'validateDataElementCategoryCombo.action';
     
-  var selectedList = document.getElementById( 'selectedList' );
+    var selectedList = document.getElementById( 'selectedList' );
   
-  var params = 'name=' + document.getElementById( 'nameField' ).value;
-  	  params += '&dataElementCategoryComboId=' + document.getElementById( 'dataElementCategoryComboId' ).value;
+    var params = 'id=' + document.getElementById( 'id' ).value;
+  	params += '&name=' + htmlEncode( document.getElementById( 'name' ).value );
 
-  for ( var i = 0; i < selectedList.options.length; ++i)
-  {   	
-  	params += '&selectedCategories=' + selectedList.options[i].value;
-  }
+    for ( var i = 0; i < selectedList.options.length; ++i)
+    {   	
+        params += '&selectedCategories=' + selectedList.options[i].value;
+    }
   
-  request.sendAsPost( params );
-    
-  request.send( requestString );
+    request.sendAsPost( params );    
+    request.send( requestString );
       
-  return false;
+    return false;
 }
 
 function editDataElementCategoryComboValidationCompleted( messageElement )
@@ -106,13 +102,11 @@
 
     if ( type == 'success' )
     {
-        // Both edit and add form has id='dataSetForm'
-        document.forms['editDataElementCategoryComboForm'].submit();
+        document.getElementById( 'editDataElementCategoryComboForm' ).submit();
     }
     else if ( type == 'input' )
     {
-      document.getElementById( 'message' ).innerHTML = message;
-      document.getElementById( 'message' ).style.display = 'block';
+    	setMessage( message );
     }
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryComboForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryComboForm.vm	2009-03-31 15:36:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryComboForm.vm	2009-10-20 12:49:32 +0000
@@ -11,7 +11,7 @@
     <tbody>
       <tr>
         <td><label>$i18n.getString( "name" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
-        <td><input type="text" id="nameField" name="nameField" style="width:20em"></td>
+        <td><input type="text" id="name" name="name" style="width:20em"></td>
       </tr>      
       <tr>
       	<td colspan="2" style="height:15px"></td>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryForm.vm	2009-10-19 17:10:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryForm.vm	2009-10-20 12:49:32 +0000
@@ -60,4 +60,5 @@
 <script type="text/javascript">
     var i18n_specify_category_option_name = '$encoder.jsEscape( $i18n.getString( "specify_category_option_name" ) , "'")';
     var i18n_category_option_name_already_exists = '$encoder.jsEscape( $i18n.getString( "category_option_name_already_exists" ) , "'")';
+    var i18n_must_include_category_option = '$encoder.jsEscape( $i18n.getString( "must_include_category_option" ) , "'")';
 </script>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryCombo.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryCombo.vm	2009-09-03 19:34:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/categoryCombo.vm	2009-10-20 12:49:32 +0000
@@ -25,7 +25,7 @@
             #if( $dataElementCategoryCombo.id != $defaultCombo.id )
               <tr>
                 <td#alternate( $mark )>$encoder.htmlEncode( $dataElementCategoryCombo.name )</td>
-                <td style="text-align:center"#alternate( $mark )><a href="showUpdateDataElementCategoryComboForm.action?dataElementCategoryComboId=$dataElementCategoryCombo.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
+                <td style="text-align:center"#alternate( $mark )><a href="showUpdateDataElementCategoryComboForm.action?id=$dataElementCategoryCombo.id" title="$i18n.getString( "edit" )"><img src="../images/edit.png" alt="$i18n.getString( "edit" )"></a></td>
                 <td style="text-align:center"#alternate( $mark )><a href="javascript:removeDataElementCategoryCombo( '$dataElementCategoryCombo.id', '$encoder.jsEncode( $dataElementCategoryCombo.name )' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a></td>
 				<td style="text-align:center"#alternate( $mark )><a href="javascript:showDataElementCategoryComboDetails( $dataElementCategoryCombo.id )" title="$i18n.getString( "show_details" )"><img src="../images/information.png" alt="$i18n.getString( "show_details" )"></a></td>				
               </tr>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryComboForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryComboForm.vm	2009-03-31 15:36:54 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryComboForm.vm	2009-10-20 12:49:32 +0000
@@ -2,9 +2,7 @@
 <h3>$i18n.getString( "edit_data_element_category_combo" )</h3>
 
 <form id="editDataElementCategoryComboForm" name="editDataElementCategoryComboForm" action="updateDataElementCategoryCombo.action" method="post" onsubmit="submitForm(); return validateEditDataElementCategoryCombo()">
-  <div style="display:inline">
-  <input type="hidden" id="dataElementCategoryComboId" name="dataElementCategoryComboId" value="$dataElementCategoryCombo.id">
-  </div>
+  <input type="hidden" id="id" name="id" value="$dataElementCategoryCombo.id">
   
   <table id="detailsList">
     <thead>
@@ -15,7 +13,7 @@
     <tbody>
       <tr>
         <td><label>$i18n.getString( "name" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
-        <td><input type="text" id="nameField" name="nameField" style="width:20em" value="$encoder.htmlEncode( $dataElementCategoryCombo.name )"></td>
+        <td><input type="text" id="name" name="name" style="width:20em" value="$encoder.htmlEncode( $dataElementCategoryCombo.name )"></td>
       </tr>      
       <tr>
       	<td colspan="2" style="height:15px"></td>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryForm.vm	2009-10-19 17:10:19 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryForm.vm	2009-10-20 12:49:32 +0000
@@ -23,29 +23,17 @@
       <td></td>
     </tr>
     <tr>
-      <td><label>$i18n.getString( "name" )</label></td>
-      <td><input type="text" id="categoryOptionName" style="width:25em"></td>
-      <td></td>
-    </tr>
-    <tr>
-      <td></td>
-      <td colspan="2">
-        <input type="button" value="$i18n.getString( "add_category_option" )" onclick="addCategoryOptionToCategory()" style="width:200px">
-      </td>
-    </tr>
-    <tr>
       <td></td>
       <td>
-        <select multiple size="10" id="categoryOptionNames" name="categoryOptionNames" style="width:300px">
+        <select multiple size="10" id="categoryOptions" name="categoryOptions" style="width:300px">
         #foreach( $categoryOption in $dataElementCategory.categoryOptions )
-        	<option value="$categoryOption.name">$encoder.htmlEncode( $categoryOption.name )</option>
+        	<option value="$categoryOption.id">$encoder.htmlEncode( $categoryOption.name )</option>
         #end
         </select>   
       </td>
       <td style="width:30px; text-align:center">
-        <a href="javascript:moveUpSelectedOption( 'categoryOptionNames' )"><img src="../images/move_up.png"></a><br><br>
-        <a href="javascript:moveDownSelectedOption( 'categoryOptionNames' )"><img src="../images/move_down.png"></a><br><br>
-        <a href="javascript:removeSelectedOption( 'categoryOptionNames' )"><img src="../images/delete.png"></a>
+        <a href="javascript:moveUpSelectedOption( 'categoryOptions' )"><img src="../images/move_up.png"></a><br><br>
+        <a href="javascript:moveDownSelectedOption( 'categoryOptions' )"><img src="../images/move_down.png"></a><br><br>
       </td>
     </tr>
     <tr>