← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10833: Saparate comments and message to two tables in list of messages ( Program Tracking ).

 

------------------------------------------------------------
revno: 10833
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-05-14 20:45:36 +0700
message:
   Saparate comments and message to two tables in list of messages ( Program Tracking ).
modified:
  dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml
  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/programTrackingList.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-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml	2013-04-16 02:02:11 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml	2013-05-14 13:45:36 +0000
@@ -31,7 +31,7 @@
       <many-to-many class="org.hisp.dhis.sms.outbound.OutboundSms" column="outboundsmsid" />
     </list>
      
-    <set name="patientComments" order-by="createdDate desc" cascade="all">
+    <set name="patientComments" order-by="createdDate asc" cascade="all">
       <key column="programstageinstanceid" />
       <one-to-many class="org.hisp.dhis.patientcomment.PatientComment" />
     </set>

=== 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-04-13 07:22:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2013-05-14 13:45:36 +0000
@@ -1794,7 +1794,7 @@
 				setInnerHTML('smsError', json.message);
 				var date = new Date();
 				var currentTime = date.getHours() + ":" + date.getMinutes();
-				jQuery('[name=commentTB]').prepend("<tr><td>" + getFieldValue('currentDate') + " " + currentTime + "</td>"
+				jQuery('[name=messageTB]').prepend("<tr><td>" + getFieldValue('currentDate') + " " + currentTime + "</td>"
 					+ "<td>" + getFieldValue('programStageName') + "</td>"
 					+ "<td>" + getFieldValue('currentUsername') + "</td>"
 					+ "<td>" + field.value + "</td></tr>");
@@ -1812,7 +1812,7 @@
 				field.style.backgroundColor = ERROR_COLOR;
 			}
 			
-			if( jQuery("#commentTB tr.hidden").length > 0 ){
+			if( jQuery("#messageTB tr.hidden").length > 0 ){
 				commentDivToggle(true);
 			}
 			else{

=== 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-06 08:28:39 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm	2013-05-14 13:45:36 +0000
@@ -120,52 +120,74 @@
 	</div>
 </div>			
 
-<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='commentTB' name='commentTB'>
-		#foreach( $comment in $comments )
-			<tr id="comment_$comment.id">
-				<td>$format.formatDateTime($comment.createdDate)</td>
-				<td>$encoder.htmlEncode($programStageInstance.programStage.displayName)</td>
-				<td>$encoder.htmlEncode($comment.creator)</td>
-				<td>$encoder.htmlEncode($comment.commentText)</td>
-			</tr>
-		#end
-		
-		#foreach( $sms in $outboundSms )
-			<tr id="tr${sms.id}" >
-				<td>$format.formatDateTime($!sms.date)</td>
-				<td>$encoder.htmlEncode($programStageInstance.programStage.displayName)</td>
-				<td>$encoder.htmlEncode($sms.sender)</td>
-				<td>$encoder.htmlEncode($sms.message)</td>
-			</tr>
-		#end
-	</tbody>
-</table>
-<p>
-	#set($count = $comments.size() + $outboundSms.size() )
-	<input type='button' id="showCommentBtn" name="showCommentBtn" value='$i18n.getString("show_hide_more")' #if($count && $count<=5) class='hidden' #end onclick='commentDivToggle(false);'>
-	<input type='button' id="hideCommentBtn" name="hideCommentBtn" value='$i18n.getString("show_hide_more")' class='hidden' onclick='commentDivToggle(true);'>
-</p>
+<div id='tabs'>
+	<ul>
+		<li><a href="#tab-1">$i18n.getString("comments")</a></li>
+		<li><a href="#tab-2">$i18n.getString("messages")</a></li>
+	</ul>
+	
+	<div id='tab-1'>
+		<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='commentTB' name='commentTB'>
+				#foreach( $comment in $comments )
+					<tr id="comment_$comment.id">
+						<td>$format.formatDateTime($comment.createdDate)</td>
+						<td>$encoder.htmlEncode($programStageInstance.programStage.displayName)</td>
+						<td>$encoder.htmlEncode($comment.creator)</td>
+						<td>$encoder.htmlEncode($comment.commentText)</td>
+					</tr>
+				#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'>
+				#foreach( $sms in $outboundSms )
+					<tr id="tr${sms.id}" >
+						<td>$format.formatDateTime($!sms.date)</td>
+						<td>$encoder.htmlEncode($programStageInstance.programStage.displayName)</td>
+						<td>$encoder.htmlEncode($sms.sender)</td>
+						<td>$encoder.htmlEncode($sms.message)</td>
+					</tr>
+				#end
+			</tbody>
+		</table>
+	</div>
+<div>
 
 <script type="text/javascript">
 	jQuery(document).ready(	function(){
 		setFieldValue('programStageName', "$programStageInstance.programStage.displayName");
 		setFieldValue( "programStageInstanceId", "$!programStageInstance.id" );
-		commentDivToggle(true);
+		$('#tabs').tabs();
 	});
-	
+
 	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" ) , "'")';