← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3258: Impl sending of messages

 

------------------------------------------------------------
revno: 3258
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-04-01 15:46:34 +0200
message:
  Impl sending of messages
added:
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/NoAction.java
  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/menu.vm
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/sendMessage.vm
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/about/menu.vm
  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/SendMessageAction.java
  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/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-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2011-03-08 15:29:28 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2011-04-01 13:46:34 +0000
@@ -196,6 +196,7 @@
         executeSql( "ALTER TABLE validationrule ALTER description TYPE text" );
         executeSql( "ALTER TABLE expression ALTER expression TYPE text" );
         executeSql( "ALTER TABLE translation ALTER value TYPE text" );
+        executeSql( "ALTER TABLE organisationunit ALTER comment TYPE text" );
 
         // orgunit shortname uniqueness
         executeSql( "ALTER TABLE organisationunit DROP CONSTRAINT organisationunit_shortname_key" );

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/about/menu.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/about/menu.vm	2009-11-18 19:01:08 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/about/menu.vm	2011-04-01 13:46:34 +0000
@@ -1,7 +1,6 @@
 
 #if ( $flag )
-    <img src="../dhis-web-commons/flags/$flag" 
-      style="margin-top: 16px; margin-left: 16px; border: 1px solid #D0D0D0;">
+<img src="../dhis-web-commons/flags/$flag" style="margin-top: 16px; margin-left: 16px; border: 1px solid #D0D0D0;">
 #end
 
 <h2>$i18n.getString( "dhis2_online" )&nbsp;</h2>

=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/NoAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/NoAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/action/NoAction.java	2011-04-01 13:46:34 +0000
@@ -0,0 +1,43 @@
+package org.hisp.dhis.dashboard.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 com.opensymphony.xwork2.Action;
+
+/**
+ * @author Lars Helge Overland
+ */
+public class NoAction
+    implements Action
+{
+    public String execute()
+        throws Exception
+    {
+        return SUCCESS;
+    }
+}

=== 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-03-31 16:28:24 +0000
+++ 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
@@ -68,7 +68,7 @@
 
     public String execute()
     {
-        messages = messageService.getUserMessages( 1, 1000 );
+        messages = messageService.getUserMessages( 1, 200 );
         
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/SendMessageAction.java'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/SendMessageAction.java	2011-04-01 11:33:40 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/message/action/SendMessageAction.java	2011-04-01 13:46:34 +0000
@@ -32,7 +32,6 @@
 
 import org.hisp.dhis.message.Message;
 import org.hisp.dhis.message.MessageService;
-import org.hisp.dhis.message.UserMessage;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.oust.manager.SelectionTreeManager;
 import org.hisp.dhis.user.CurrentUserService;
@@ -101,7 +100,7 @@
         
         Set<User> users = new HashSet<User>();
         
-        for ( OrganisationUnit unit : selectionTreeManager.getSelectedOrganisationUnits() )
+        for ( OrganisationUnit unit : selectionTreeManager.getReloadedSelectedOrganisationUnits() )
         {
             users.addAll( unit.getUsers() );
         }

=== 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-03-31 15:54:20 +0000
+++ 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
@@ -20,4 +20,7 @@
 date = Date
 subject = Subject
 remove = Remove
-new_message = New message
\ No newline at end of file
+new_message = New message
+create_new_message = Create new message
+details = Details
+recipient = Recipient
\ 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-03-31 16:28:24 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/struts.xml	2011-04-01 13:46:34 +0000
@@ -13,7 +13,7 @@
     <action name="index" class="org.hisp.dhis.dashboard.action.ProvideContentAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-dashboard-integration/mainForm.vm</param>
-      <param name="menu">/dhis-web-commons/about/menu.vm</param>
+      <param name="menu">/dhis-web-dashboard-integration/menu.vm</param>
       <param name="stylesheets">style/dashboard.css</param>
       <param name="javascripts">javascript/dropdown.js</param>
     </action>
@@ -60,12 +60,19 @@
     <action name="message" class="org.hisp.dhis.dashboard.message.action.GetMessagesAction">
       <result name="success" type="velocity">/main.vm</result>
       <param name="page">/dhis-web-dashboard-integration/message.vm</param>
-      <param name="menu">/dhis-web-commons/about/menu.vm</param>
+      <param name="menu">/dhis-web-dashboard-integration/menu.vm</param>
     </action>
     
     <action name="sendMessage" class="org.hisp.dhis.dashboard.message.action.SendMessageAction">
       <result name="success" type="redirect">message.action</result>
     </action>
     
+    <action name="showSendMessage" class="org.hisp.dhis.dashboard.action.NoAction">
+      <result name="success" type="velocity">/main.vm</result>
+      <param name="page">/dhis-web-dashboard-integration/sendMessage.vm</param>
+      <param name="menu">/dhis-web-dashboard-integration/menu.vm</param>
+      <param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/message.js</param>
+    </action>
+    
   </package>
 </struts>

=== added 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	1970-01-01 00:00:00 +0000
+++ 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
@@ -0,0 +1,4 @@
+
+function organisationUnitSelected( units )
+{
+}
\ No newline at end of file

=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/menu.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/menu.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/menu.vm	2011-04-01 13:46:34 +0000
@@ -0,0 +1,18 @@
+
+#if ( $flag )
+<img src="../dhis-web-commons/flags/$flag" style="margin-top: 16px; margin-left: 16px; border: 1px solid #D0D0D0;">
+#end
+
+<h2>$i18n.getString( "dashboard" )&nbsp;</h2>
+
+<ul>
+	<li><a href="index.action">$i18n.getString( "dashboard" )&nbsp;</a></li>
+	<li><a href="showSendMessage.action">$i18n.getString( "messages" )&nbsp;</a></li>
+</ul>
+
+<h2>$i18n.getString( "dhis2_online" )&nbsp;</h2>
+
+<ul>
+	<li><a href="http://dhis2.org"; target="_blank">$i18n.getString( "dhis2_home_page" )&nbsp;</a></li>
+	<li><a href="https://launchpad.net/dhis2"; target="_blank">$i18n.getString( "dhis2_issue_tracking" )&nbsp;</a></li>
+</ul>

=== 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-03-31 15:54:20 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/message.vm	2011-04-01 13:46:34 +0000
@@ -1,7 +1,7 @@
 
 <h3>$i18n.getString( "messages" )</h3>
 
-<div style="margin-bottom:15px"><input type="button" value="$i18n.getString( 'new_message' )"></div>
+<div style="margin-bottom:15px"><input type="button" value="$i18n.getString( 'new_message' )" onclick="window.location.href='message.action'"></div>
 
 <table class="listTable" style="width:75%">
 	<tr>

=== added file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/sendMessage.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/sendMessage.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/sendMessage.vm	2011-04-01 13:46:34 +0000
@@ -0,0 +1,43 @@
+
+<h3>$i18n.getString( "create_new_message" )</h3>
+
+<form action="sendMessage.action" method="post">
+
+<table>
+
+<tr>
+<th colspan="2">$i18n.getString( "details" )</th>
+</tr>
+
+<tr>
+<td style="min-width:80px">$i18n.getString( "recipient" )</td>
+<td>
+<div id="selectionTree" style="width:325px; height:200px"></div>	            
+<script type="text/javascript">
+  selectionTreeSelection.setMultipleSelectionAllowed( true );
+  selectionTreeSelection.setListenerFunction( organisationUnitSelected );
+  selectionTree.clearSelectedOrganisationUnits();
+  selectionTree.buildSelectionTree();
+</script>
+</td>
+</tr>
+
+<tr>
+<td>$i18n.getString( "subject" )</td>
+<td><input type="text" name="subject" style="width:400px"></td>
+</tr>
+
+<tr>
+<td>$i18n.getString( "text" )</td>
+<td><textarea name="text" style="width:400px;height:400px"></textarea></td>
+</tr>
+
+<tr>
+<td></td>
+<td><input type="submit" value="$i18n.getString( 'send' )" style="width:120px">
+<input type="button" value="$i18n.getString( 'cancel' )"  style="width:120px" onclick="window.location.href='message.action'"></td>
+</tr>
+
+</table>
+
+</form>
\ No newline at end of file