← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8587: Run validation criteria of selected prgram before person enroll into the program in Enrollment form.

 

------------------------------------------------------------
revno: 8587
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-10-19 13:27:45 +0700
message:
  Run validation criteria of selected prgram before person enroll into the program in Enrollment form.
modified:
  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/patientDashboard.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.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/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2012-10-18 08:12:18 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2012-10-19 06:27:45 +0000
@@ -1304,7 +1304,7 @@
 			hideById('message');
 			var type = json.response;
 			if ( type == 'success' ){
-				saveProgramEnrollment();
+				saveEnrollment();
 			}
 			else if ( type == 'error' ){
 				setMessage( i18n_program_enrollment_failed + ':' + '\n' + message );
@@ -1317,21 +1317,6 @@
     });
 }
 
-function saveProgramEnrollment()
-{
-	$.ajax({
-		type: "POST",
-		url: 'saveProgramEnrollment.action',
-		data: getParamsForDiv('programEnrollmentSelectDiv'),
-		success: function( html ) {
-				setInnerHTML('programEnrollmentDiv', html );
-				jQuery('#enrollBtn').attr('value',i18n_update);
-				showSuccessMessage( i18n_enrol_success );
-			}
-		});
-    return false;
-}
-
 function unenrollmentForm( programInstanceId )
 {	
 	$.ajax({

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2012-10-18 08:12:18 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2012-10-19 06:27:45 +0000
@@ -94,7 +94,7 @@
 			<table id='activeTB' name='activeTB'>
 				#foreach( $programInstance in $activeProgramInstances )
 					#set($programStageInstanceId = '')
-					#if($programInstance.program.type==2)
+					#if($programInstance.program.type==1)
 						#foreach( $programStageInstance in $programInstance.programStageInstances)
 							#set($programStageInstanceId = $programStageInstance.id)
 						#end

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm	2012-09-25 14:39:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm	2012-10-19 06:27:45 +0000
@@ -8,7 +8,7 @@
 <script>
 	jQuery("#programEnrollmentSelectDiv").ready(function(){
 		validation( 'programEnrollmentSelectDiv', function(form){
-			saveEnrollment();
+			validateProgramEnrollment();
 		});
 		datePickerInRangeValid( 'dateOfIncidentField' , 'enrollmentDateField' );
 		setFieldValue("dateOfIncidentField", "");