← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10539: disable comments if offline, add status to getProgramStageInstanceAction

 

------------------------------------------------------------
revno: 10539
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2013-04-13 14:47:02 +0700
message:
  disable comments if offline, add status to getProgramStageInstanceAction
modified:
  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/anonymousRegistration.js
  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/jsonProgramStageInstance.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/webapp/dhis-web-caseentry/dataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm	2013-04-13 07:25:47 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm	2013-04-13 07:47:02 +0000
@@ -37,7 +37,7 @@
 		<tr>
 			<th class='coordinates1'><label for="postComment">$i18n.getString('post_comment'):</label></th>
 			<th colspan='3'>
-				<input type="text" class="{validate:{maxlength:160}} criteria"
+				<input type="text" class="{validate:{maxlength:160}} criteria" id="commentInput"
                         style="width:430px;#if($programStageInstance.programStage.captureCoordinates=='false') margin-left:10px; #end "
                        onkeypress="keypressOnComment( event, this );">
 			</th>
@@ -81,7 +81,7 @@
 	#end
 </div>
 
-<div id='inputCriteriaDiv' class="page inputCriteria #if($programStageInstance.executionDate) #else hidden #end " style="width:490px;height:29px;">	
+<div id='inputCriteriaDiv' class="page inputCriteria hidden" style="width:490px;height:29px;">
 	<input type="button" class='button' id="completeBtn" value="$i18n.getString('complete')" onClick="doComplete()" disabled="disabled">
 	<input type="button" id="uncompleteBtn" value="$i18n.getString('incomplete')" onclick="doUnComplete()" disabled="disabled">
 	<input type="button" class='button' id="validationBtn" value="$i18n.getString('run_validation')" onClick="javascript: runValidation();" disabled="disabled">

=== 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	2013-04-13 06:52:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2013-04-13 07:47:02 +0000
@@ -88,10 +88,13 @@
             setHeaderMessage( form );
             ajax_login();
         }
+
+        $('#commentInput').removeAttr('disabled');
     } );
 
     $( document ).bind( 'dhis2.offline', function () {
         setHeaderMessage( i18n_offline_notification );
+        $('#commentInput').attr('disabled', true);
     } );
 
     dhis2.availability.startAvailabilityCheck();

=== 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-04-13 07:22:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2013-04-13 07:47:02 +0000
@@ -658,6 +658,7 @@
 
         if(data.executionDate) {
             $( '#entryForm' ).removeClass( 'hidden' ).addClass( 'visible' );
+            $( '#inputCriteriaDiv' ).removeClass( 'hidden' );
         }
 
         if ( data.programStage.captureCoordinates ) {
@@ -678,6 +679,8 @@
                 $( '#commentTB' ).append( comment )
             });
         }
+    } ).fail(function() {
+        $('#commentInput').attr('disabled', true)
     });
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageInstance.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageInstance.vm	2013-04-13 06:52:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageInstance.vm	2013-04-13 07:47:02 +0000
@@ -49,6 +49,7 @@
 
     "programInstance": {
         "id": "$!programStageInstance.programInstance.id",
-        "dateOfIncident": "$format.formatDate( $!programStageInstance.programInstance.dateOfIncident )"
+        "dateOfIncident": "$format.formatDate( $!programStageInstance.programInstance.dateOfIncident )",
+        "status": "$format.formatDate( $!programStageInstance.programInstance.status )"
     }
 }