dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20708
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9604: Crash when enrolling in a non auto-generated event.
------------------------------------------------------------
revno: 9604
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-01-24 20:37:59 +0700
message:
Crash when enrolling in a non auto-generated event.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveProgramEnrollmentAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.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/SaveProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveProgramEnrollmentAction.java 2013-01-17 07:31:43 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SaveProgramEnrollmentAction.java 2013-01-24 13:37:59 +0000
@@ -201,7 +201,7 @@
Date dueDate = DateUtils
.getDateAfterAddition( dateCreatedEvent, programStage.getMinDaysFromStart() );
- if ( !program.getIgnoreOverdueEvents() || !dueDate.before( currentDate ) )
+ if ( ! ( program.getIgnoreOverdueEvents() && dueDate.before( currentDate ) ))
{
ProgramStageInstance programStageInstance = new ProgramStageInstance();
programStageInstance.setProgramInstance( programInstance );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java 2013-01-23 04:48:39 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java 2013-01-24 13:37:59 +0000
@@ -195,7 +195,7 @@
generateBydEnrollmentDate = (generateBydEnrollmentDate == null) ? false : generateBydEnrollmentDate;
ignoreOverdueEvents = (ignoreOverdueEvents == null) ? false : ignoreOverdueEvents;
blockEntryForm = (blockEntryForm == null) ? false : blockEntryForm;
-
+
Program program = new Program();
program.setName( name );
@@ -206,9 +206,17 @@
program.setType( type );
program.setDisplayProvidedOtherFacility( displayProvidedOtherFacility );
program.setDisplayIncidentDate( displayIncidentDate );
- program.setGeneratedByEnrollmentDate( generateBydEnrollmentDate );
- program.setIgnoreOverdueEvents( ignoreOverdueEvents );
program.setBlockEntryForm( blockEntryForm );
+ if ( type == Program.MULTIPLE_EVENTS_WITH_REGISTRATION )
+ {
+ program.setGeneratedByEnrollmentDate( generateBydEnrollmentDate );
+ program.setIgnoreOverdueEvents( ignoreOverdueEvents );
+ }
+ else
+ {
+ program.setGeneratedByEnrollmentDate( true );
+ program.setIgnoreOverdueEvents( false );
+ }
List<PatientIdentifierType> identifierTypes = new ArrayList<PatientIdentifierType>();
List<PatientAttribute> patientAttributes = new ArrayList<PatientAttribute>();
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js 2013-01-23 10:27:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js 2013-01-24 13:37:59 +0000
@@ -63,6 +63,7 @@
disable("dateOfIncidentDescription");
disable("generatedByEnrollmentDate");
disable("availablePropertyIds");
+ disable('ignoreOverdueEvents');
hideById("selectedList");
jQuery("[name=displayed]").attr("disabled", true);
jQuery("[name=displayed]").removeAttr("checked");
@@ -74,6 +75,11 @@
enable("generatedByEnrollmentDate");
enable('dateOfEnrollmentDescription');
enable("displayIncidentDate");
+ enable('ignoreOverdueEvents');
+ if( type == 2 ){
+ disable('ignoreOverdueEvents');
+ }
+
if(byId('displayIncidentDate').checked){
enable("dateOfIncidentDescription");
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm 2013-01-23 10:27:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramForm.vm 2013-01-24 13:37:59 +0000
@@ -64,7 +64,7 @@
<tr>
<td><label>$i18n.getString( "generated_events_by_enrollment_date" )</label></td>
- <td><input type="checkbox" id="generatedByEnrollmentDate" name="generatedByEnrollmentDate" value='true' #if($program.generatedByEnrollmentDate=='true') checked #end #if( $program.type=='3' ) disabled #end ></td>
+ <td><input type="checkbox" id="generatedByEnrollmentDate" name="generatedByEnrollmentDate" value='true' #if($program.generatedByEnrollmentDate=='true') checked #end #if( $program.type!='1' ) disabled #end ></td>
<td></td>
</tr>