← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12530: Fixed bug - Don't display message history in Dashboard.

 

------------------------------------------------------------
revno: 12530
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-10-09 21:43:56 +0700
message:
  Fixed bug - Don't display message history in Dashboard.
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/java/org/hisp/dhis/caseentry/action/reminder/SavePatientCommentAction.java
  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/eventMessage.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.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-09-30 12:11:35 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageInstance.hbm.xml	2013-10-09 14:43:56 +0000
@@ -56,5 +56,9 @@
 
 		<property name="completedDate" />
 		
+		<many-to-one name="patientComment" cascade="all"
+			class="org.hisp.dhis.patientcomment.PatientComment" column="patientcommentid"
+			foreign-key="fk_programinstance_patientcommentid" />
+			
 	</class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SavePatientCommentAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SavePatientCommentAction.java	2013-09-07 08:03:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SavePatientCommentAction.java	2013-10-09 14:43:56 +0000
@@ -107,9 +107,10 @@
                 patientComment = new PatientComment();
             }
 
-            patientComment = new PatientComment( commentText, currentUserService.getCurrentUsername(), new Date() );
+            patientComment.setCommentText( commentText );
+            patientComment.setCreator( currentUserService.getCurrentUsername() );
+            patientComment.setCreatedDate( new Date() );
             programStageInstance.setPatientComment( patientComment );
-
         }
         else if ( patientComment != null )
         {

=== 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	2013-10-09 11:14:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2013-10-09 14:43:56 +0000
@@ -684,4 +684,5 @@
 report_option = Report options
 active_and_completed_enrolments = Active and Completed Enrolments
 hide_search_criteria = Hide search criteria
-there_are_active_search_filter_click_on_arrow_to_show_them = there are active search filter, click on arrow to show them.
\ No newline at end of file
+there_are_active_search_filter_click_on_arrow_to_show_them = there are active search filter, click on arrow to show them.
+add_relative = Add relative
\ No newline at end of file

=== 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-09-10 15:46:44 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/eventMessage.vm	2013-10-09 14:43:56 +0000
@@ -60,15 +60,16 @@
 			</tr>
 			#set( $mark = !$mark )
 		#end
+		
 		#foreach($programStageInstance in $programStageInstances)
-			#foreach( $comment in $programStageInstance.patientComments )
+			#if( $programStageInstance.patientComment )
 				<tr id="comment_$comment.id" #alternate( $mark )>
-					<td>$format.formatDateTime($comment.createdDate)</td>
+					<td>$format.formatDateTime($programStageInstance.patientComment.createdDate)</td>
 					<td>$programStageInstance.programStage.displayName</td>
-					<td>$comment.creator</td>
+					<td>$programStageInstance.patientComment.creator</td>
 					<td>$i18n.getString('comment')</td>
 					<td></td>
-					<td>$comment.commentText</td>
+					<td>$programStageInstance.patientComment.commentText</td>
 					<td>
 						<a href="javascript:removeComment( '$programStageInstance.id', '$comment.id' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"></a>
 					</td>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm	2013-09-07 21:25:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/visitSchedule.vm	2013-10-09 14:43:56 +0000
@@ -130,7 +130,7 @@
 			<th>$i18n.getString( "events" )</th>                   
 			<th>$i18n.getString( "due_date" )</th>       
 			<th>$i18n.getString( "status" )</th>
-			<th colspan='2'>$i18n.getString( "message" )</th>
+			<th colspan='2'>$i18n.getString( "comment" )</th>
 			#if( $auth.hasAccess( "dhis-web-caseentry", "removeCurrentEncounter" ) )
 			<th>$i18n.getString( "operation" )</th>
 			#end
@@ -177,10 +177,10 @@
 				</script>
 			</td>
 			<td>
-				<input type='text' id='message_$programStageInstance.id' name='message_$programStageInstance.id' class="{validate:{required:true,maxlength:160}}" style="width:100%" onchange="addComment(byId('message_$programStageInstance.id'),'$programStageInstance.id')" >
+				<input type='text' value='$!programStageInstance.patientComment.commentText' id='message_$programStageInstance.id' name='message_$programStageInstance.id' class="{validate:{required:true,maxlength:160}}" style="width:100%" onchange="addComment(byId('message_$programStageInstance.id'),'$programStageInstance.id')" >
 			</td>
 			<td>
-				<input type='button' class='normal-button' onclick="addComment(byId('message_$programStageInstance.id'),'$programStageInstance.id')" value="$i18n.getString('add')" >
+				<input type='button' class='normal-button' onclick="addComment(byId('message_$programStageInstance.id'),'$programStageInstance.id')" value="$i18n.getString('save')" >
 			</td>
 			<td>
 				#if(($auth.hasAccess( "dhis-web-caseentry", "sendSMS" ) )