← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1184: fixed : disabled all input text when data set completed

 

------------------------------------------------------------
revno: 1184
committer: Tran Thanh Tri <Tran Thanh Tri@compaq>
branch nick: trunk
timestamp: Wed 2009-12-09 10:43:38 +0700
message:
  fixed : disabled all input text when data set completed 
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/completeRegistration.vm
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js


--
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/webapp/dhis-web-dataentry/completeRegistration.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/completeRegistration.vm	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/completeRegistration.vm	2009-12-09 03:43:38 +0000
@@ -26,4 +26,11 @@
 <script type="text/javascript">
     var i18n_confirm_complete = '$encoder.jsEscape( $i18n.getString( "confirm_complete" ) , "'")';
     var i18n_confirm_undo = '$encoder.jsEscape( $i18n.getString( "confirm_undo" ) , "'")';
+	
+	#if( $registration || $periods.size() == 0 )
+		disableInputField();
+	#end
+	
+	
+	
 </script>

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm	2009-11-07 14:09:00 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm	2009-12-09 03:43:38 +0000
@@ -6,7 +6,7 @@
 </script>
 
 #parse( "/dhis-web-dataentry/select.vm" )
-
+<div id="dataEntryForm">
 #if ( $customDataEntryFormExists && !$useDefaultForm )
 			
 		#foreach( $optionCombo in $orderdCategoryOptionCombos )
@@ -171,7 +171,7 @@
 #end
 </table>
 #end
-
+</div>
 #parse( "/dhis-web-dataentry/completeRegistration.vm" )
 
 <script type="text/javascript">

=== 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	2009-03-12 11:40:58 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2009-12-09 03:43:38 +0000
@@ -303,6 +303,7 @@
 	document.getElementById( "undoButton" ).disabled = false;
     document.getElementById( "dateField" ).disabled = true;
     document.getElementById( "dateDiv" ).style.display = "none";
+	disableInputField();
 }
 
 function undoCompleteDataSet()
@@ -325,4 +326,25 @@
     document.getElementById( "undoButton" ).disabled = true;
     document.getElementById( "dateField" ).disabled = false;
     document.getElementById( "dateDiv" ).style.display = "inline";
+	enableInputField();
+}
+
+function disableInputField()
+{
+	var inputList = byId("dataEntryForm").getElementsByTagName("input");
+	
+	for(var i=0;i<inputList.length;i++){
+		var input = inputList.item(i);
+		input.disabled = true;
+	}		
+}
+
+function enableInputField()
+{
+	var inputList = byId("dataEntryForm").getElementsByTagName("input");
+	
+	for(var i=0;i<inputList.length;i++){
+		var input = inputList.item(i);
+		input.disabled = false;
+	}	
 }


Follow ups