← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7446: Add Update button for option-value of optionset.

 

------------------------------------------------------------
revno: 7446
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-06-28 14:00:06 +0700
message:
  Add Update button for option-value of optionset.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addOptionSetForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/optionSet.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateOptionSetForm.vm


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties	2012-06-08 02:43:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties	2012-06-28 07:00:06 +0000
@@ -305,4 +305,5 @@
 not_started=not started
 aggregated_data_set_completeness=Aggregated data set completeness
 show_sql_view=Show SQL view
-financial_yearly=Financial Yearly
\ No newline at end of file
+financial_yearly=Financial Yearly
+update_option = Update option
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addOptionSetForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addOptionSetForm.vm	2012-02-07 03:20:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addOptionSetForm.vm	2012-06-28 07:00:06 +0000
@@ -4,7 +4,6 @@
 			'beforeValidateHandler': function() { listValidator( 'memberValidator', 'options' ); },
 			'rules': getValidationRules("dateElementCategory")
 		});
-
 		checkValueIsExist( "name", "validateOptionSet.action");	
 	});
 
@@ -38,7 +37,8 @@
     <tr>
       <td></td>
       <td colspan="3">
-      	<input type="button" value="$i18n.getString( 'add_option' )" onclick="addOption();" style="width:200px"/>
+      	<input type="button" value="$i18n.getString( 'add_option' )" onclick="addOption();" style="width:165px"/>
+		<input type="button" value="$i18n.getString( 'update_option' )" onclick="updateOption();" style="width:165px"/>
       </td>
     </tr>
     <tr>
@@ -47,12 +47,11 @@
 	  <table>
 	  <tr>
 	  <td>
-        <select multiple size="10" id="options" name="options" style="width:300px">           
-        </select>
+        <select multiple size="10" id="options" name="options" style="width:330px" onchange="setFieldValue('option', this.value);"></select>
 	  </td>	
       <td>	  
-		<a href="javascript:moveUpSelectedOption( 'options' )"><img src="../images/move_up.png"/></a><br/><br/>
-      	<a href="javascript:moveDownSelectedOption( 'options' )"><img src="../images/move_down.png"/></a><br/><br/>
+		<a href="javascript:moveUpSelectedOption( 'options' )"><img src="../images/move_up.png" style='padding-left:5px;'/></a><br/><br/>
+      	<a href="javascript:moveDownSelectedOption( 'options' )"><img src="../images/move_down.png" style='padding-left:5px;'/></a><br/><br/>
         <a href="javascript:removeSelectedOption( 'options' )"><img src="../images/delete.png"/></a>
       </td>
 	  </tr>
@@ -67,8 +66,8 @@
 	<tr>
 	  <td></td>
 	  <td colspan="3">
-		<input type="submit"  value="$i18n.getString( 'add' )" style="width:100px">
-		<input type="button" onclick="window.location.href='optionSet.action'" value="$i18n.getString( 'cancel' )" style="width:100px"/></p>
+		<input type="submit"  value="$i18n.getString( 'add' )" style="width:165px">
+		<input type="button" onclick="window.location.href='optionSet.action'" value="$i18n.getString( 'cancel' )" style="width:165px"/></p>
       </td>
 	</tr>
   </table>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/optionSet.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/optionSet.js	2012-02-07 03:20:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/optionSet.js	2012-06-28 07:00:06 +0000
@@ -44,4 +44,14 @@
 	
 	setFieldValue('option', '');
 	$("#option").focus();
-}
\ No newline at end of file
+}
+
+function updateOption()
+{
+	var value = getFieldValue( 'option' );
+	jQuery('#options option:selected').val(value);
+	jQuery('#options option:selected').text(value);
+	
+	setFieldValue('option', '');
+	$("#option").focus();
+}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateOptionSetForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateOptionSetForm.vm	2012-02-07 09:05:40 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateOptionSetForm.vm	2012-06-28 07:00:06 +0000
@@ -37,21 +37,22 @@
     <tr>
       <td></td>
       <td colspan="3">
-      	<input type="button" value="$i18n.getString( 'add_option' )" onclick="addOption();" style="width:200px"/>
-      </td>
+      	<input type="button" value="$i18n.getString( 'add_option' )" onclick="addOption();" style="width:165px"/>
+      	<input type="button" value="$i18n.getString( 'update_option' )" onclick="updateOption();" style="width:165px"/>
+	  </td>
     </tr>
     <tr>
 		<td></td>
 		<td>
-			<select multiple size="10" id="options" name="options" style="width:300px">  
+			<select multiple size="10" id="options" name="options" style="width:330px" onchange="setFieldValue('option', this.value);">  
 				#foreach( $option in $optionSet.options )
 					<option value='$option'>$option</option>
 				#end
 			</select>
 		</td>
 		<td>	  
-			<a href="javascript:moveUpSelectedOption( 'options' )"><img src="../images/move_up.png"/></a><br/><br/>
-			<a href="javascript:moveDownSelectedOption( 'options' )"><img src="../images/move_down.png"/></a><br/><br/>
+			<a href="javascript:moveUpSelectedOption( 'options' )"><img src="../images/move_up.png" style='padding-left:5px;'/></a><br/><br/>
+			<a href="javascript:moveDownSelectedOption( 'options' )"><img src="../images/move_down.png" style='padding-left:5px;'/></a><br/><br/>
 			<a href="javascript:removeSelectedOption( 'options' )"><img src="../images/delete.png"/></a>
 		</td>
 	</tr>
@@ -64,8 +65,8 @@
 	<tr>
 	  <td></td>
 	  <td colspan="2">
-		<input type="submit"  value="$i18n.getString( 'update' )" style="width:100px">
-		<input type="button" onclick="window.location.href='optionSet.action'" value="$i18n.getString( 'cancel' )" style="width:100px"/></p>
+		<input type="submit"  value="$i18n.getString( 'update' )" style="width:165px">
+		<input type="button" onclick="window.location.href='optionSet.action'" value="$i18n.getString( 'cancel' )" style="width:165px"/></p>
       </td>
 	</tr>
   </table>