← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11384: Fix bug - Error when to click Complete event/program button.

 

------------------------------------------------------------
revno: 11384
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-07-12 09:46:16 +0700
message:
  Fix bug - Error when to click Complete event/program button.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SetProgramInstanceStatusAction.java


--
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/caseentry/CompleteDataEntryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.java	2013-07-02 14:26:44 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CompleteDataEntryAction.java	2013-07-12 02:46:16 +0000
@@ -213,20 +213,14 @@
         if ( patient != null )
         {
             Collection<PatientReminder> reminders = programStageInstance.getProgramStage().getPatientReminders();
-            PatientReminder reminder = null;
             for ( PatientReminder rm : reminders )
             {
-                if ( rm.getWhenToSend() == PatientReminder.SEND_WHEN_TO_C0MPLETED_EVENT )
+                if ( rm != null && rm.getWhenToSend() == PatientReminder.SEND_WHEN_TO_C0MPLETED_EVENT )
                 {
-                    reminder = rm;
+                    sendEventMessage( rm, programStageInstance, patient );
                     break;
                 }
             }
-
-            if ( reminder != null )
-            {
-                sendEventMessage( reminder, programStageInstance, patient );
-            }
         }
     }
 
@@ -282,20 +276,14 @@
         if ( patient != null )
         {
             Collection<PatientReminder> reminders = programInstance.getProgram().getPatientReminders();
-            PatientReminder reminder = null;
             for ( PatientReminder rm : reminders )
             {
-                if ( rm.getWhenToSend() == PatientReminder.SEND_WHEN_TO_C0MPLETED_EVENT )
+                if ( rm != null && rm.getWhenToSend() == PatientReminder.SEND_WHEN_TO_C0MPLETED_EVENT )
                 {
-                    reminder = rm;
+                    sendProgramMessage( rm, programInstance, patient );
                     break;
                 }
             }
-
-            if ( reminder != null )
-            {
-                sendProgramMessage( reminder, programInstance, patient );
-            }
         }
     }
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SetProgramInstanceStatusAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SetProgramInstanceStatusAction.java	2013-07-02 14:26:44 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SetProgramInstanceStatusAction.java	2013-07-12 02:46:16 +0000
@@ -210,20 +210,14 @@
         if ( patient != null )
         {
             Collection<PatientReminder> reminders = programInstance.getProgram().getPatientReminders();
-            PatientReminder reminder = null;
             for ( PatientReminder rm : reminders )
             {
                 if ( rm.getWhenToSend() == PatientReminder.SEND_WHEN_TO_C0MPLETED_PROGRAM )
                 {
-                    reminder = rm;
+                    sendProgramMessage( rm, programInstance, patient );
                     break;
                 }
             }
-
-            if ( reminder != null )
-            {
-                sendProgramMessage( reminder, programInstance, patient );
-            }
         }
     }