← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9104: Add date-picker for date fields in patient form.

 

------------------------------------------------------------
revno: 9104
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-11-22 21:44:01 +0700
message:
  Add date-picker for date fields in patient form.
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/commons.js
  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/patientForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/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-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm	2012-10-12 03:37:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm	2012-11-22 14:44:01 +0000
@@ -31,6 +31,7 @@
 		
 		datePickerValid( 'patientForm [id=registrationDate]' );
 		datePickerValid( 'patientForm [id=birthDate]' );
+		datePickerValid( 'patientForm [id=deathDate]' );
 		addEventForPatientForm( 'patientForm' );
 	});	
 	hideById('patientForm [id=age]');

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2012-11-15 04:44:29 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2012-11-22 14:44:01 +0000
@@ -289,6 +289,7 @@
 function isDeathOnChange()
 {
 	var isDeath = byId('isDead').checked;
+	setFieldValue('deathDate','');
 	if(isDeath)
 	{
 		showById('deathDateTR');
@@ -1128,6 +1129,11 @@
 			function(){
 				$('#patientForm [id=birthDate]').attr('id','birthDate_id');
 				$('#patientForm [id=birthDate_id]').attr('name','birthDate_id');
+				
+				$('#patientForm [id=registrationDate]').attr('id','registrationDate_id');
+				$('#patientForm [id=registrationDate_id]').attr('name','registrationDate_id');
+				
+				datePickerValid( 'representativeDiv [id=registrationDate]' );
 			}).dialog({
 			title: i18n_child_representative,
 			maximize: true, 
@@ -1140,6 +1146,9 @@
 			{
 				$('#patientForm [id=birthDate_id]').attr('id','birthDate');
 				$('#patientForm [id=birthDate]').attr('name','birthDate');
+				
+				$('#patientForm [id=registrationDate_id]').attr('id','registrationDate');
+				$('#patientForm [id=registrationDate]').attr('name','registrationDate');
 			}
 		});
 	}else

=== 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	2012-11-14 09:07:24 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-11-22 14:44:01 +0000
@@ -137,7 +137,6 @@
       data: getParamsForDiv('patientForm'),
       success: function(json) {
 		var patientId = json.message.split('_')[0];
-		jQuery('#resultSearchDiv').dialog('close');
 		showPatientDashboardForm( patientId );
       }
      });

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2012-11-22 03:15:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2012-11-22 14:44:01 +0000
@@ -97,7 +97,7 @@
 
 <!-- DEAD -->
 
-<tr>
+<tr id="deathCheckboxTR">
 	<td class='text-column'>$i18n.getString("is_dead")</td>
 	<td>
 		<input type="checkbox" name="isDead" id="isDead" value="true" #if($!patient.isDead) checked="checked" #end onchange='isDeathOnChange();'/>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/underAgeForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/underAgeForm.vm	2012-10-03 07:06:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/underAgeForm.vm	2012-11-22 14:44:01 +0000
@@ -40,6 +40,7 @@
 				}
 		});
 		datePickerValid( 'addRepresentativeForm [id=birthDate]' );
+		hideById('addRepresentativeForm [id=deathCheckboxTR]');
 	}); 
 	
 	jQuery("#addRepresentativeTabs").tabs();