← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4759: Exception thrown when clicking on Completed button for single-event program.

 

------------------------------------------------------------
revno: 4759
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-09-29 13:46:04 +0700
message:
  Exception thrown when clicking on Completed button for single-event program.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveExecutionDateAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.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/java/org/hisp/dhis/caseentry/action/caseentry/SaveExecutionDateAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveExecutionDateAction.java	2011-09-14 06:36:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveExecutionDateAction.java	2011-09-29 06:46:04 +0000
@@ -118,6 +118,13 @@
         this.programStageId = programStageId;
     }
 
+    private String message;
+
+    public String getMessage()
+    {
+        return message;
+    }
+
     // -------------------------------------------------------------------------
     // Implementation Action
     // -------------------------------------------------------------------------
@@ -131,7 +138,7 @@
         {
             // Get program-stage-instance of the patient
             ProgramStageInstance programStageInstance = selectedStateManager.getSelectedProgramStageInstance();
-            
+
             // If the program-stage-instance of the patient not exists,
             // create a program-instance and program-stage-instance for
             // single-event program
@@ -176,9 +183,11 @@
 
                 programStageInstanceService.updateProgramStageInstance( programStageInstance );
             }
-            
+
             LOG.debug( "Updating Execution Date, value added/changed" );
 
+            message = programStageInstance.getId() + "";
+            
             return SUCCESS;
         }
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm	2011-09-29 05:59:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm	2011-09-29 06:46:04 +0000
@@ -20,7 +20,7 @@
 
 <div id='entryFormContainer'>
 <input type='hidden' id='incidentDate' value='$!format.formatDate($programStageInstance.programInstance.dateOfIncident)'>
-<input type='hidden' name='programStageInstanceId' id='programStageInstanceId' value='$!programStageInstance.id'>
+<input type='text' name='programStageInstanceId' id='programStageInstanceId' value='$!programStageInstance.id'>
 <hr style="clear:both">
 
 <span id="startMsg" style="font-style:italic; color:blue; display: #if($!programStageInstance.executionDate!='') none #else block #end;">$i18n.getString( "report_date_warning" )</span>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js	2011-09-29 05:59:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js	2011-09-29 06:46:04 +0000
@@ -726,6 +726,7 @@
         if ( codeElement == 'success' )
         {
             markValue( resultColor );
+			setFieldValue('programStageInstanceId',rootElement.firstChild.nodeValue);
 			showById('entryFormContainer');
 			showById('dataEntryFormDiv');
 			showById('entryForm');