← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6262: (patient) Use datePickerInRange method insteads of validate of incident-date and enrollment-date.

 

------------------------------------------------------------
revno: 6262
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-03-14 09:44:43 +0700
message:
  (patient) Use datePickerInRange method insteads of validate of incident-date and enrollment-date.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ValidatePatientProgramEnrollmentAction.java
  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/java/org/hisp/dhis/caseentry/action/patient/ValidatePatientProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ValidatePatientProgramEnrollmentAction.java	2012-01-11 07:19:34 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ValidatePatientProgramEnrollmentAction.java	2012-03-14 02:44:43 +0000
@@ -27,8 +27,6 @@
 
 package org.hisp.dhis.caseentry.action.patient;
 
-import java.util.Date;
-
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.patient.Patient;
@@ -89,20 +87,6 @@
         this.programId = programId;
     }
 
-    private String enrollmentDate;
-
-    public void setEnrollmentDate( String enrollmentDate )
-    {
-        this.enrollmentDate = enrollmentDate;
-    }
-
-    private String dateOfIncident;
-
-    public void setDateOfIncident( String dateOfIncident )
-    {
-        this.dateOfIncident = dateOfIncident;
-    }
-
     private String message;
 
     public String getMessage()
@@ -160,18 +144,6 @@
             return INPUT;
         }
 
-        Date DateOfEnrollment = format.parseDate( enrollmentDate );
-
-        Date DateOfIncident = format.parseDate( dateOfIncident );
-
-        if ( DateOfEnrollment.before( DateOfIncident ) )
-        {
-            message = program.getDateOfEnrollmentDescription() + " "
-                + i18n.getString( "have_to_be_greater_or_equals_to" ) + " " + program.getDateOfIncidentDescription();
-
-            return INPUT;
-
-        }
         message = i18n.getString( "everything_is_ok" );
 
         return SUCCESS;

=== 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-02-27 08:39:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm	2012-03-14 02:44:43 +0000
@@ -101,6 +101,8 @@
 			validation( 'programEnrollmentSelectDiv', function(form){
                 validateProgramEnrollment();
             });
+			
+			datePickerInRange( 'dateOfIncident' , 'enrollmentDate' );
 		}); 
 	
 	jQuery("#tabs").tabs();