← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11036: Add program-report tab in program tracking module

 

------------------------------------------------------------
revno: 11036
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-05-28 14:09:29 +0700
message:
  Add program-report tab in program tracking module
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm
  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/smsReminder.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.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/eventMessage.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm	2013-05-28 05:49:19 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm	2013-05-28 07:09:29 +0000
@@ -15,7 +15,7 @@
 			<th>$i18n.getString( "message" )</th>
 		</tr>
 	</thead>
-	<tbody id='commentReportTB' name="commentTB">
+	<tbody id='commentReportTB' name="messageTB">
 		#set( $mark = false )
 		#foreach($programStageInstance in $programStageInstances)
 			#foreach( $comment in $programStageInstance.patientComments )

=== 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-05-23 02:30:53 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-05-28 07:09:29 +0000
@@ -1801,6 +1801,7 @@
 				jQuery('[name=messageTB]').prepend("<tr><td>" + getFieldValue('currentDate') + " " + currentTime + "</td>"
 					+ "<td>" + getFieldValue('programStageName') + "</td>"
 					+ "<td>" + getFieldValue('currentUsername') + "</td>"
+					+ "<td>" + i18n_message + "</td>"
 					+ "<td>" + field.value + "</td></tr>");
 				field.value="";
 				field.style.backgroundColor = SUCCESS_COLOR;
@@ -1864,6 +1865,7 @@
 			}
 
 			content += "<td>" + getFieldValue('currentUsername') + "</td>"
+			content += "<td>" + i18n_comment + "</td>";
 			content += "<td>" + commentText + "</td></tr>";
 			jQuery('#commentTB').prepend(content);
 			field.value="";

=== 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	2013-05-28 03:10:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js	2013-05-28 07:09:29 +0000
@@ -5,6 +5,7 @@
 	jQuery('#programIdAddPatient').width(width-30);
 	showById( "programLoader" );
 	disable('programIdAddPatient');
+	disable('listPatientBtn');
 	showById('mainLinkLbl');
 	showById('searchDiv');
 	hideById('listEventDiv');
@@ -38,6 +39,7 @@
 			}
 			else if(count>1){
 				jQuery( '#programIdAddPatient').prepend( '<option value="" selected>' + i18n_please_select + '</option>' );
+				enable('listPatientBtn');
 			}
 			
 			enableBtn();

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2013-05-28 05:49:19 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm	2013-05-28 07:09:29 +0000
@@ -269,4 +269,6 @@
 	jQuery('[name=mainPagelink]').html(i18n_main_form_link);
 	var i18n_history = '$encoder.jsEscape( $i18n.getString( "history" ) , "'" )';
 	var i18n_this_field_is_required = '$encoder.jsEscape( $i18n.getString( "this_field_is_required" ) , "'" )';
+	var i18n_comment = '$encoder.jsEscape( $i18n.getString( "comment" ) , "'")';
+	var i18n_message = '$encoder.jsEscape( $i18n.getString( "message" ) , "'")';
 </script>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm	2013-05-15 03:40:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm	2013-05-28 07:09:29 +0000
@@ -122,8 +122,8 @@
 
 <div id='tabs'>
 	<ul>
-		<li><a href="#tab-1">$i18n.getString("comments")</a></li>
-		<li><a href="#tab-2">$i18n.getString("messages")</a></li>
+		<li><a href="#tab-1">$i18n.getString("comments_and_sms_message")</a></li>
+		<li><a href="#tab-2">$i18n.getString("program_report")</a></li>
 	</ul>
 	
 	<div id='tab-1'>
@@ -138,6 +138,7 @@
 				<th>$i18n.getString( "date" )</th>
 				<th>$i18n.getString( "events" )</th>
 				<th>$i18n.getString( "sender" )</th>
+				<th>$i18n.getString( "type" )</th>
 				<th>$i18n.getString( "message" )</th>
 			</tr>
 			<tbody id='commentTB' name='commentTB'>
@@ -147,41 +148,32 @@
 						<td>$format.formatDateTime($comment.createdDate)</td>
 						<td>$encoder.htmlEncode($programStageInstance.programStage.displayName)</td>
 						<td>$encoder.htmlEncode($comment.creator)</td>
+						<td>$i18n.getString('comment')</td>
 						<td>$encoder.htmlEncode($comment.commentText)</td>
 					</tr>
 					#set( $mark = !$mark )
 				#end
-			</tbody>
-		</table>
-	</div>
-	
-	<div id='tab-2'>
-		<table class="mainPageTable">
-			<colgroup>
-				<col width="160px"/>
-				<col width="160px"/>
-				<col width="100px"/>
-				<col/>
-			</colgroup>
-			<tr>
-				<th>$i18n.getString( "date" )</th>
-				<th>$i18n.getString( "program_stage" )</th>
-				<th>$i18n.getString( "sender" )</th>
-				<th>$i18n.getString( "message" )</th>
-			</tr>
-			<tbody id='messageTB' name='messageTB'>
-				#set( $mark = false )
 				#foreach( $sms in $outboundSms )
 					<tr id="tr${sms.id}" #alternate( $mark )>
 						<td>$format.formatDateTime($!sms.date)</td>
 						<td>$encoder.htmlEncode($programStageInstance.programStage.displayName)</td>
 						<td>$encoder.htmlEncode($sms.sender)</td>
+						<td>$i18n.getString('message')</td>
 						<td>$encoder.htmlEncode($sms.message)</td>
 					</tr>
 					#set( $mark = !$mark )
 				#end
 			</tbody>
 		</table>
+		
+	</div>
+	
+	<div id='tab-2'>
+		<p>
+			<input type="button" onclick="exportProgramReports( '$programInstance.id', 'xls' )" value="$i18n.getString('get_report_as_xls')" style='width:150px;'>
+			<input type="button" onclick="exportProgramReports( '$programInstance.id', 'pdf' )" value="$i18n.getString('get_report_as_pdf')" style='width:150px;'>
+		</p>
+		<div id='programReportDiv'></div>
 	</div>
 <div>
 
@@ -192,6 +184,13 @@
 		$('#tabs').tabs();
 	});
 
+	
+	$( "#tabs" ).bind( "tabsselect", function(event, ui) {
+		if( ui.tab.hash == '#tab-2' ){
+			programReports(getFieldValue('programInstanceId'));
+		}
+	});
+	
 	var i18n_color_quick_help = '$encoder.jsEscape( $i18n.getString( "color_quick_help" ) , "'")';
 	var i18n_comment_added = '$encoder.jsEscape( $i18n.getString( "comment_added" ) , "'")';
 	var i18n_this_field_is_required = '$encoder.jsEscape( $i18n.getString( "this_field_is_required" ) , "'")';

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm	2013-05-21 05:35:18 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm	2013-05-28 07:09:29 +0000
@@ -157,7 +157,9 @@
 	var i18n_patient_details_and_history = '$encoder.jsEscape( $i18n.getString( "patient_details_and_history" ), "'")';
 	var i18n_insert_a_report_date = '$encoder.jsEscape( $i18n.getString( "insert_a_report_date" ) , "'")';
 	var i18n_reenrollment_confirm_message = '$encoder.jsEscape( $i18n.getString( "reenrollment_confirm_message" ) , "'")';
-    
+    var i18n_comment = '$encoder.jsEscape( $i18n.getString( "comment" ) , "'")';
+	var i18n_message = '$encoder.jsEscape( $i18n.getString( "message" ) , "'")';
+	
 	var checkedDuplicate = false;
 	var registration = false;