← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2818: Dataentry fix. Made select option descriptions more descriptive. Move prev/next buttons to the ri...

 

------------------------------------------------------------
revno: 2818
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-02-04 09:12:04 +0100
message:
  Dataentry fix. Made select option descriptions more descriptive. Move prev/next buttons to the right of the period list. Made the dataset and period lists disabled until orgunit/dataset is selected.
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.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-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties	2011-01-25 16:02:32 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties	2011-02-04 08:12:04 +0000
@@ -115,4 +115,7 @@
 datavalue_history                   = Data value history
 max_must_be_greater_than_min		= Max must be greater than min
 next 								= Next
-prev 								= Prev
\ No newline at end of file
+prev 								= Prev
+select_from_tree					= Select from tree on the left side
+select_data_set						= Select data set
+select_period						= Select period
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2011-02-01 08:53:47 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2011-02-04 08:12:04 +0000
@@ -35,6 +35,8 @@
 
 function organisationUnitSelected( orgUnits )
 {
+    $( '#selectedDataSetId' ).removeAttr( 'disabled' );
+    
     var dataSetId = $( '#selectedDataSetId' ).val();
     
     var url = 'loadDataSets.action';
@@ -43,7 +45,7 @@
     
     clearList( list );
     
-    addOptionToList( list, '-1', '[ Select ]' );
+    addOptionToList( list, '-1', '[ ' + i18n_select_data_set + ' ]' );
     
     $.getJSON( url, function( json ) {
     	$( '#selectedOrganisationUnit' ).val( json.organisationUnit.name );
@@ -93,7 +95,7 @@
 		
 	clearList( list );
 	    
-	addOptionToList( list, '-1', '[ Select ]' );
+	addOptionToList( list, '-1', '[ ' + i18n_select_period + ' ]' );
 	
     $.getJSON( url, function( json ) {
     	for ( i in json.periods ) {
@@ -122,6 +124,10 @@
 
 function dataSetSelected()
 {
+    $( '#selectedPeriodIndex' ).removeAttr( 'disabled' );
+    $( '#prevButton' ).removeAttr( 'disabled' );
+    $( '#nextButton' ).removeAttr( 'disabled' );
+    
 	var dataSetId = $( '#selectedDataSetId' ).val();	
 	var periodIndex = $( '#selectedPeriodIndex' ).val();
 	
@@ -133,7 +139,7 @@
 		
 	    clearList( list );
 	    
-	    addOptionToList( list, '-1', '[ Select ]' );
+	    addOptionToList( list, '-1', '[ ' + i18n_select_period + ' ]' );
 		
 	    $.getJSON( url, function( json ) {
 	    	significantZeros = json.significantZeros;

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm	2011-02-01 08:53:47 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm	2011-02-04 08:12:04 +0000
@@ -11,29 +11,28 @@
 <div id="actions" style="">	
     <input type="button" value="$i18n.getString( 'run_validation' )" onclick="javascript:validate()" style="width:150px"/><br/><br/>
 
-	<input type="radio" id="displayModeCustom" name="displayMode" value="customform" disabled="disabled" onclick="displayModeSelected()">
-    <label for="displayModeCustom">$i18n.getString( "use_custom_form" )</label><br/>
-	<input type="radio" id="displayModeSection" name="displayMode" value="sectionform" disabled="disabled" onclick="displayModeSelected()">
-	<label for="displayModeSection">$i18n.getString( "use_section_form" )</label><br/>
-	<input type="radio" id="displayModeDefault" name="displayMode" value="defaultform" disabled="disabled" onclick="displayModeSelected()">
-    <label for="displayModeDefault">$i18n.getString( "use_default_form" )</label><br/><br/>
+    <label for="displayModeCustom">$i18n.getString( "use_custom_form" )</label>
+    <input type="radio" id="displayModeCustom" name="displayMode" value="customform" disabled="disabled" onclick="displayModeSelected()"><br>
+    <label for="displayModeSection">$i18n.getString( "use_section_form" )</label>
+	<input type="radio" id="displayModeSection" name="displayMode" value="sectionform" disabled="disabled" onclick="displayModeSelected()"><br>
+	<label for="displayModeDefault">$i18n.getString( "use_default_form" )</label>
+	<input type="radio" id="displayModeDefault" name="displayMode" value="defaultform" disabled="disabled" onclick="displayModeSelected()"><br><br>
 </div>
 
-<table>	
+<table>
 	<tr>
-		<td><label>$i18n.getString( "organisation_unit" )</label></td>
-		<td><input type="text" id="selectedOrganisationUnit" readonly="readonly" value="[ $i18n.getString( 'select' ) ]" style="min-width:350px"></td>
+		<td><label for="selectedOrganisationUnit">$i18n.getString( "organisation_unit" )</label></td>
+		<td><input type="text" id="selectedOrganisationUnit" readonly="readonly" value="[ $i18n.getString( 'select_from_tree' ) ]" style="min-width:348px"></td>
 	</tr>	
 	<tr>
 		<td><label for="selectedDataSetId">$i18n.getString( "data_set" )</label></td>
-		<td><select id="selectedDataSetId" name="selectedDataSetId" style="min-width:350px" onchange="dataSetSelected()"></select></td>
+		<td><select id="selectedDataSetId" name="selectedDataSetId" style="min-width:350px" onchange="dataSetSelected()" disabled="disabled"></select></td>
 	</tr>	
 	<tr>
 		<td><label for="selectedPeriodIndex">$i18n.getString( "period" )</label></td>
-		<td>
-			<input type="button" id="nextButton" style="width:50px" value="$i18n.getString( 'prev' )" title="$i18n.getString('earlier_periods')" onclick="previousPeriodsSelected()"><input 
-			       type="button" id="prevButton" style="width:50px" value="$i18n.getString( 'next' )" title="$i18n.getString('later_periods')" onclick="nextPeriodsSelected()"><br/>
-			<select id="selectedPeriodIndex" name="selectedPeriodIndex" style="min-width:350px" onchange="periodSelected()"></select>
+		<td><select id="selectedPeriodIndex" name="selectedPeriodIndex" style="min-width:227px" onchange="periodSelected()" disabled="disabled"></select>
+			<input type="button" id="prevButton" style="width:60px" value="$i18n.getString( 'prev' )" title="$i18n.getString('earlier_periods')" onclick="previousPeriodsSelected()" disabled="disabled"><input 
+				   type="button" id="nextButton" style="width:60px" value="$i18n.getString( 'next' )" title="$i18n.getString('later_periods')" onclick="nextPeriodsSelected()" disabled="disabled">
 		</td>
 	</tr>	
 </table>
@@ -46,10 +45,11 @@
 <div id="contentDiv"></div>
 
 <script type="text/javascript">
+	var i18n_select_data_set = '$encoder.jsEscape( $i18n.getString( "select_data_set" ) , "'")';
+	var i18n_select_period = '$encoder.jsEscape( $i18n.getString( "select_period" ) , "'")';
 	var i18n_register_complete_dataset_success = '$encoder.jsEscape( $i18n.getString( "register_complete_dataset_success" ) , "'")';
 	var i18n_register_complete_dataset_failed = '$encoder.jsEscape( $i18n.getString( "register_complete_dataset_failed" ) , "'")';
 	var i18n_undo_register_complete_dataset_success = '$encoder.jsEscape( $i18n.getString( "undo_register_complete_dataset_success" ) , "'")';
-	var i18n_generate_min_max_success = '$encoder.jsEscape( $i18n.getString( "generate_min_max_success" ) , "'")';	
     var i18n_value_of_data_element_less = '$encoder.jsEscape( $i18n.getString( "value_of_data_element_less" ) , "'")';
     var i18n_value_of_data_element_greater = '$encoder.jsEscape( $i18n.getString( "value_of_data_element_greater" ) , "'")';
 	var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';