← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8175: Minor fix for event flow in dashboard.

 

------------------------------------------------------------
revno: 8175
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-09-21 15:30:28 +0700
message:
  Minor fix for event flow in dashboard.
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/programStageInstanceFlow.vm
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/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/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 06:25:25 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2012-09-21 08:30:28 +0000
@@ -615,7 +615,9 @@
 				var dueDateInStage = element.attr('dueDate');
 				if( dueDate < dueDateInStage && !flag)
 				{	
-					jQuery('<td><input name="programStageBtn" '
+					jQuery('<td style="text-align:center">'
+						+ '<span id="org_' + programStageInstanceId + '">' + getFieldValue('orgunitName') + '</span>'
+						+ '<input name="programStageBtn" '
 						+ 'id="' + elementId + '" ' 
 						+ 'psid="' + programStageId + '" '
 						+ 'programType="' + programType + '" '
@@ -625,7 +627,7 @@
 						+ 'onclick="javascript:loadDataEntry(' + programStageInstanceId + ')" '
 						+ 'type="button" class="stage-object" '
 						+ '></td>'
-						+ '<td><img src="images/rightarrow.png"></td>')
+						+ '<td id="arrow_' + programStageInstanceId + '"><img src="images/rightarrow.png"></td>')
 					.insertBefore(element.parent());
 					flag = true;
 				}
@@ -968,8 +970,10 @@
 					var programInstanceId = jQuery('#ps_' + programStageInstanceId).attr('programInstanceId');
 					jQuery('#ps_' + programStageInstanceId).remove();
 					jQuery('#arrow_' + programStageInstanceId).remove();
+					jQuery('#org_' + programStageInstanceId).remove();
 					reloadOneRecord( programInstanceId );
 					showSuccessMessage( i18n_delete_success );
+					resize();
     	    	}
     	    	else if ( json.response == "error" )
     	    	{ 

=== 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	2012-09-21 07:44:44 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm	2012-09-21 08:30:28 +0000
@@ -8,7 +8,7 @@
 				<table class="table-flow">											
 					<tr id='programStageIdTR_$!programInstance.id'>
 						#foreach( $programStageInstance in $programInstance.programStageInstances )
-						<td style='font-size:25px;'>&rarr;</td>
+						<td id='arrow_$programStageInstance.id' style='font-size:25px;'>&rarr;</td>
 						<td style='text-align:center'>
 							#set($valueDate=$format.formatDate( $programStageInstance.dueDate ))
 							#if($!programStageInstance.executionDate)
@@ -65,7 +65,7 @@
 			<td>$i18n.getString( 'due_date' )</td>
 			<td><input id='dueDateNewEncounter_$programInstance.id' name='dueDateNewEncounter_$!programInstance.id' style='width:260px;'></td>
 			<script type="text/javascript">
-			   datePicker( 'dueDateNewEncounter_$programInstance.id', false );
+			   datePickerFuture( 'dueDateNewEncounter_$programInstance.id', false );
 			</script>
 		</tr>
 		<tr>

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2012-09-12 15:36:17 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js	2012-09-21 08:30:28 +0000
@@ -930,6 +930,36 @@
 	}
 }
 
+function datePickerFuture( id, today )
+{
+	jQuery("#" + id).datepicker(
+	{
+		dateFormat: dateFormat,
+		changeMonth: true,
+		changeYear: true,
+		monthNamesShort: monthNames,
+		dayNamesMin: dayNamesMin,
+		showOn: 'both',
+		buttonImage: '../images/calendar.png',
+		buttonImageOnly: true,
+		minDate: '+0d +0w',
+		constrainInput: true,
+        yearRange: '-100:+100'
+	});
+	jQuery( "#" + id ).attr("readonly", true );
+	
+	if ( today == undefined )
+	{
+		today = false;
+	}
+	
+	if( today )
+	{
+		s = jQuery("#" + id );
+		if( s.val()=='' ) s.val( getCurrentDate() );
+	}
+}
+
 /**
  * Create jQuery datepicker for start date and end date text with id
  *