← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7936: Add comment icon for SMS Reminder.

 

------------------------------------------------------------
revno: 7936
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-08-20 15:50:44 +0700
message:
  Add comment icon for SMS Reminder.
added:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/comments.png
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/tooltip.js
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/smsReminder.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsPatientRecords.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsReminderList.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/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	2012-08-20 03:18:20 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2012-08-20 08:50:44 +0000
@@ -416,4 +416,6 @@
 post_comment = Post comment
 comments = Comments
 no_sms_service_available = No Sms service available
-due_date_from_to = Due date (from-to)
\ No newline at end of file
+due_date_from_to = Due date (from-to)
+no_phone_number = No phone number
+no_comment = No comment
\ No newline at end of file

=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/comments.png'
Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/comments.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/images/comments.png	2012-08-20 08:50:44 +0000 differ
=== 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-08-17 09:17:56 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js	2012-08-20 08:50:44 +0000
@@ -97,6 +97,28 @@
 			height:250
 		});
 }
+
+function showCommentList( programStageInstanceId, isSendSMS ) 
+{
+	setFieldValue('sendToList', "false");
+	$('#smsManagementDiv' ).load("getOutboundSmsList.action",
+		{
+			programStageInstanceId: programStageInstanceId
+		}
+		, function(){
+			hideById('smsManagementForm');
+		}).dialog(
+		{
+			title:i18n_sms_message_management,
+			maximize:true, 
+			closable:true,
+			modal:false,
+			overlay:{background:'#000000', opacity:0.1},
+			width:800,
+			height:500
+		});
+}
+
 function sendSMS()
 {
 	var sendToList = getFieldValue('sendToList');

=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/tooltip.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/tooltip.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/tooltip.js	2012-08-20 08:50:44 +0000
@@ -0,0 +1,54 @@
+var toolTip = {
+	offsetY : 10,
+	offsetX : 10,
+	preview : function(obj, event) {
+		var target = obj.attr('id') + '-content';
+		if (target.length > 0) {
+			if (event.type == 'mouseover') {
+				if (!$('#' + target).hasClass('selected')) {
+					$('#' + target)
+						.css('top', (event.pageY - toolTip.offsetX) + 'px')
+						.css('left', (event.pageX + toolTip.offsetY) + 'px')
+						.fadeIn(100);
+				}
+			} else if (event.type == 'mouseout') {
+				if (!$('#' + target).hasClass('selected')) {
+					$('#' + target).hide();
+				}
+			} else if (event.type == 'mousemove') {
+				if (!$('#' + target).hasClass('selected')) {
+					$('#' + target)
+						.css('top', (event.pageY - toolTip.offsetX) + 'px')
+						.css('left', (event.pageX + toolTip.offsetY) + 'px');
+				}
+			} else {
+				if (!$('#' + target).hasClass('selected')) {
+					$('.tooltip-target').removeClass('selected');
+					$('.tooltip-target').hide();
+					$('#' + target).addClass('selected');
+					$('#' + target)
+						.css('top', (event.pageY - toolTip.offsetX) + 'px')
+						.css('left', (event.pageX + toolTip.offsetY) + 'px')
+						.show();
+				} else {
+					$('#' + target).removeClass('selected');
+					$('#' + target).hide();
+				}
+			}
+		}
+	}
+};
+$(function() {
+
+	$('.tooltip').live('mouseover mouseout mousemove click', function(event) {
+		toolTip.preview($(this), event);
+		return false;
+	});
+	
+	$('.tooltip-target').live('click', function() {
+		$(this).removeClass('selected');
+		$(this).hide();
+		return false;
+	});
+
+});
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsPatientRecords.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsPatientRecords.vm	2012-08-20 03:18:20 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsPatientRecords.vm	2012-08-20 08:50:44 +0000
@@ -1,3 +1,4 @@
+<script src="javascript/tooltip.js" type="text/javascript"></script>
 <table>
 	<tr>
 		<td class='text-column' >$i18n.getString( "search_result_matching_the_search_criteria" ):</td>
@@ -51,7 +52,17 @@
 											<td>
 												<table class='stage-object'>
 													<tr>
-														<td><input type='button' id='ps_$programStageInstance.id' name='programStageBtn' programStageInstanceId='$programStageInstance.id' programStageId='$programStageInstance.programStage.id' status="$statusMap.get( $programStageInstance.id )" class='stage-object' value='$programStageInstance.programStage.name $format.formatDate( $programStageInstance.dueDate )' onclick='javascript:getOutboundSmsList( $programStageInstance.id, false );'></td>
+														<td>
+															
+															<input type='button' id='ps_$programStageInstance.id' name='programStageBtn' 
+																programStageInstanceId='$programStageInstance.id' 
+																programStageId='$programStageInstance.programStage.id' 
+																status="$statusMap.get( $programStageInstance.id )" 
+																class='stage-object' 
+																value='$programStageInstance.programStage.name $format.formatDate( $programStageInstance.dueDate )' 
+																onclick='javascript:getOutboundSmsList( $programStageInstance.id, false );'>
+															</div>
+														</td>
 														<script>
 															var status = $statusMap.get( $programStageInstance.id ); 
 															var programStageId = '$programStageInstance.programStage.id';
@@ -71,8 +82,31 @@
 													</tr>
 													<tr>
 														<td>
-															<img src='images/sms.png' title="$i18n.getString('send_sms')" onclick="getOutboundSmsList( $programStageInstance.id, true );" style='cursor:pointer;'/>
-															<span id='noMessageDiv_$programStageInstance.id'>$programStageInstance.outboundSms.size()</span> $i18n.getString('messages')
+															<a href="#" id="comment-$programStageInstance.id" class="tooltip">
+																<img src='images/comments.png'>
+																#set( $divid = 'comment-' + $programStageInstance.id + '-content')
+																<div id="$divid" class="tooltip-target">
+																	#if( $programStageInstance.comments.size() > 0 )
+																		#foreach( $comment in $programStageInstance.comments )
+																			<p>- $format.formatDate($comment.createdDate)- $comment.creator - $comment.commentText</p>
+																		#end
+																	#else
+																		<p>($i18n.getString('no_comment'))</p>
+																	#end
+																</div>
+															</a>
+															#if( $!programInstance.patient.phoneNumber && $!programInstance.patient.phoneNumber != '' )
+																<img src='images/sms.png' class='comment-font' onclick="getOutboundSmsList( $programStageInstance.id, true );" style='cursor:pointer;' title="$programStageInstance.outboundSms.size() $i18n.getString('messages')"/>&nbsp;
+															#end
+														</td>
+													</tr>
+													<tr class='hidden'>
+														<td>
+															#if( $!programInstance.patient.phoneNumber && $!programInstance.patient.phoneNumber != '' )
+																(<span id='noMessageDiv_$programStageInstance.id'>$programStageInstance.outboundSms.size()</span> $i18n.getString('messages'))
+															#else
+																(<span id='noMessageDiv_$programStageInstance.id'>$i18n.getString("no_phone_number")</span>)
+															#end
 														</td>
 													</tr>
 												</table>
@@ -103,14 +137,4 @@
 	</div>
 	
 	<div id="detailsInfo"></div>
-#end
-
-<script>
-	/* #if($!listAll)
-	#else
-		var programId = jQuery("#programIdAddPatient").val();
-		var programStageId = jQuery("#programStageAddPatient").val();
-		var status = jQuery('#programStageAddPatientTR [id=statusEvent]').val();
-		jQuery("#patientList [programStageId=" + programStageId + "][status=" + status + "]" ).addClass("stage-object-selected");
-	#end */
-</script>
+#end
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsReminderList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsReminderList.vm	2012-08-17 06:42:32 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/smsReminderList.vm	2012-08-20 08:50:44 +0000
@@ -1,6 +1,6 @@
 <script type="text/javascript">
 	jQuery(document).ready(	function(){
-		$('#tabs').tabs();
+		$('#smsManagementForm').tabs();
 		validation( 'sendSMSForm', function(form){
 			sendSMS();
 		});
@@ -31,10 +31,14 @@
 		<td valign='bottom' style="width:360px;">
 			<div class="contentProviderTable">
 				<table id='commentTB' width='100%'>
-					#foreach( $comment in $comments )
-						<tr id="comment_$comment.id">
-							<td>$format.formatDate($comment.createdDate) - $comment.creator - $comment.commentText</td>
-						</tr>
+					#if( $comments.size() > 0 )
+						#foreach( $comment in $comments )
+							<tr id="comment_$comment.id">
+								<td>$format.formatDate($comment.createdDate) - $comment.creator - $comment.commentText</td>
+							</tr>
+						#end
+					#else
+						<tr><td>($i18n.getString("no_comment"))</td></tr>
 					#end
 				</table>
 			</div>
@@ -50,7 +54,7 @@
 	</tr>
 </table>
 
-<div id="tabs">
+<div id="smsManagementForm">
 	<ul>
 		<li><a href="#tab-1">$i18n.getString("send_sms")</a></li>
 		<li><a href="#tab-2">$i18n.getString("sms_reminder_list")</a></li>

=== 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-08-17 06:42:32 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css	2012-08-20 08:50:44 +0000
@@ -321,6 +321,29 @@
   background-color: #f8f8f8;
 }
 
+.tooltip {
+	border-bottom: dashed 1px #aaa;
+	text-decoration: none;
+	cursor: help;
+	text-align: left;
+}
+.tooltip-target {
+	width: 250px;
+	top: 29px;
+	left: 764px;
+	display: none;
+	padding: 10px;
+	background: #ffffff;
+	position: absolute;
+	display: none;
+	float: left;
+	-webkit-border-radius: 7px;
+	-moz-border-radius: 7px;
+	border-radius: 7px;
+	border: solid 1px #ddd;
+	z-index:1001;
+}
+
 /* --------------------------------------------------------------
 // program-stage-instances
 // -------------------------------------------------------------- */