← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8052: Improve the event flow UI.

 

------------------------------------------------------------
revno: 8052
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-09-12 20:36:55 +0700
message:
  Improve the event flow UI.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java
  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/patient.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/report.js
  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/menu.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm
  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/programTrackingRecords.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css


--
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/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java	2012-09-06 02:31:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java	2012-09-12 13:36:55 +0000
@@ -195,7 +195,15 @@
         // List all patients
         if ( listAll )
         {
-            total = patientService.countGetPatientsByOrgUnit( orgunit );
+            if ( program == null )
+            {
+                total = patientService.countGetPatientsByOrgUnit( orgunit );
+            }
+            else
+            {
+                total = patientService.countGetPatientsByOrgUnitProgram( orgunit, program );
+            }
+            
             this.paging = createPaging( total );
 
             patients = new ArrayList<Patient>( patientService.getPatients( orgunit, program, paging.getStartPos(),

=== 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-12 09:03:33 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2012-09-12 13:36:55 +0000
@@ -620,6 +620,10 @@
 					+ '></td>');
 				setEventColorStatus( elementId, 3 );
 			}
+			if( jQuery('#tb_' + programInstanceId + " :input" ).length > 4 ){
+				jQuery('#tb_' + programInstanceId + ' .arrow-left').removeClass("hidden");
+				jQuery('#tb_' + programInstanceId + ' .arrow-right').removeClass("hidden");
+			}
 			setInnerHTML('createEventMessage_' + programInstanceId,i18n_create_event_success);
 		});
 }
@@ -832,4 +836,22 @@
            
 		element.style.backgroundColor = color;
 	}
+}
+
+function resize(){
+	var width = 400;
+	var w = $(window).width(); 
+	if(jQuery(".patient-object").length > 1 ){
+		width += 150;
+	}
+	if(jQuery(".show-new-event").length > 0 ){
+		width += 150;
+	}
+	
+	$('.stage-flow').css('width', w-width); 
+	$('.table-flow').css('width', w-width); 
+	$('.table-flow tr').each(function(){
+		jQuery(this).find('td').attr("width", "10px");
+		jQuery(this).find('td:last').attr("width", "");
+	});
 }
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-09-11 09:46:38 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js	2012-09-12 13:36:55 +0000
@@ -405,8 +405,8 @@
 {
 	var programId = jQuery('#enrollmentDiv [id=programId] option:selected').val();
 	var programName = jQuery('#enrollmentDiv [id=programId] option:selected').text();
-	var dateOfIncident = jQuery('#enrollmentDiv [id=dateOfIncident]').val();
-	var enrollmentDate = jQuery('#enrollmentDiv [id=enrollmentDate]').val();
+	var dateOfIncident = jQuery('#enrollmentDiv [id=dateOfIncidentField]').val();
+	var enrollmentDate = jQuery('#enrollmentDiv [id=enrollmentDateField]').val();
 	
 	jQuery.postJSON( "saveProgramEnrollment.action",
 		{

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/report.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/report.js	2012-09-06 03:50:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/report.js	2012-09-12 13:36:55 +0000
@@ -49,6 +49,8 @@
 	}, function() 
 	{ 
 		jQuery( "[name=newEncounterBtn]" ).addClass("hidden");
+		jQuery( "[name=newEncounterBtn]" ).removeClass("show-new-event");
+		resize();
 		hideLoader();
 		hideById( 'message' );
 		showById( 'contentDiv' );

=== 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-09-12 09:03:33 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js	2012-09-12 13:36:55 +0000
@@ -271,14 +271,13 @@
 			jQuery(this).removeClass("stage-object-selected");
 		});
 	
-	jQuery("#tb_" + programInstanceId + " .arrow-left").toggle();
-	jQuery("#tb_" + programInstanceId + " .arrow-right").toggle();
 	if( jQuery("#tb_" + programInstanceId + " .searched").length>0)
 	{	
 		var id = jQuery("#tb_" + programInstanceId + " .searched").attr('id').split('_')[1];
 		showById("arrow_" + id);
 		showById("td_" + id );
 	}
+	resize();
 }
 
 // --------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm	2012-09-12 09:03:33 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm	2012-09-12 13:36:55 +0000
@@ -18,11 +18,6 @@
 	<li><a href="app/index.html"> $i18n.getString( "tabular_report" )&nbsp;</a></li> 
 </ul>
 
-<!-- <h2>$i18n.getString( "activity_planning" )&nbsp;</h2>
-<ul>
-    <li><a href="visitplan.action">$i18n.getString( "visit_plan" )&nbsp;</a></li>     
-</ul> -->
-
 <h2>$i18n.getString( "case_aggregation" )&nbsp;</h2>
 <ul>
     <li><a href="caseAggregationForm.action">$i18n.getString( "case_aggregation" )</a></li>     

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm	2012-09-04 10:10:05 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm	2012-09-12 13:36:55 +0000
@@ -1,6 +1,6 @@
 <script>
 	jQuery(document).ready(	function(){
-		datePickerInRangeValid( 'dateOfIncident' , 'enrollmentDate' );
+		datePickerInRangeValid( 'dateOfIncidentField' , 'enrollmentDateField' );
 		var unSave = false;
 	});	
 </script>
@@ -27,12 +27,12 @@
 		
 		<tr id='enrollmentDateTR' class='hidden'>
 			<td class='text-column'><label for="enrollmentDate"><span id='enrollmentDateDescription'></span><em title="$i18n.getString( "required" )" class="required"> * </em></label></td>
-			<td colspan='2' class='input-column'><input type="text" id="enrollmentDate" name="enrollmentDate" class="{validate:{required:true}}"></td>
+			<td colspan='2' class='input-column'><input type="text" id="enrollmentDateField" name="enrollmentDateField" class="{validate:{required:true}}"></td>
 		</tr>
 		
 		<tr id='dateOfIncidentTR' class='hidden'>
 			<td class='text-column'><label for="dateOfIncident"><span id='dateOfIncidentDescription'></span><em title="$i18n.getString( "required" )" class="required"> * </em></label></td>
-			<td colspan='2' class='input-column'><input type="text" id="dateOfIncident" name="dateOfIncident"  class="{validate:{required:true}}"></td>
+			<td colspan='2' class='input-column'><input type="text" id="dateOfIncidentField" name="dateOfIncidentField"  class="{validate:{required:true}}"></td>
 		</tr>
 	
 		<tr>

=== 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-07 09:18:04 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm	2012-09-12 13:36:55 +0000
@@ -1,14 +1,14 @@
-<table id='programStageIdTB_$!programInstance.id' style="width:850px;height:125px;">
+<table id='tb_$!programInstance.id' class="stage-container">
 	<tr>
 		<td>
-			<div class="arrow-left" onclick="moveLeft('flow_$!programInstance.id')">&nbsp;</div>
+			<div #if($programInstance.programStageInstances.size()<4) class="arrow-left hidden"  #else class="arrow-left" #end onclick="moveLeft('flow_$!programInstance.id')">&nbsp;</div>
 		</td>
 		<td>
 			<div id='flow_$!programInstance.id' class="stage-flow">
-				<table class="stage-flow">											
+				<table class="table-flow">											
 					<tr id='programStageIdTR_$!programInstance.id'>
 						#foreach( $programStageInstance in $programInstance.programStageInstances )
-						<td width="5px" style='font-size:25px;' title='$i18n.getString("show_hide_event_flow")'>&rarr;</td>
+						<td style='font-size:25px;'>&rarr;</td>
 						<td>
 							<input type="button" name="programStageBtn"
 								id="ps_$!programStageInstance.id"
@@ -33,10 +33,10 @@
 			</div>
 		</td>
 		<td>
-			<div class="arrow-right" onclick="moveRight('flow_$!programInstance.id')">&nbsp;</div>
+			<div #if($programInstance.programStageInstances.size()<4) class="arrow-right hidden"  #else class="arrow-right" #end onclick="moveRight('flow_$!programInstance.id')">&nbsp;</div>
 		</td>
 		<td>&nbsp;</td>
-		<td>
+		<td align="right">
 			<input type="button" class='patient-object' id="newEncounterBtn_$!programInstance.id" name="newEncounterBtn" value="$i18n.getString('create_new_event')" onClick="javascript:showCreateNewEvent('$!programInstance.id');" >
 		</td>
 	</tr>			
@@ -81,9 +81,21 @@
 <script>
 	var i18n_create_new_event = '$encoder.jsEscape( $i18n.getString( "create_new_event" ) , "'" )';
 	var i18n_create_event_success = '$encoder.jsEscape( $i18n.getString( "create_event_success" ) , "'" )';
-	var options = jQuery("#createNewEncounterDiv_$!programInstance.id [id=repeatableProgramStageId] option").length;
-	if( options==0 )
-		jQuery("[name=newEncounterBtn]").addClass("hidden");
+	jQuery(document).ready(	function(){
+		var options = jQuery("#createNewEncounterDiv_$!programInstance.id [id=repeatableProgramStageId] option").length;
+		if( options==0 ){
+			jQuery("[name=newEncounterBtn]").addClass("hidden");
+		}
+		else{
+			jQuery("[name=newEncounterBtn]").addClass("show-new-event");
+		}
+		resize();
+	});
+	
+    $(window).bind('resize', function(e){ 
+		resize();
+	});
+	
 </script>
 
 

=== 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-09-11 13:35:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm	2012-09-12 13:36:55 +0000
@@ -14,7 +14,7 @@
 	</tr>	
 	
 	<tr>
-		<td class='text-column' >$i18n.getString( "total_result" ):</td>
+		<td class='text-column'>$i18n.getString( "total_result" ):</td>
 		<td>&nbsp;</td>
 		<td>&nbsp;</td>
 		<td>$!total</td>
@@ -50,52 +50,47 @@
 					#if($!programStageInstanceMap.get($programInstance))
 						#set($programStageInstances = $programStageInstanceMap.get($programInstance) )
 					<td>
-						<table class="stage-container" id='tb_$programInstance.id'>	
+						<table id='tb_$programInstance.id' class="stage-container">	
 							<tr>
 								<td>
-									<div class="arrow-left" onclick="moveLeft('flow_$programInstance.id')">&nbsp;</div>
+									<div #if($programInstance.programStageInstances.size()<4) class="arrow-left hidden"  #else class="arrow-left" #end onclick="moveLeft('flow_$programInstance.id')">&nbsp;</div>
 								</td>
-								<td class='stage-flow'>
-									<div id='flow_$programInstance.id' class='stage-flow'><table class="stage-flow">
+								<td>
+									<div id='flow_$!programInstance.id' class="stage-flow">
+										<table class="table-flow">
 										<tr>
 										#set( $flag = "false" )
 										#foreach( $programStageInstance in $programStageInstances )
-											<td id="arrow_$programStageInstance.id" width="5px" style='font-size:25px;'>&rarr;</td>
+											<td id="arrow_$programStageInstance.id" style='font-size:25px;'>&rarr;</td>
 											<td id="td_$programStageInstance.id">
-												<table class='stage-object'>
-													<tr>
-														<td>
-															#set($title="")
-															#set($index = 0)
-															#foreach( $comment in $programStageInstance.patientComments)
-																#if( $index < 5)
-																	#set( $title= $title + "$format.formatDate( $comment.createdDate ) - $comment.creator - $comment.commentText &#13;&#10;" )
-																	#set( $index = $index + 1 )
-																#end
-															#end
-															#foreach( $sms in $programStageInstance.outboundSms)
-																#if( $index < 5)
-																	#set( $title= $title + "$format.formatDate( $sms.date ) - $sms.message &#13;&#10;")
-																	#set( $index = $index + 1)
-																#end
-															#end
-																	
-															<input type='button' id='box_$programStageInstance.id' name='programStageBtn' 
-																programStageInstanceId='$programStageInstance.id' 
-																programStageName='$programStageInstance.programStage.name' 
-																programStageId='$programStageInstance.programStage.id' 
-																status="$statusMap.get( $programStageInstance.id )" 
-																class='stage-object' 
-																value='$programStageInstance.programStage.name&#13;&#10;$format.formatDate( $programStageInstance.dueDate )' 
-																title="$title" onclick='javascript:getOutboundSmsList( $programStageInstance.id, false );'>
-														</td>
-														<script>
-															var status = $statusMap.get( $programStageInstance.id ); 
-															var dueDate = "$format.formatDate($programStageInstance.dueDate)";
-															setEventColorStatus( 'box_' + $programStageInstance.id ,status, dueDate );
-														</script>
-													</tr>
-												</table>
+												#set($title="")
+												#set($index = 0)
+												#foreach( $comment in $programStageInstance.patientComments)
+													#if( $index < 5)
+														#set( $title= $title + "$format.formatDate( $comment.createdDate ) - $comment.creator - $comment.commentText &#13;&#10;" )
+														#set( $index = $index + 1 )
+													#end
+												#end
+												#foreach( $sms in $programStageInstance.outboundSms)
+													#if( $index < 5)
+														#set( $title= $title + "$format.formatDate( $sms.date ) - $sms.message &#13;&#10;")
+														#set( $index = $index + 1)
+													#end
+												#end
+														
+												<input type='button' id='box_$programStageInstance.id' name='programStageBtn' 
+													programStageInstanceId='$programStageInstance.id' 
+													programStageName='$programStageInstance.programStage.name' 
+													programStageId='$programStageInstance.programStage.id' 
+													status="$statusMap.get( $programStageInstance.id )" 
+													class='stage-object' 
+													value='$programStageInstance.programStage.name&#13;&#10;$format.formatDate( $programStageInstance.dueDate )' 
+													title="$title" onclick='javascript:getOutboundSmsList( $programStageInstance.id, false );'>
+												<script>
+													var status = $statusMap.get( $programStageInstance.id ); 
+													var dueDate = "$format.formatDate($programStageInstance.dueDate)";
+													setEventColorStatus( 'box_' + $programStageInstance.id ,status, dueDate );
+												</script>
 											</td>
 										#end
 										</tr>
@@ -103,7 +98,7 @@
 								</td>
 								
 								<td>
-									<div class="arrow-right" onclick="moveRight('flow_$programInstance.id')">&nbsp;</div>
+									<div #if($programInstance.programStageInstances.size()<4) class="arrow-right hidden" #else class="arrow-right" #end onclick="moveRight('flow_$programInstance.id')">&nbsp;</div>
 								</td>
 							</tr>
 						</table>
@@ -141,4 +136,5 @@
 			jQuery("#box_$id").addClass("stage-object-selected searched");
 		#end
 	#end
+	resize();
 </script>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css	2012-09-12 02:49:08 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css	2012-09-12 13:36:55 +0000
@@ -140,40 +140,6 @@
 	margin-right: 5px;
 }
 
-input.stage-object[type="button"]
-{
-	width: 120px;
-	height: 60px;
-    cursor: pointer;
-	opacity: 1.0;
-	border: 2px solid;
-	margin: 5px;
-	white-space:normal;
-}
-
-input.stage-object[type="button"]:hover
-{
-	border: 5px solid;
-}
-
-input.stage-object-selected[type="button"]
-{
-    border: 5px solid;
-}
-
-input.patient-object[type="button"]
-{
-	width: 130px;
-	height: 60px;
-    white-space: normal;
-	border-color: #bbbbbb;
-	background-color: #ddd;
-	cursor: pointer;
-	border: 1px solid #aaa;
-	margin: 5px;
-	border-radius: 2px;
-}
-
 input.move-button
 {
 	width: 20px;
@@ -365,13 +331,21 @@
 
 .stage-container
 {
-	width:850px;
+	width:100%;
 	height:125px;
 }
 
 .stage-flow
 {
-	width:750px;
+	width:90%;
+	height:145px;
+	overflow-x:hidden;
+	overflow-y:hidden;
+}
+
+.table-flow
+{
+	width:100%;
 	height:145px;
 	overflow-x:hidden;
 	overflow-y:hidden;
@@ -394,3 +368,37 @@
 	border-right:30px solid #d0d0d0; 
 	cursor:pointer;
 }
+
+input.stage-object[type="button"]
+{
+	width: 120px;
+	height: 60px;
+    cursor: pointer;
+	opacity: 1.0;
+	border: 2px solid;
+	margin: 5px;
+	white-space:normal;
+}
+
+input.stage-object[type="button"]:hover
+{
+	border: 5px solid;
+}
+
+input.stage-object-selected[type="button"]
+{
+    border: 5px solid;
+}
+
+input.patient-object[type="button"]
+{
+	width: 130px;
+	height: 60px;
+    white-space: normal;
+	border-color: #bbbbbb;
+	background-color: #ddd;
+	cursor: pointer;
+	border: 1px solid #aaa;
+	margin: 5px;
+	border-radius: 2px;
+}
\ No newline at end of file