← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11810: Add more column to display status of messages; Allow to add an non-repeatable event if it is dele...

 

------------------------------------------------------------
revno: 11810
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-08-27 15:37:17 +0700
message:
  Add more column to display status of messages; Allow to add an non-repeatable event if it is deleted in Dashboard.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackingEventMessage.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/eventMessage.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm	2013-08-01 03:02:12 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm	2013-08-27 08:37:17 +0000
@@ -12,6 +12,7 @@
 			<th class="{sorter: false}">$i18n.getString( "program_stage" )</th>
 			<th class="{sorter: false}">$i18n.getString( "sender" )</th>
 			<th class="{sorter: false}">$i18n.getString( "type" )</th>
+			<th class="{sorter: false}">$i18n.getString( "status" )</th>
 			<th class="{sorter: false}">$i18n.getString( "message" )</th>
 			<th class="{sorter: false}">$i18n.getString( "operation" )</th>
 		</tr>
@@ -25,6 +26,7 @@
 					<td>$programStageInstance.programStage.displayName</td>
 					<td>$comment.creator</td>
 					<td>$i18n.getString('comment')</td>
+					<td></td>
 					<td>$comment.commentText</td>
 					<td>
 						<a href="javascript:removeComment( '$programStageInstance.id', '$comment.id' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
@@ -39,6 +41,7 @@
 				<td>$programStageInstance.programStage.displayName</td>
 				<td>$sms.sender</td>
 				<td>$i18n.getString('message')</td>
+				<td #if( $sms.status=='ERROR') style="color:red" #end >$sms.status</td>
 				<td>$sms.message</td>
 				<td>
 					<a href="javascript:removeMessage( $programInstances.id, '', $sms.id )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
@@ -53,6 +56,7 @@
 					<td>$programStageInstance.programStage.displayName</td>
 					<td>$sms.sender</td>
 					<td>$i18n.getString('message')</td>
+					<td #if( $sms.status=='ERROR') style="color:red" #end >$sms.status</td>
 					<td>$sms.message</td>
 					<td>
 						<a href="javascript:removeMessage('', $programStageInstance.id, $sms.id )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-08-27 06:52:06 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-08-27 08:37:17 +0000
@@ -647,16 +647,17 @@
 				jQuery("#programStageIdTR_" + programInstanceId).append('<td id="arrow_' + programStageInstanceId + '"><img src="images/rightarrow.png"></td>'
 					+ '<td>'
 					+ '<div class="orgunit-object" id="org_' + programStageInstanceId + '">&nbsp;</div>'
-					+ '<input name="programStageBtn" '
-					+ 'id="' + elementId + '" ' 
-					+ 'psid="' + programStageId + '" '
-					+ 'programType="' + programType + '" '
-					+ 'psname="' + programStageName + '" '
-					+ 'dueDate="' + dueDate + '" '
-					+ 'value="'+ programStageName + '&#13;&#10;' + dueDate + '" '
-					+ 'onclick="javascript:loadDataEntry(' + programStageInstanceId + ')" '
-					+ 'type="button" class="stage-object" '
-					+ '></td>');
+						+ '<input name="programStageBtn" '
+						+ 'pi="' + programInstanceId + '" ' 
+						+ 'id="' + elementId + '" ' 
+						+ 'psid="' + programStageId + '" '
+						+ 'programType="' + programType + '" '
+						+ 'psname="' + programStageName + '" '
+						+ 'dueDate="' + dueDate + '" '
+						+ 'value="'+ programStageName + '&#13;&#10;' + dueDate + '" '
+						+ 'onclick="javascript:loadDataEntry(' + programStageInstanceId + ')" '
+						+ 'type="button" class="stage-object" '
+						+ '></td>');
 			}
 			if( jQuery('#tb_' + programInstanceId + " :input" ).length > 4 ){
 				jQuery('#tb_' + programInstanceId + ' .arrow-left').removeClass("hidden");
@@ -673,7 +674,7 @@
 			jQuery('#ps_' + programStageInstanceId ).focus();
 			var repeatable = jQuery('#repeatableProgramStage_' + programInstanceId + " [value=" + programStageId + "]" )
 			if( repeatable.attr("repeatable")=="false"){
-				repeatable.remove();
+				repeatable.css("display","none");
 			}
 			jQuery('#createNewEncounterDiv_' + programInstanceId).dialog("close");
 			resetActiveEvent(programInstanceId);
@@ -904,9 +905,14 @@
 function removeEvent( programStageInstanceId, isEvent )
 {	
     var result = window.confirm( i18n_comfirm_delete_event );
+					
     if ( result )
     {
-    	$.postJSON(
+		var eventBox = jQuery('#ps_' + programStageInstanceId);
+		var programStageId = eventBox.attr('psid');
+    	var programInstanceId = eventBox.attr('pi');
+					
+		$.postJSON(
     	    "removeCurrentEncounter.action",
     	    {
     	        "id": programStageInstanceId   
@@ -915,6 +921,8 @@
     	    { 
     	    	if ( json.response == "success" )
     	    	{
+					jQuery("#repeatableProgramStage_" + programInstanceId + " [value='" + programStageId + "']").css("display","block");
+
 					jQuery( "tr#tr" + programStageInstanceId ).remove();
 	                
 					jQuery( "table.listTable tbody tr" ).removeClass( "listRow listAlternateRow" );
@@ -928,14 +936,14 @@
 						showById('searchDiv');
 						showById('listPatientDiv');
 					}
+					
+					var id = 'ps_' + programStageInstanceId;
 					if(jQuery(".stage-object-selected").attr('id')== id)
 					{
 						hideById('entryForm');
 						hideById('executionDateTB');
 						hideById('inputCriteriaDiv');
 					}
-					var id = 'ps_' + programStageInstanceId;
-					var programInstanceId = jQuery('#' + id).attr('pi');
 					jQuery('#ps_' + programStageInstanceId).remove();
 					jQuery('#arrow_' + programStageInstanceId).remove();
 					jQuery('#org_' + programStageInstanceId).remove();

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm	2013-08-08 06:20:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm	2013-08-27 08:37:17 +0000
@@ -17,7 +17,6 @@
 							<div class="orgunit-object" id="org_$!programStageInstance.id">&nbsp;$!programStageInstance.organisationUnit.name</div>
 							<input type="button" name="programStageBtn"
 								id="ps_$!programStageInstance.id"
-								name="ps_$!programStageInstance.id"
 								pi="$programInstance.id"
 								psid="$programStageInstance.programStage.id"
 								psuid="$programStageInstance.programStage.uid"
@@ -101,16 +100,15 @@
 					#foreach( $programStage in $programInstance.program.programStages )
 						#if( $programStage.irregular=='true')
 							<option value="$programStage.id" standardInterval='$programStage.standardInterval' repeatable="true">$!programStage.displayName</option>
-						#elseif( $programStage.autoGenerateEvent=='false')
+						#else
 							#set($hasEvent="false")
 							#foreach( $programStageInstance in $programInstance.programStageInstances )
 								#if( $programStage.id== $programStageInstance.programStage.id)
 									#set($hasEvent="true")
 								#end
 							#end
-							#if($hasEvent=="false")
-								<option value="$programStage.id" standardInterval='$programStage.minDaysFromStart' repeatable="false">$!programStage.displayName</option>
-							#end
+							
+							<option #if($hasEvent=="true") style="display:none;" #end value="$programStage.id" standardInterval='$programStage.minDaysFromStart' repeatable="false">$!programStage.displayName</option>
 						#end
 					#end
 				</select>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackingEventMessage.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackingEventMessage.vm	2013-08-07 08:46:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackingEventMessage.vm	2013-08-27 08:37:17 +0000
@@ -10,6 +10,7 @@
 		<th class="{sorter: false}">$i18n.getString( "program_stage" )</th>
 		<th class="{sorter: false}">$i18n.getString( "sender" )</th>
 		<th class="{sorter: false}">$i18n.getString( "type" )</th>
+		<th class="{sorter: false}">$i18n.getString( "status" )</th>
 		<th class="{sorter: false}">$i18n.getString( "message" )</th>
 		<th class="{sorter: false}">$i18n.getString( "operation" )</th>
 	</tr>
@@ -21,6 +22,7 @@
 				<td>$encoder.htmlEncode($programStageInstance.programStage.displayName)</td>
 				<td>$encoder.htmlEncode($comment.creator)</td>
 				<td>$i18n.getString('comment')</td>
+				<td></td>
 				<td>$encoder.htmlEncode($comment.commentText)</td>
 				<td>
 					<a href="javascript:removeComment( '$programStageInstance.id', '$comment.id' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
@@ -34,6 +36,7 @@
 				<td>$encoder.htmlEncode($programStageInstance.programStage.displayName)</td>
 				<td>$encoder.htmlEncode($sms.sender)</td>
 				<td>$i18n.getString('message')</td>
+				<td #if( $sms.status=='ERROR') style="color:red" #end >$sms.status</td>
 				<td>$encoder.htmlEncode($sms.message)</td>
 				<td>
 					<a href="javascript:removeMessage('', $programStageInstance.id, $sms.id )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>