← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8191: Allow to delete incomplete stage instances.

 

------------------------------------------------------------
revno: 8191
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2012-09-22 20:08:09 +0700
message:
  Allow to delete incomplete stage instances.
modified:
  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/relationshipPatient.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.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/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2012-09-21 08:30:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2012-09-22 13:08:09 +0000
@@ -615,7 +615,7 @@
 				var dueDateInStage = element.attr('dueDate');
 				if( dueDate < dueDateInStage && !flag)
 				{	
-					jQuery('<td style="text-align:center">'
+					jQuery('<td>'
 						+ '<span id="org_' + programStageInstanceId + '">' + getFieldValue('orgunitName') + '</span>'
 						+ '<input name="programStageBtn" '
 						+ 'id="' + elementId + '" ' 
@@ -636,7 +636,9 @@
 			if( !flag )
 			{
 				jQuery("#programStageIdTR_" + programInstanceId).append('<td><img src="images/rightarrow.png"></td>'
-					+ '<td><input name="programStageBtn" '
+					+ '<td>'
+					+ '<span id="org_' + programStageInstanceId + '">' + getFieldValue('orgunitName') + '</span>'
+					+ '<input name="programStageBtn" '
 					+ 'id="' + elementId + '" ' 
 					+ 'psid="' + programStageId + '" '
 					+ 'programType="' + programType + '" '
@@ -934,6 +936,12 @@
 		{
 			jQuery('#ps_' + programStageInstanceId).attr('status',field.value);
 			setEventColorStatus( programStageInstanceId, field.value );
+			if( status==1){
+				hideById('del_' + programStageInstanceId);
+			}
+			else{
+				showById('del_' + programStageInstanceId);
+			}
 			field.style.backgroundColor = SUCCESS_COLOR;
 		} );
 }
@@ -967,10 +975,18 @@
 						showById('searchDiv');
 						showById('listPatientDiv');
 					}
-					var programInstanceId = jQuery('#ps_' + programStageInstanceId).attr('programInstanceId');
+					var id = 'ps_'+programStageInstanceId;
+					var programInstanceId = jQuery('#' + id).attr('programInstanceId');
+					if(jQuery(".stage-object-selected").attr('id')== id)
+					{
+						hideById('entryForm');
+						hideById('executionDateTB');
+						hideById('inputCriteriaDiv');
+					}
 					jQuery('#ps_' + programStageInstanceId).remove();
 					jQuery('#arrow_' + programStageInstanceId).remove();
 					jQuery('#org_' + programStageInstanceId).remove();
+					
 					reloadOneRecord( programInstanceId );
 					showSuccessMessage( i18n_delete_success );
 					resize();

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/relationshipPatient.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/relationshipPatient.js	2012-09-20 14:02:14 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/relationshipPatient.js	2012-09-22 13:08:09 +0000
@@ -28,6 +28,7 @@
 			var irregular = jQuery('#entryFormContainer input[id=irregular]').val();
 			var reportDateDes = jQuery("#ps_" + programStageInstanceId).attr("reportDateDes");
 			setInnerHTML('reportDateDescriptionField',reportDateDes);
+			showById('entryForm');
 			showById('executionDateTB');
 			showById('inputCriteriaDiv');
 			enable('validationBtn');

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm	2012-09-21 08:51:58 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm	2012-09-22 13:08:09 +0000
@@ -96,8 +96,8 @@
 			</td>
 			
 			<td>
-				#if($programStageInstance.programStage.irregular=='true' && ($status==3 || $status==4 || $status==5 ))
-					<a href="javascript:removeEvent($programStageInstance.id, false)" title='$i18n.getString( "remove" )'><img src="../images/delete.png" alt='$i18n.getString( "remove" )'></a>
+				#if($programStageInstance.programStage.irregular=='true' )
+					<a href="javascript:removeEvent($programStageInstance.id, false)" title='$i18n.getString( "remove" )'><img src="../images/delete.png" id='del_$programStageInstance.id' name='del_$programStageInstance.id' alt='$i18n.getString( "remove" )' #if($status==1) class='hidden' #end ></a>
 				#end
 			</td>
 		</tr>