← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10902: Don't block entry form of a completed event if the blockEntryForm property of program is inactive

 

------------------------------------------------------------
revno: 10902
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-05-21 10:27:20 +0700
message:
  Don't block entry form of a completed event if the blockEntryForm property of program is inactive
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.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/webapp/dhis-web-caseentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2013-05-19 09:15:33 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2013-05-21 03:27:20 +0000
@@ -791,10 +791,10 @@
             }
 
             if ( data.program.type == '1' && data.programInstance.status == '1' ) {
-                jQuery("[id=entryFormContainer] :input").prop('disabled', true);
-                jQuery("[id=entryFormContainer] :input").datepicker("destroy");
-                jQuery("[id=executionDate]").prop('disabled', true);
-                jQuery("[id=executionDate]").datepicker("destroy");
+				var blockEntryForm = getFieldValue('blockEntryForm');
+				if( blockEntryForm == 'true' ){
+					blockEntryForm();
+				}
             }
 
             if(data.executionDate) {

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2013-05-15 09:14:57 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2013-05-21 03:27:20 +0000
@@ -338,12 +338,10 @@
 				disable('validationBtn');
 			}
 			else if( executionDate != ''){
-				if ( completed == 'false' )
-				{
+				if ( completed == 'false' ){
 					disableCompletedButton(false);
 				}
-				else if( completed == 'true' )
-				{
+				else if( completed == 'true' ){
 					disableCompletedButton(true);
 				}
 			}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java	2013-05-15 09:14:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java	2013-05-21 03:27:20 +0000
@@ -246,7 +246,7 @@
         remindCompleted = (remindCompleted == null) ? false : remindCompleted;
         disableRegistrationFields = (disableRegistrationFields == null) ? false : disableRegistrationFields;
         displayOnAllOrgunit = (displayOnAllOrgunit == null) ? false : displayOnAllOrgunit;
-
+        
         Program program = programService.getProgram( id );
         program.setName( name );
         program.setDescription( description );