← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16165: Allow to enter enrollment-date and incident-date when TEI enrolls into single event with registra...

 

------------------------------------------------------------
revno: 16165
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-07-18 11:16:17 +0700
message:
  Allow to enter enrollment-date and incident-date when TEI enrolls into single event with registration program.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.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-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	2014-07-12 12:11:56 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2014-07-18 04:16:17 +0000
@@ -1035,34 +1035,29 @@
 	} else {
 		var type = $('#enrollmentDiv [name=programId] option:selected').attr(
 				'programType')
-		if (type == '2') {
-			hideById('enrollmentDateTR');
+		
+		showById('enrollmentDateTR');
+		enable('enrollmentDateField');
+		var dateOfEnrollmentDescription = $(
+				'#enrollmentDiv [name=programId] option:selected').attr(
+				'dateOfEnrollmentDescription');
+		var dateOfIncidentDescription = $(
+				'#enrollmentDiv [name=programId] option:selected').attr(
+				'dateOfIncidentDescription');
+		setInnerHTML('enrollmentDateDescription',
+				dateOfEnrollmentDescription);
+		setInnerHTML('dateOfIncidentDescription', dateOfIncidentDescription);
+		var displayIncidentDate = $(
+				'#enrollmentDiv [name=programId] option:selected').attr(
+				'displayIncidentDate');
+		if (displayIncidentDate == 'true') {
+			showById('dateOfIncidentTR');
+			enable('dateOfIncidentField');
+		} else {
 			hideById('dateOfIncidentTR');
-			disable('enrollmentDateField');
 			disable('dateOfIncidentField');
-		} else {
-			showById('enrollmentDateTR');
-			enable('enrollmentDateField');
-			var dateOfEnrollmentDescription = $(
-					'#enrollmentDiv [name=programId] option:selected').attr(
-					'dateOfEnrollmentDescription');
-			var dateOfIncidentDescription = $(
-					'#enrollmentDiv [name=programId] option:selected').attr(
-					'dateOfIncidentDescription');
-			setInnerHTML('enrollmentDateDescription',
-					dateOfEnrollmentDescription);
-			setInnerHTML('dateOfIncidentDescription', dateOfIncidentDescription);
-			var displayIncidentDate = $(
-					'#enrollmentDiv [name=programId] option:selected').attr(
-					'displayIncidentDate');
-			if (displayIncidentDate == 'true') {
-				showById('dateOfIncidentTR');
-				enable('dateOfIncidentField');
-			} else {
-				hideById('dateOfIncidentTR');
-				disable('dateOfIncidentField');
-			}
 		}
+		
 		var program = $('#programEnrollmentSelectDiv [id=programId] option:selected');
 		$('#identifierAndAttributeDiv')
 				.load("getAttribute.action", {