← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5466: Update value of due-date if value of report-date is changed.

 

------------------------------------------------------------
revno: 5466
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-12-19 10:08:01 +0700
message:
  Update value of due-date if value of report-date is changed.
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/anonymousRegistration.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.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-12-16 06:45:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveExecutionDateAction.java	2011-12-19 03:08:01 +0000
@@ -181,6 +181,11 @@
             {
                 programStageInstance.setExecutionDate( dateValue );
 
+                if ( programStageInstance.getProgramInstance().getProgram().getSingleEvent() )
+                {
+                    programStageInstance.setDueDate( dateValue );
+                }
+
                 programStageInstanceService.updateProgramStageInstance( programStageInstance );
             }
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm	2011-12-16 06:45:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm	2011-12-19 03:08:01 +0000
@@ -3,9 +3,9 @@
 	
 <div id="actions">	
 	<input type="button" id="createEventBtn" value="$i18n.getString('create_new_event')" onClick="javascript: createNewEvent();" style="width:12em " disabled="disabled">
+	<input type="button" id="validationBtn" value="$i18n.getString('run_validation')" onClick="javascript: runValidation();" style="width:12em " disabled="disabled" >
+	<input type="button" id="completeBtn" value="$i18n.getString('complete')" onClick="doComplete(); afterCompleteStage()" style="width:12em" disabled="disabled" >
 	<input type="button" id="deleteCurrentEventBtn" value="$i18n.getString('delete_current_event')" onClick="javascript: deleteCurrentEvent();" style="width:12em " disabled="disabled" >
-	<input type="button" id="completeBtn" value="$i18n.getString('complete')" onClick="doComplete(); afterCompleteStage()" style="width:12em" disabled="disabled" >
-	<input type="button" id="validationBtn" value="$i18n.getString('run_validation')" onClick="javascript: runValidation();" style="width:12em " disabled="disabled" >
 </div>	
 			
 <div id="dataRecordingSelectDiv" class="inputCriteria" style="width:420px;height:80px;">

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2011-12-16 06:45:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2011-12-19 03:08:01 +0000
@@ -54,6 +54,9 @@
 				enable('executionDate');
 				enable('createEventBtn');
 				disable('deleteCurrentEventBtn');
+				disable('completeBtn');
+				disable('validationBtn');
+				
 				hideById('loaderDiv');
 			}
 			
@@ -77,6 +80,7 @@
 				enable('createEventBtn');
 				disable('deleteCurrentEventBtn');
 				disable('completeBtn');
+				disable('validationBtn');
 				
 				$('#executionDate').change(function() {
 					saveExecutionDate( getFieldValue('programStageId'), getFieldValue('executionDate') );
@@ -90,6 +94,7 @@
 					enable('createEventBtn');
 					enable('deleteCurrentEventBtn');
 					disable('completeBtn');
+					disable('validationBtn');
 				} 
 				else
 				{
@@ -97,7 +102,7 @@
 					disable('createEventBtn');
 					enable('deleteCurrentEventBtn');
 					enable('completeBtn');
-					
+					enable('validationBtn');
 					
 					$('#executionDate').change(function() {
 						saveExecutionDate( getFieldValue('programStageId'), getFieldValue('executionDate') );
@@ -167,5 +172,4 @@
 function afterCompleteStage()
 {
 	enable('createEventBtn');
-	disable('createEventBtn');
 }
\ No newline at end of file