← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9580: Add popup window for confirmation if a program is completed.

 

------------------------------------------------------------
revno: 9580
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-01-23 10:23:02 +0700
message:
  Add popup window for confirmation if a program is completed.
added:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/node-select-child.png
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.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/resources/org/hisp/dhis/caseentry/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2013-01-22 07:56:19 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2013-01-23 03:23:02 +0000
@@ -377,7 +377,7 @@
 stages_skipped = Stages is skipped
 value_is_invalid = Value is invalid
 value_is_valid = Value is valid
-incomplete_confirm_message=Are you sure this event is incomplete?
+incomplete_confirm_message=Are you sure that you want to mark as completed for this program ?
 incomplete = Incomplete
 remove_empty_events_success = Removed empty events successfully
 confirm_remove_empty_events = Are you sure you want to remove empty events?

=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/node-select-child.png'
Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/node-select-child.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/node-select-child.png	2013-01-23 03:23:02 +0000 differ
=== 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-01-08 04:25:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-01-23 03:23:02 +0000
@@ -1354,28 +1354,31 @@
 
 function unenrollmentForm( programInstanceId )
 {	
-	$.ajax({
-		type: "POST",
-		url: 'removeEnrollment.action',
-		data: "programInstanceId=" + programInstanceId,
-		success: function( json ) 
-		{
-			var completed  = "<tr onclick='javascript:loadActiveProgramStageRecords(" + programInstanceId + ");' >";
-				completed += "<td><a><span id='infor_" + programInstanceId + "'>" + jQuery('#tr1_' + programInstanceId + " span" ).html() + "</span></a></td></tr>";
-			jQuery('#completedTB' ).prepend( completed );
-			jQuery('#tr1_' + programInstanceId ).remove();
-			jQuery('#tr2_' + programInstanceId ).remove();
-			
-			jQuery("[id=tab-2] :input").prop('disabled', true);
-			jQuery("[id=tab-3] :input").prop('disabled', true);
-			jQuery("[id=tab-4] :input").prop('disabled', true);
-			jQuery("[id=tab-5] :input").prop('disabled', true);
-			jQuery("[id=tab-3] :input").datepicker("destroy");
-			
-			showSuccessMessage( i18n_unenrol_success );
-		}
-    });
+	if( confirm(i18n_incomplete_confirm_message) )
+	{
+		$.ajax({
+			type: "POST",
+			url: 'removeEnrollment.action',
+			data: "programInstanceId=" + programInstanceId,
+			success: function( json ) 
+			{
+				var completed  = "<tr onclick='javascript:loadActiveProgramStageRecords(" + programInstanceId + ");' >";
+					completed += "<td><a><span id='infor_" + programInstanceId + "'>" + jQuery('#tr1_' + programInstanceId + " span" ).html() + "</span></a></td></tr>";
+				jQuery('#completedTB' ).prepend( completed );
+				jQuery('#tr1_' + programInstanceId ).remove();
+				jQuery('#tr2_' + programInstanceId ).remove();
+				
+				jQuery("[id=tab-2] :input").prop('disabled', true);
+				jQuery("[id=tab-3] :input").prop('disabled', true);
+				jQuery("[id=tab-4] :input").prop('disabled', true);
+				jQuery("[id=tab-5] :input").prop('disabled', true);
+				jQuery("[id=tab-3] :input").datepicker("destroy");
+				
+				showSuccessMessage( i18n_unenrol_success );
+			}
+		});
 	
+	}
 	
 }