← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9072: Minor fix for program tracking.

 

------------------------------------------------------------
revno: 9072
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-11-16 12:08:24 +0700
message:
  Minor fix for program tracking.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.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/smsReminder.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js	2012-11-14 09:07:24 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js	2012-11-16 05:08:24 +0000
@@ -288,6 +288,7 @@
 		status = 4;
 	}
 	
+	var paddingIndex = 1;
 	jQuery("#patientList .stage-object").each( function(){
 		var id = this.id.split('_')[1];
 		var dueDate = jQuery(this).attr('dueDate');
@@ -296,10 +297,17 @@
 		if( dueDate >= startDate && dueDate <= endDate && statusEvent == status )
 		{
 			if( jQuery("#tb_" + programInstanceId + " .searched").length > 0 ){
-				jQuery("#ps_" + id ).addClass("stage-object-selected searched");
 				hideById('arrow_' + id );
 				hideById("ps_" + id );
 			}
+			else
+			{
+				jQuery("#arrow_" + id ).addClass("displayed");
+				var index = eval(jQuery("#ps_" + id ).attr("index"));
+				if( paddingIndex < index ){
+					 paddingIndex = index;
+				}
+			}
 			jQuery("#ps_" + id ).addClass("stage-object-selected searched");
 		}
 		else
@@ -308,6 +316,15 @@
 			hideById('ps_' + id );
 		}
 	});
+	
+	jQuery("[id^=arrow_].displayed" ).each( function(){
+		var id = this.id.split('_')[1];
+		var index = eval(jQuery("#ps_" + id ).attr("index"));
+		if( index<paddingIndex){
+			var paddingLeft = ( paddingIndex - index ) * 20;
+			jQuery(this).css("padding-left", paddingLeft + "px");
+		}
+	});
 }
 
 function reloadOneRecord( programInstanceId )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm	2012-10-22 07:32:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm	2012-11-16 05:08:24 +0000
@@ -59,7 +59,9 @@
 										<table class="table-flow">
 										<tr>
 										#set( $flag = "false" )
+										#set( $idx = 0)
 										#foreach( $programStageInstance in $programStageInstances )
+											#set( $idx = $idx + 1)
 											<td id="arrow_$programStageInstance.id" style='font-size:25px;'>&rarr;</td>
 											<td id="td_$programStageInstance.id">
 												#set($title="")
@@ -74,7 +76,8 @@
 												#set($valueDate=$format.formatDate( $programStageInstance.dueDate ))
 												#if($!programStageInstance.executionDate)
 													#set($valueDate=$format.formatDate( $programStageInstance.executionDate ))
-												#end												
+												#end
+$idx<br>												
 												<input type='button' id='ps_$programStageInstance.id' name='programStageBtn' 
 													programStageInstanceId='$programStageInstance.id' 
 													programStageName='$programStageInstance.programStage.name' 
@@ -82,6 +85,7 @@
 													programInstanceId='$programInstance.id'
 													dueDate='$format.formatDate( $programStageInstance.dueDate )'
 													status='$programStageInstance.getEventStatus()'
+													index="$idx"
 													class='stage-object'
 													value='$programStageInstance.programStage.name&#13;&#10;$valueDate' 
 													title="$title" onclick='javascript:programTrackingList( $programStageInstance.id, false );'>
@@ -119,8 +123,8 @@
 #end
 
 <script>
-	reloadRecordList();
 	$(window).bind('resize', function(e){ 
 		resize();
 	});
+	reloadRecordList();
 </script>
\ No newline at end of file