← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2259: Minor fix.

 

------------------------------------------------------------
revno: 2259
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Mon 2010-09-27 19:49:39 +0700
message:
  Minor fix.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/underage.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.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-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/underage.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/underage.js	2010-09-25 07:53:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/underage.js	2010-09-27 12:49:39 +0000
@@ -4,29 +4,29 @@
 
 function validateAddRepresentative()
 {	
-	var params ='&firstName=' + getFieldValue( 'firstName' ) 
-				+'&middleName=' + getFieldValue( 'middleName' ) 
-				+'&lastName=' + getFieldValue( 'lastName' ) 
-				+'&gender=' + getFieldValue( 'gender' ) 
-				+'&birthDate=' + getFieldValue( 'birthDate' ) 	        
-				+'&age=' + getFieldValue( 'age' ) 
-				+'&genre=' + getFieldValue('gender') 
-				+ getIdParams();
-	
-	var request = new Request();
-	request.setResponseTypeXML( 'message' );
-	request.setCallbackSuccess( addValidationCompleted ); 
-	request.sendAsPost( params );	
-	request.send( "validatePatient.action" );        
-	
-	return false;
+	$.post("validatePatient.action?" + getIdParams(),
+		{
+			firstName: getFieldValue( 'firstName' ),
+			middleName: getFieldValue( 'middleName' ),
+			lastName: getFieldValue( 'lastName' ),
+			gender: getFieldValue( 'gender' ) ,
+			birthDate: getFieldValue( 'birthDate' ), 	        
+			age: getFieldValue( 'age' ) ,
+			genre: getFieldValue('gender') 
+		},
+		function (data)
+		{
+			addValidationRepresentativeCompleted(data);
+		},'xml');
+		
 }
 
-function addValidationCompleted( messageElement )
+function addValidationRepresentativeCompleted( messageElement )
 {
-	 var type = messageElement.getAttribute( 'type' );
-	 var message = messageElement.firstChild.nodeValue;
-	 
+	messageElement = messageElement.getElementsByTagName( "message" )[0];
+	var type = messageElement.getAttribute( "type" );
+	var message = messageElement.firstChild.nodeValue;
+	
 	 if ( type == 'success' )
 	 {
 		 // Use jQuery Ajax submit 
@@ -35,7 +35,7 @@
 			   ,url: "addRepresentative.action"
 			   ,data: jQuery("#addRepresentativeForm").serialize()
 			   ,dataType : "xml"
-			   ,success: function(xml){
+			   ,success: function(xml){ 
 			 		autoChoosePerson( xml );
 				}
 			   ,error: function()
@@ -84,7 +84,7 @@
 		   ,url: "searchPerson.action"
 		   ,data: jQuery("#searchForm").serialize()
 		   ,dataType : "xml"
-		   ,success: function(xmlObject){alert('1');
+		   ,success: function(xmlObject){
 				showPersons( "searchForm div[id=listPersons]", xmlObject );
 			}
 		   ,error: function(request,status,errorThrown)

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm	2010-09-25 07:53:17 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm	2010-09-27 12:49:39 +0000
@@ -27,7 +27,7 @@
 						}
 		,rules : {
 			relationshipTypeId  : { required: true },
-			firstName : {required_group:true,rangelength:[2,30], letterswithbasicpunc: true},
+			firstName : {required:true,rangelength:[2,30], letterswithbasicpunc: true},
 			middleName : {required:false, letterswithbasicpunc: true},
 			lastName : {required:false, letterswithbasicpunc: true},
 			gender : { required: true },