← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3261: Impl read, mark as unread, remove message

 

------------------------------------------------------------
revno: 3261
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-04-01 21:47:09 +0200
message:
  Impl read, mark as unread, remove message
added:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/WEB-INF/lib/
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/read.png
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/ReadMessageAction.java
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/RemoveMessageAction.java
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/UnreadMessageAction.java
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/readMessage.vm
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/message/Message.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/message/hibernate/Message.hbm.xml
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/ContextInterceptor.java
  dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/GetMessagesAction.java
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/message.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-api/src/main/java/org/hisp/dhis/message/Message.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/message/Message.java	2011-03-31 16:28:24 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/message/Message.java	2011-04-01 19:47:09 +0000
@@ -62,7 +62,7 @@
         this.text = text;
         this.sender = sender;
     }
-    
+        
     public int getId()
     {
         return id;

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/message/hibernate/Message.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/message/hibernate/Message.hbm.xml	2011-04-01 07:32:03 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/message/hibernate/Message.hbm.xml	2011-04-01 19:47:09 +0000
@@ -14,7 +14,7 @@
 
 	<property name="key" column="messagekey" not-null="true"/>
     <property name="subject" column="messagesubject" not-null="true"/>
-    <property name="text" column="messagetext"/>
+    <property name="text" column="messagetext" type="text"/>
         
     <many-to-one name="sender" class="org.hisp.dhis.user.User" 
       column="userid" foreign-key="fk_message_user" not-null="true"/>

=== added directory 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/WEB-INF/lib'
=== added file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/read.png'
Binary files dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/read.png	1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/images/read.png	2011-04-01 19:47:09 +0000 differ
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/ContextInterceptor.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/ContextInterceptor.java	2011-03-31 12:37:13 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/interceptor/ContextInterceptor.java	2011-04-01 19:47:09 +0000
@@ -30,7 +30,6 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.hisp.dhis.message.MessageService;
 import org.hisp.dhis.system.database.DatabaseInfoProvider;
 
 import com.opensymphony.xwork2.ActionInvocation;
@@ -43,7 +42,6 @@
     implements Interceptor
 {
     private static final String KEY_IN_MEMORY_DATABASE = "inMemoryDatabase";
-    private static final String KEY_UNREAD_MESSAGES = "keyUnreadMessages";
     
     private DatabaseInfoProvider databaseInfoProvider;
 
@@ -52,13 +50,6 @@
         this.databaseInfoProvider = databaseInfoProvider;
     }
     
-    private MessageService messageService;
-
-    public void setMessageService( MessageService messageService )
-    {
-        this.messageService = messageService;
-    }
-
     @Override
     public void destroy()
     {
@@ -75,8 +66,7 @@
     {
         Map<String, Object> map = new HashMap<String, Object>();
         
-        map.put( KEY_IN_MEMORY_DATABASE, databaseInfoProvider.isInMemory() );        
-        map.put( KEY_UNREAD_MESSAGES, messageService.getUnreadMessageCount() );
+        map.put( KEY_IN_MEMORY_DATABASE, databaseInfoProvider.isInMemory() );
         
         invocation.getStack().push( map );
         

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml	2011-03-31 12:37:13 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml	2011-04-01 19:47:09 +0000
@@ -476,7 +476,6 @@
 
 	<bean id="org.hisp.dhis.interceptor.ContextInterceptor" class="org.hisp.dhis.interceptor.ContextInterceptor">
 		<property name="databaseInfoProvider" ref="databaseInfoProvider" />
-		<property name="messageService" ref="org.hisp.dhis.message.MessageService"/>
 	</bean>
 
 	<bean id="org.hisp.dhis.useraccount.action.GetCurrentUserAction" class="org.hisp.dhis.useraccount.action.GetCurrentUserAction" scope="prototype">

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/GetMessagesAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/GetMessagesAction.java	2011-04-01 13:46:34 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/GetMessagesAction.java	2011-04-01 19:47:09 +0000
@@ -68,7 +68,7 @@
 
     public String execute()
     {
-        messages = messageService.getUserMessages( 1, 200 );
+        messages = messageService.getUserMessages( 0, 200 );
         
         return SUCCESS;
     }

=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/ReadMessageAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/ReadMessageAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/ReadMessageAction.java	2011-04-01 19:47:09 +0000
@@ -0,0 +1,74 @@
+package org.hisp.dhis.dashboard.message.action;
+
+/*
+ * Copyright (c) 2004-2010, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import org.hisp.dhis.message.MessageService;
+import org.hisp.dhis.message.UserMessage;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Lars Helge Overland
+ */
+public class ReadMessageAction
+    implements Action
+{
+    private MessageService messageService;
+
+    public void setMessageService( MessageService messageService )
+    {
+        this.messageService = messageService;
+    }
+
+    private Integer id;
+    
+    public void setId( Integer id )
+    {
+        this.id = id;
+    }
+
+    private UserMessage message;
+    
+    public UserMessage getMessage()
+    {
+        return message;
+    }
+
+    @Override
+    public String execute()
+        throws Exception
+    {
+        message = messageService.getUserMessage( id );
+        
+        message.setRead( true );
+        
+        messageService.updateUserMessage( message );
+        
+        return SUCCESS;
+    }
+}

=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/RemoveMessageAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/RemoveMessageAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/RemoveMessageAction.java	2011-04-01 19:47:09 +0000
@@ -0,0 +1,64 @@
+package org.hisp.dhis.dashboard.message.action;
+
+/*
+ * Copyright (c) 2004-2010, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import org.hisp.dhis.message.MessageService;
+import org.hisp.dhis.message.UserMessage;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Lars Helge Overland
+ */
+public class RemoveMessageAction
+    implements Action
+{
+    private MessageService messageService;
+
+    public void setMessageService( MessageService messageService )
+    {
+        this.messageService = messageService;
+    }
+
+    private Integer id;
+    
+    public void setId( Integer id )
+    {
+        this.id = id;
+    }
+
+    public String execute()
+        throws Exception
+    {
+        UserMessage message = messageService.getUserMessage( id );
+        
+        messageService.deleteUserMessage( message );
+        
+        return SUCCESS;
+    }    
+}

=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/UnreadMessageAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/UnreadMessageAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/UnreadMessageAction.java	2011-04-01 19:47:09 +0000
@@ -0,0 +1,67 @@
+package org.hisp.dhis.dashboard.message.action;
+
+/*
+ * Copyright (c) 2004-2010, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import org.hisp.dhis.message.MessageService;
+import org.hisp.dhis.message.UserMessage;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Lars Helge Overland
+ */
+public class UnreadMessageAction
+    implements Action
+{
+    private MessageService messageService;
+
+    public void setMessageService( MessageService messageService )
+    {
+        this.messageService = messageService;
+    }
+
+    private Integer id;
+    
+    public void setId( Integer id )
+    {
+        this.id = id;
+    }
+
+    @Override
+    public String execute()
+        throws Exception
+    {
+        UserMessage message = messageService.getUserMessage( id );
+        
+        message.setRead( false );
+        
+        messageService.updateUserMessage( message );
+        
+        return SUCCESS;
+    }
+}

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml	2011-03-31 16:28:24 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/META-INF/dhis/beans.xml	2011-04-01 19:47:09 +0000
@@ -81,10 +81,28 @@
   
   <bean id="org.hisp.dhis.dashboard.message.action.SendMessageAction"
     class="org.hisp.dhis.dashboard.message.action.SendMessageAction"
-    scope="prototype">    
+    scope="prototype">
     <property name="messageService" ref="org.hisp.dhis.message.MessageService"/>
     <property name="selectionTreeManager" ref="org.hisp.dhis.oust.manager.SelectionTreeManager"/>
     <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService"/>
   </bean>
   
+  <bean id="org.hisp.dhis.dashboard.message.action.ReadMessageAction"
+    class="org.hisp.dhis.dashboard.message.action.ReadMessageAction"
+    scope="prototype">
+    <property name="messageService" ref="org.hisp.dhis.message.MessageService"/>    
+  </bean>
+  
+  <bean id="org.hisp.dhis.dashboard.message.action.UnreadMessageAction"
+    class="org.hisp.dhis.dashboard.message.action.UnreadMessageAction"
+    scope="prototype">
+    <property name="messageService" ref="org.hisp.dhis.message.MessageService"/>    
+  </bean>
+  
+  <bean id="org.hisp.dhis.dashboard.message.action.RemoveMessageAction"
+    class="org.hisp.dhis.dashboard.message.action.RemoveMessageAction"
+    scope="prototype">
+    <property name="messageService" ref="org.hisp.dhis.message.MessageService"/>    
+  </bean>
+  
 </beans>

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties	2011-04-01 13:46:34 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties	2011-04-01 19:47:09 +0000
@@ -23,4 +23,7 @@
 new_message = New message
 create_new_message = Create new message
 details = Details
-recipient = Recipient
\ No newline at end of file
+recipient = Recipient
+mark_unread = Mark as unread
+operations = Operations
+read = Read
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml	2011-04-01 13:46:34 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml	2011-04-01 19:47:09 +0000
@@ -61,6 +61,7 @@
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-dashboard-integration/message.vm</param>
       <param name="menu">/dhis-web-dashboard-integration/menu.vm</param>
+      <param name="javascripts">javascript/message.js</param>
     </action>
     
     <action name="sendMessage" class="org.hisp.dhis.dashboard.message.action.SendMessageAction">
@@ -74,5 +75,26 @@
       <param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/message.js</param>
     </action>
     
+    <action name="readMessage" class="org.hisp.dhis.dashboard.message.action.ReadMessageAction">
+      <result name="success" type="velocity">/main.vm</result>
+      <param name="page">/dhis-web-dashboard-integration/readMessage.vm</param>
+      <param name="menu">/dhis-web-dashboard-integration/menu.vm</param>
+      <param name="javascripts">javascript/message.js</param>
+    </action>
+    
+    <action name="unreadMessage" class="org.hisp.dhis.dashboard.message.action.UnreadMessageAction">
+      <result name="success" type="redirect">message.action</result>
+    </action>
+    
+    <action name="removeMessage" class="org.hisp.dhis.dashboard.message.action.RemoveMessageAction">
+      <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
+	  <result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm</result>
+	  <param name="onExceptionReturn">plainTextError</param>
+    </action>
+    
+    <action name="removeMessageRedirect"  class="org.hisp.dhis.dashboard.message.action.RemoveMessageAction">
+      <result name="success" type="redirect">message.action</result>
+    </action>
+    
   </package>
 </struts>

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js	2011-04-01 13:46:34 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/message.js	2011-04-01 19:47:09 +0000
@@ -1,4 +1,9 @@
 
 function organisationUnitSelected( units )
 {
-}
\ No newline at end of file
+}
+
+function removeMessage( id )
+{
+    removeItem( id, "", "Are you sure you want to delete this message?", "removeMessage.action" );
+}

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/message.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/message.vm	2011-04-01 15:44:51 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/message.vm	2011-04-01 19:47:09 +0000
@@ -3,19 +3,22 @@
 
 <div style="margin-bottom:15px"><input type="button" value="$i18n.getString( 'new_message' )" onclick="window.location.href='showSendMessage.action'"></div>
 
-<table class="listTable" style="width:75%">
+<table style="width:75%">
 	<tr>
 		<th>$i18n.getString( "sender" )</th>
 		<th>$i18n.getString( "date" )</th>
 		<th>$i18n.getString( "subject" )</th>
-		<th></th>
+		<th>$i18n.getString( "operations" )</th>
 	</tr>
 	#foreach( $message in $messages )
-	<tr>
-		<td style="width:28%">$encoder.htmlEncode( $message.message.sender )</td>
-		<td style="width:10%">$format.formatDate( $message.messageDate )</td>
-		<td style="width:70%">$encoder.htmlEncode( $message.message.subject )</td>
-		<td style="width:2%"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"/>
+	<tr id="tr${message.id}" style="#if( !$message.read )font-weight:bold;background-color:#ebf0f6;#end">
+		<td>$encoder.htmlEncode( $message.message.sender.name )</td>
+		<td style="width:80px">$format.formatDate( $message.messageDate )</td>
+		<td><a href="readMessage.action?id=${message.id}">$encoder.htmlEncode( $message.message.subject )</a></td>
+		<td style="width:70px; text-align:center;">
+			<a href="readMessage.action?id=${message.id}"><img src="../images/read.png" title="$i18n.getString( 'read' )"></a>
+			<a href="javascript:removeMessage( '${message.id}' )"><img src="../images/delete.png" title="$i18n.getString( 'delete' )"></a>
+		</td>
 	</tr>
 	#end
 </table>
\ No newline at end of file

=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/readMessage.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/readMessage.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/readMessage.vm	2011-04-01 19:47:09 +0000
@@ -0,0 +1,12 @@
+
+<h3>$encoder.htmlEncode( $message.message.subject )</h3>
+
+<div style="margin-bottom:20px; width:50%; font-weight:bold;">$encoder.htmlEncode( $message.message.sender.name ) - $format.formatDate( $message.messageDate )</div>
+
+<div style="margin-bottom:20px; width:50%;">$encoder.htmlEncode( $message.message.text )</div>
+
+<div>
+<input type="button" value="$i18n.getString( 'back' )" onclick="window.location.href='message.action'" style="width:120px">
+<input type="button" value="$i18n.getString( 'mark_unread' )" onclick="window.location.href='unreadMessage.action?id=${message.id}'" style="width:120px">
+<input type="button" value="$i18n.getString( 'remove' )" onclick="window.location.href='removeMessageRedirect.action?id=${message.id}'" style="width:120px">
+</div>
\ No newline at end of file