← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6138: (mobile) Implemented user interface for sending SMS message.

 

------------------------------------------------------------
revno: 6138
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-02-29 17:11:21 +0700
message:
  (mobile) Implemented user interface for sending SMS message.
added:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/NoAction.java
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/menu.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/sendSMSPage.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
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/NoAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/NoAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/NoAction.java	2012-02-29 10:11:21 +0000
@@ -0,0 +1,42 @@
+package org.hisp.dhis.mobile.action;
+
+/*
+ * Copyright (c) 2004-2012, 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
+ */
+public class NoAction
+    implements Action
+{
+    public String execute()
+    {
+        return SUCCESS;
+    }
+}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/META-INF/dhis/beans.xml	2012-01-05 20:39:23 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/META-INF/dhis/beans.xml	2012-02-29 10:11:21 +0000
@@ -3,6 +3,9 @@
   xsi:schemaLocation="
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd";>
 
+  <bean id="org.hisp.dhis.mobile.action.NoAction" class="org.hisp.dhis.mobile.action.NoAction"
+    scope="prototype" />
+
   <bean id="org.hisp.dhis.mobile.action.MobileHomePageAction" class="org.hisp.dhis.mobile.action.MobileHomePageAction"
     scope="prototype" />
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/struts.xml	2011-11-14 08:57:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/struts.xml	2012-02-29 10:11:21 +0000
@@ -22,6 +22,14 @@
       <param name="menu">/dhis-web-maintenance-mobile/menu.vm</param>
       <param name="requiredAuthorities">F_MOBILE_SENDSMS</param>
     </action>
+  
+	<action name="showSMSForm" class="org.hisp.dhis.mobile.action.NoAction">
+      <result name="success" type="velocity">/main.vm</result>
+      <param name="page">/dhis-web-maintenance-mobile/sendSMSPage.vm</param>
+      <param name="menu">/dhis-web-maintenance-mobile/menu.vm</param>
+      <param name="javascripts">../dhis-web-commons/oust/oust.js</param>
+	  <param name="requiredAuthorities">F_MOBILE_SENDSMS</param>
+    </action>
 
     <action name="mobileSettings" class="org.hisp.dhis.mobile.action.MobileSettingsAction">
       <result name="success" type="velocity">/main.vm</result>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/menu.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/menu.vm	2011-11-08 08:30:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/menu.vm	2012-02-29 10:11:21 +0000
@@ -3,6 +3,6 @@
 <!--    <li><a href = "mobileSettings.action">Settings</a></li>-->
 	<li><a href="patientMobileSetting.action">$i18n.getString( "patient_mobile_setting" )</a></li>
 	<li><a href="showMobileDataSet.action">$i18n.getString( "mobile_dataset" )&nbsp;</a></li>
-    <li><a href = "sendSMS.action">$i18n.getString( "send_sms" )</a></li>
+    <li><a href = "showSMSForm.action">$i18n.getString( "show_send_sms_form" )</a></li>
     <li><a href = "showSMSServiceConfiguration.action">$i18n.getString( "sms_service_configuration" )</a></li>
 </ul>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/sendSMSPage.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/sendSMSPage.vm	2011-11-08 08:30:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/sendSMSPage.vm	2012-02-29 10:11:21 +0000
@@ -9,17 +9,70 @@
 </style>
 
 <h3>Send SMS</h3>
-    #if ($smsServiceStatus)
-<div>
-    <form method="post">
-        <table>
-            <tr><td>Phone #:</td><td><input name="recipient" type="text"/></td></tr>
-            <tr><td></td><td><textarea name="msg" cols="50" rows="10"></textarea></td></tr>
-            <tr><td></td><td><input type="submit" name="send" value="Send SMS"/></td>
-        </table>
-    </form>
-<span id="message" style="display:#if($message.trim().equals(""))none #else block #end">$message</span>
+#if ( $smsServiceStatus )
+
+<form method="post">
+	<table id="detailsList">
+	    <col width="300px"/>
+		<col width="80px"/>
+		<tbody>
+			<tr>
+				<th colspan="2">$i18n.getString( "gateway_type" )</th>
+			</tr>
+			<tr>
+				<td><label for="type">$i18n.getString( "type" ):</label></td>
+				<td>
+					<select style="width: 100%;">
+						<option value="0">Modem</option>
+						<option value="1">Clickatell</option>
+						<option value="2">BulkSMS</option>
+					</select>
+				</td>
+			</tr>
+			
+			<tr>
+				<td>$i18n.getString( "organisation_unit" )</td>
+				<td><input type="checkbox" onchange="toggleSMSGUI( this.checked );"/></td>
+			</tr>
+			
+			<tr><th colspan="2">$i18n.getString( "message" )</th></tr>
+			<tr><td colspan="2"><textarea name="smsMessage" cols="95" rows="10"></textarea></td></tr>
+		</tbody>
+	</table>
+
+	<table id="detailsList">
+		<col width="300px"/>
+		<col width="80px"/>
+		<tbody id="singleType">
+			<tr><th colspan="2">$i18n.getString( "phone" ):</th></tr>
+			<tr><td colspan="2"><input type="text" name="recipient" style="width:520px" /></td></tr>
+		</tbody>
+	
+		<tbody id="multipleType" style="display:none">
+			<tr><td>#organisationUnitSelectionTree( true, true, true )</td></tr>
+		</tbody>
+		
+		<tbody>
+			<tr><td><input type="submit" name="send" value="Send SMS"/></td></tr>
+		</tbody>
+	</table>
+</form>
 </div>
-    #else
-	<p>No Sms service available</p>
-    #end
+
+#parse( "dhis-web-commons/loader/loader.vm" )
+#else
+<p>No Sms service available</p>
+#end
+
+<script type="text/javascript">
+	function toggleSMSGUI( checked )
+	{
+		if ( checked ) {
+			hideById( 'singleType' );
+			showById( 'multipleType' );
+		} else {
+			showById( 'singleType' );
+			hideById( 'multipleType' );
+		}
+	}
+</script>
\ No newline at end of file