dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #14842
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5153: add UI addGateway.vm
------------------------------------------------------------
revno: 5153
committer: Long <thanhlongngo1988>
branch nick: dhis2
timestamp: Mon 2011-11-14 15:57:13 +0700
message:
add UI addGateway.vm
added:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/AddGateWayConfigAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/addGateway.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/javascript/gateway.js
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/org/hisp/dhis/mobile/i18n_module.properties
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/smsServiceConfiguration.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/AddGateWayConfigAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/AddGateWayConfigAction.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/AddGateWayConfigAction.java 2011-11-14 08:57:13 +0000
@@ -0,0 +1,12 @@
+package org.hisp.dhis.mobile.action;
+
+import com.opensymphony.xwork2.Action;
+
+public class AddGateWayConfigAction implements Action {
+
+ @Override
+ public String execute() throws Exception {
+ 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 2011-11-08 08:30:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/META-INF/dhis/beans.xml 2011-11-14 08:57:13 +0000
@@ -40,6 +40,8 @@
<!-- SMS Service Configuration -->
<bean id="org.hisp.dhis.mobile.action.ShowMobileConfigurationFormAction" class="org.hisp.dhis.mobile.action.ShowMobileConfigurationFormAction"
scope="prototype"/>
+
+ <bean id="org.hisp.dhis.mobile.action.AddGateWayConfigAction" class="org.hisp.dhis.mobile.action.AddGateWayConfigAction" scope="prototype"/>
<!-- JAX-RS resources -->
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/org/hisp/dhis/mobile/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/org/hisp/dhis/mobile/i18n_module.properties 2011-11-08 08:30:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/org/hisp/dhis/mobile/i18n_module.properties 2011-11-14 08:57:13 +0000
@@ -28,4 +28,21 @@
operation = Operation
gateway_type = Gateway Type
-send_sms = Send SMS
\ No newline at end of file
+send_sms = Send SMS
+
+add_gateway = Add Gateway
+gateway_type = Gateway Type
+type = Type
+gateway_configuration = Gateway Configuration
+gateway_name = Gateway Name
+username = Username
+password = Password
+port = Port
+baudrate = BaudRate
+manufacturer = Manufacturer
+model = Model
+pin = PIN
+inbound = Inbound
+outbound = Outbound
+api_id = API ID
+save_settings = Save Settings
=== 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-08 08:30:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/struts.xml 2011-11-14 08:57:13 +0000
@@ -60,7 +60,13 @@
<result name="success" type="velocity">/main.vm</result>
<param name="page">/dhis-web-maintenance-mobile/smsServiceConfiguration.vm</param>
<param name="menu">/dhis-web-maintenance-mobile/menu.vm</param>
- </action>
+ </action>
+
+ <action name="addGateWayConfig" class="org.hisp.dhis.mobile.action.AddGateWayConfigAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-maintenance-mobile/addGateway.vm</param>
+ <param name="menu">/dhis-web-maintenance-mobile/menu.vm</param>
+ </action>
</package>
</struts>
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/addGateway.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/addGateway.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/addGateway.vm 2011-11-14 08:57:13 +0000
@@ -0,0 +1,107 @@
+<script type="text/javascript" src="javascript/gateway.js"></script>
+<script type="text/javascript">
+ $(document).ready(function() {
+ changeValueType("modem");
+ });
+</script>
+<h3>$i18n.getString("add_gateway")</h3>
+<form id="add" name="addGateWayConfig" action="addGateWayConfig.action" method="post" >
+ <table id="detailsList">
+ <tr>
+ <th colspan="2">$i18n.getString("gateway_type")</th>
+ </tr>
+ <tr>
+ <td>$i18n.getString("type"):</td>
+ <td>
+ <select style="width: 100%;" onchange="changeValueType( this.value )">
+ <option value="modem">Modem</option>
+ <option value="clickatell">Clickatell</option>
+ <option value="bulksms">BulkSMS</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <th colspan="2">$i18n.getString("gateway_configuration")</th>
+ </tr>
+ <tbody id="modemFields">
+ <tr>
+ <td>$i18n.getString("gateway_name"):</td>
+ <td><input type="text" name="name" id="name" style="width: 28em" /></td>
+ </tr>
+ <tr>
+ <td>$i18n.getString("port"):</td>
+ <td><input type="text" name="port" id="port" style="width: 28em" /></td>
+ </tr>
+ <tr>
+ <td>$i18n.getString("baudrate"):</td>
+ <td><input type="text" name="port" id="port" style="width: 28em" /></td>
+ </tr>
+ <tr>
+ <td>$i18n.getString("manufacturer"):</td>
+ <td><input type="text" name="manufacturer" id="manufacturer" style="width: 28em" /></td>
+ </tr>
+ <tr>
+ <td>$i18n.getString("model"):</td>
+ <td><input type="text" name="model" id="model" style="width: 28em" /></td>
+ </tr>
+ <tr>
+ <td>$i18n.getString("pin"):</td>
+ <td><input type="text" name="pin" id="pin" style="width: 28em" /></td>
+ </tr>
+ <tr>
+ <td>$i18n.getString("inbound"):</td>
+ <td>
+ <select style="width: 100%;">
+ <option value="true">$i18n.getString("yes")</option>
+ <option value="false">$i18n.getString("no")</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>$i18n.getString("outbound"):</td>
+ <td>
+ <select style="width: 100%;">
+ <option value="true">$i18n.getString("yes")</option>
+ <option value="false">$i18n.getString("no")</option>
+ </select>
+ </td>
+ </tr>
+ </tbody>
+ <tbody id="bulksmsFields">
+ <tr>
+ <td>$i18n.getString("gateway_name"):</td>
+ <td><input type="text" name="name" id="name" style="width: 28em" /></td>
+ </tr>
+ <tr>
+ <td>$i18n.getString("username")::</td>
+ <td><input type="text" name="username" id="username" style="width: 28em" /></td>
+ </tr>
+ <tr>
+ <td>$i18n.getString("password"):</td>
+ <td><input type="text" name="password" id="password" style="width: 28em" /></td>
+ </tr>
+ </tbody>
+ <tbody id="clickatellFields">
+ <tr>
+ <td>$i18n.getString("gateway_name"):</td>
+ <td><input type="text" name="name" id="name" style="width: 28em" /></td>
+ </tr>
+ <tr>
+ <td>$i18n.getString("username")::</td>
+ <td><input type="text" name="username" id="username" style="width: 28em" /></td>
+ </tr>
+ <tr>
+ <td>$i18n.getString("password")::</td>
+ <td><input type="text" name="password" id="password" style="width: 28em" /></td>
+ </tr>
+ <tr>
+ <td>$i18n.getString("api_id")::</td>
+ <td><input type="text" name="apiid" id="apiid" style="width: 28em" /></td>
+ </tr>
+ </tbody>
+ <tr>
+ <td colspan="2" align="right"><input type="button" name="save" value="$i18n.getString('save_settings')"/><input type="button" name="back" value="$i18n.getString('back'):"/></td>
+ </tr>
+ </table>
+</form>
+
=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/javascript/gateway.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/javascript/gateway.js 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/javascript/gateway.js 2011-11-14 08:57:13 +0000
@@ -0,0 +1,21 @@
+function changeValueType( value )
+{
+ hideAll();
+ if ( value == 'modem')
+ {
+ showById( "modemFields" );
+ } else if (value == 'bulksms')
+ {
+ showById( "bulksmsFields" );
+ } else
+ {
+ showById( "clickatellFields" );
+ }
+}
+
+function hideAll()
+{
+ hideById( "modemFields" );
+ hideById( "bulksmsFields" );
+ hideById( "clickatellFields" );
+}
\ 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/smsServiceConfiguration.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/smsServiceConfiguration.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/smsServiceConfiguration.vm 2011-11-14 08:57:13 +0000
@@ -53,7 +53,7 @@
<td><input type="text" id="serverPhoneNumber" name="serverPhoneNumber" style="width:20em" value="$smsConfig.longNumber"></td>
</tr>
<tr>
- <td align="right" colspan="2"><input type="button" value="$i18n.getString('add')"/></td>
+ <td align="right" colspan="2"><input type="button" value="$i18n.getString('add')" onclick="window.location.href='addGateWayConfig.action'"/></td>
</tr>
<tr>
<td colspan="2">