← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4848: Don't edit representative of patient.

 

------------------------------------------------------------
revno: 4848
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-10-06 13:10:13 +0700
message:
  Don't edit representative of patient.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/underage.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.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-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm	2011-10-03 04:49:57 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm	2011-10-06 06:10:13 +0000
@@ -2,36 +2,36 @@
 	
 	jQuery(document).ready(	function(){
 
-		currentDiv = 'addPatientForm';
+		currentDiv = 'patientForm';
 		checkedDuplicate = false;
 
-		jQuery("#addPatientForm").validate({
+		jQuery("#patientForm").validate({
 				 meta:"validate"
 				,errorElement:"span"
 				,submitHandler: function(form)
 					{
-						validateAddPatient('addPatientForm');
+						validateAddPatient();
 					}
 				,beforeValidateHandler: function(form)
 					{
-						var dobType = $('#addPatientForm [id=dobType]').val();
+						var dobType = $('#patientForm [id=dobType]').val();
 						
 						if( dobType=='V' || dobType=='D' ) 
 						{
-							var birthDate = $('#addPatientForm [id=birthDate]').val();
+							var birthDate = $('#patientForm [id=birthDate]').val();
 							if( birthDate != '' ){
-								$("#addPatientForm [id=memberValidator]").val(birthDate);
+								$("#patientForm [id=memberValidator]").val(birthDate);
 							}
 						}else{
-							var age = $('#addPatientForm [id=age]').val();
-							$("#addPatientForm [id=memberValidator]").val(age);
+							var age = $('#patientForm [id=age]').val();
+							$("#patientForm [id=memberValidator]").val(age);
 						}
 					}
 			});
 		
-		datePickerValid( 'addPatientForm [id=registrationDate]' );
-		datePickerValid( 'addPatientForm [id=birthDate]' );
-		addEventForPatientForm( 'addPatientForm' );
+		datePickerValid( 'patientForm [id=registrationDate]' );
+		datePickerValid( 'patientForm [id=birthDate]' );
+		addEventForPatientForm( 'patientForm' );
 	});	
 	
 </script>
@@ -39,7 +39,7 @@
 <h3>$i18n.getString( "add_new_patient" )</h3>	
 <p><input type="button" value="$i18n.getString( 'back_to_search' )" onclick="loadPatientList();" style="width:10em"/></p>
 
-<form id="addPatientForm" name="addPatientForm" method="post" >
+<form id="patientForm" name="patientForm" method="post" >
 <input type="hidden" id="representativeId" name="representativeId"/> 
 <input type="hidden" id="relationshipTypeId" name="relationshipTypeId"/>
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2011-10-06 04:38:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2011-10-06 06:10:13 +0000
@@ -184,10 +184,10 @@
 {
     $.post( 'validatePatient.action?' + getIdParams( ), 
 		{ 
-			id: jQuery( '#updatePatientForm [id=id]' ).val(),
-			fullName: jQuery( '#updatePatientForm [id=fullName]' ).val(),
-			gender: jQuery( '#updatePatientForm [id=gender]' ).val(),
-			birthDate: jQuery( '#updatePatientForm [id=birthDate]' ).val()
+			id: jQuery( '#patientForm [id=id]' ).val(),
+			fullName: jQuery( '#patientForm [id=fullName]' ).val(),
+			gender: jQuery( '#patientForm [id=gender]' ).val(),
+			birthDate: jQuery( '#patientForm [id=birthDate]' ).val()
 		}, updateValidationCompleted );
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/underage.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/underage.js	2011-10-03 04:49:57 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/underage.js	2011-10-06 06:10:13 +0000
@@ -137,11 +137,11 @@
 {
 	jQuery("#tab-2").html("<center><span class='bold'>" + i18n_add_person_successfully + "</span></center>");
 	var root = jQuery(xmlElement);
-	jQuery("#addPatientForm [id=representativeId]").val( root.find("id").text() );
-	jQuery("#addPatientForm [id=relationshipTypeId]").val( root.find("relationshipTypeId").text() );
+	jQuery("#patientForm [id=representativeId]").val( root.find("id").text() );
+	jQuery("#patientForm [id=relationshipTypeId]").val( root.find("relationshipTypeId").text() );
 	root.find("identifier").each(
 			function(){
-				var inputField = jQuery("#addPatientForm iden" + jQuery(this).find("identifierTypeId").text());
+				var inputField = jQuery("#patientForm iden" + jQuery(this).find("identifierTypeId").text());
 				inputField.val( jQuery(this).find("identifierText").text() );
 				inputField.attr({"disabled":"disabled"});
 			}
@@ -162,8 +162,8 @@
 	}
 	
 	var id = jQuery(this_).attr("id");
-	jQuery("#addPatientForm [id=representativeId]").val(id);
-	jQuery("#addPatientForm [id=relationshipTypeId]").val(relationshipTypeId);
+	jQuery("#patientForm [id=representativeId]").val(id);
+	jQuery("#patientForm [id=relationshipTypeId]").val(relationshipTypeId);
 	jQuery(".identifierRow"+id).each(function(){
 		var inputField = window.parent.jQuery("#"+jQuery(this).attr("id"));
 		if( inputField.metadata({type:"attr",name:"data"}).related  )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm	2011-09-30 08:37:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm	2011-10-06 06:10:13 +0000
@@ -12,16 +12,16 @@
 	
 	jQuery(document).ready(	function(){
 
-		datePickerValid( 'updatePatientForm [id=birthDate]' );
-		datePickerValid( 'updatePatientForm [id=deathDate]' );
-		addEventForPatientForm('updatePatientForm');
+		datePickerValid( 'patientForm [id=birthDate]' );
+		datePickerValid( 'patientForm [id=deathDate]' );
+		addEventForPatientForm('patientForm');
 		
 		jQuery("#btnRepresentativeInfo").cluetip(
 		{
 			local:"#representativeInfo"
 		});
 		
-		jQuery("#updatePatientForm").validate({
+		jQuery("#patientForm").validate({
 				 meta:"validate"
 				,errorElement:"span"
 				,submitHandler: function(form)
@@ -30,23 +30,23 @@
 					}
 				,beforeValidateHandler: function(form)
 					{
-						var dobType = $('#updatePatientForm [id=dobType]').val();
+						var dobType = $('#patientForm [id=dobType]').val();
 						
 						if( dobType=='V' || dobType=='D' ) 
 						{
-							var birthDate = $('#updatePatientForm [id=birthDate]').val();
+							var birthDate = $('#patientForm [id=birthDate]').val();
 							if( birthDate != '' ){
-								$("#updatePatientForm [id=memberValidator]").val(birthDate);
+								$("#patientForm [id=memberValidator]").val(birthDate);
 							}
 						}else{
-							var age = $('#updatePatientForm [id=age]').val();
-							$("#updatePatientForm [id=memberValidator]").val(age);
+							var age = $('#patientForm [id=age]').val();
+							$("#patientForm [id=memberValidator]").val(age);
 						}
 						
 					}
 			});
 		
-		dobTypeOnChange( 'updatePatientForm' );
+		dobTypeOnChange( 'patientForm' );
 		checkedDuplicate = false;
 		if("$!patient.dobType" == 'A'){ 
 			var i18n_please_select_relationshipType = '$encoder.jsEscape( $i18n.getString( "please_verify_birthday" ) , "'")';
@@ -59,7 +59,7 @@
 <h3>$i18n.getString( "update_patient" )</h3>
 <p><input type="button" value="$i18n.getString( 'back_to_search' )" onclick="loadPatientList();" style="width:10em"/></p>
 
-<form id="updatePatientForm" name="updatePatientForm" action="updatePatient.action" method="post" >
+<form id="patientForm" name="patientForm" action="updatePatient.action" method="post" >
 <input type="hidden" id="representativeId" name="representativeId"/> 
 <input type="hidden" id="relationshipTypeId" name="relationshipTypeId"/>
 <div>