dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21686
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10335: Add authorities for action of dhis-web-sms.
------------------------------------------------------------
revno: 10335
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-03-20 11:23:51 +0700
message:
Add authorities for action of dhis-web-sms.
modified:
dhis-2/dhis-web/dhis-web-sms/src/main/resources/org/hisp/dhis/sms/i18n_module.properties
dhis-2/dhis-web/dhis-web-sms/src/main/resources/struts.xml
dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/css/patient.css
dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/javascript/sendSMS.js
dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/patientRegistrationList.vm
dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/sendBeneficiarySMSPage.vm
dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/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
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/resources/org/hisp/dhis/sms/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-sms/src/main/resources/org/hisp/dhis/sms/i18n_module.properties 2013-03-19 05:39:35 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/resources/org/hisp/dhis/sms/i18n_module.properties 2013-03-20 04:23:51 +0000
@@ -65,7 +65,6 @@
show_send_sms_form=Send SMS
test_sms_input=Test SMS input
send_sms=Send SMS
-send_sms_beneficiary=Send SMS to Person
phone_number=Phone number
raw_phone_number=Raw phone numbers
assigned_user_number=User assigned to organisation unit
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-sms/src/main/resources/struts.xml 2013-03-19 05:39:35 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/resources/struts.xml 2013-03-20 04:23:51 +0000
@@ -5,26 +5,23 @@
<struts>
<include file="dhis-web-commons.xml" />
- <package name="dhis-web-sms" extends="dhis-web-commons"
+ <package name="dhis-web-sms" extends="dhis-web-commons"
namespace="/sms">
- <action name="index"
- class="org.hisp.dhis.sms.action.NoAction">
+ <action name="index" class="org.hisp.dhis.sms.action.NoAction">
<result name="success" type="redirect">
showSendingSMSForm.action
</result>
</action>
- <action name="testSMS"
- class="org.hisp.dhis.sms.action.NoAction">
+ <action name="testSMS" class="org.hisp.dhis.sms.action.NoAction">
<result name="success" type="velocity">
/dhis-web-sms/main.vm
</result>
<param name="page">/dhis-web-sms/testsms.vm</param>
</action>
- <action name="smsinput"
- class="org.hisp.dhis.sms.input.SMSInput">
+ <action name="smsinput" class="org.hisp.dhis.sms.input.SMSInput">
<result name="success" type="velocity">
/dhis-web-sms/smssuccess.vm
</result>
@@ -41,12 +38,13 @@
<param name="page">/dhis-web-sms/sendSMSPage.vm</param>
<param name="menu">/dhis-web-sms/menu.vm</param>
<param name="javascripts">
- ../dhis-web-commons/oust/oust.js,../dhis-web-sms/javascript/sendSMS.js
- </param>
+ ../dhis-web-commons/oust/oust.js,
+ ../dhis-web-sms/javascript/sendSMS.js
+ </param>
+ <param name="stylesheets">../dhis-web-sms/css/patient.css</param>
<param name="requiredAuthorities">F_MOBILE_SENDSMS</param>
</action>
-
<action name="showBeneficiarySMSForm"
class="org.hisp.dhis.sms.outcoming.ShowSendSMSBeneficiaryFormAction">
<result name="success" type="velocity">/main.vm</result>
@@ -54,22 +52,17 @@
/dhis-web-sms/sendBeneficiarySMSPage.vm
</param>
<param name="menu">/dhis-web-sms/menuWithTree.vm</param>
- <param name="stylesheets">../dhis-web-sms/css/patient.css</param>
- <param name="javascripts">
- ../dhis-web-commons/ouwt/ouwt.js
- </param>
- <param name="requiredAuthorities">F_MOBILE_SENDSMS</param>
+ <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js</param>
+ <param name="stylesheets">../dhis-web-sms/css/patient.css</param>
+ <param name="requiredAuthorities">F_MOBILE_SENDSMS,F_PATIENT_SEARCH</param>
</action>
- <action name="searchRegistrationPatient"
- class="org.hisp.dhis.sms.outcoming.SearchPatientAction">
+ <action name="searchRegistrationPatient" class="org.hisp.dhis.sms.outcoming.SearchPatientAction">
<result name="success" type="velocity">/content.vm</result>
<param name="page">
/dhis-web-sms/patientRegistrationList.vm
- </param>
- <param name="requiredAuthorities">
- F_PATIENT_MANAGEMENT
- </param>
+ </param>
+ <param name="requiredAuthorities">F_PATIENT_SEARCH</param>
</action>
<action name="sendSMS"
@@ -83,13 +76,12 @@
<param name="onExceptionReturn">plainTextError</param>
<param name="requiredAuthorities">F_MOBILE_SENDSMS</param>
</action>
-
-
- <action name="searchAllFacilities"
- class="org.hisp.dhis.sms.action.NoAction">
- <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
- <param name="requiredAuthorities">F_SEARCH_PATIENT_IN_ALL_FACILITIES</param>
- </action>
+
+ <action name="searchAllFacilities" class="org.hisp.dhis.sms.action.NoAction">
+ <result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm
+ </result>
+ <param name="requiredAuthorities">F_SEARCH_PATIENT_IN_ALL_FACILITIES</param>
+ </action>
</package>
</struts>
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/css/patient.css'
--- dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/css/patient.css 2013-03-19 05:39:35 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/css/patient.css 2013-03-20 04:23:51 +0000
@@ -14,21 +14,16 @@
width: 180px;
}
+.large-button
+{
+ width: 110px;
+}
+
.hidden
{
display:none;
}
-.overlaps
-{
- background-color: #BAFFBC;
- border: 1px solid #12CD17;
- display: none;
- margin: 1em;
- padding: 1em;
- width: 500px;
-}
-
.advanced-search
{
position: relative;
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/javascript/sendSMS.js'
--- dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/javascript/sendSMS.js 2013-03-12 05:40:42 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/javascript/sendSMS.js 2013-03-20 04:23:51 +0000
@@ -23,9 +23,6 @@
}
else if ( _value == "user" || _value == "unit" )
{
- selectionTree.clearSelectedOrganisationUnits();
- selectionTree.buildSelectionTree();
-
showById( 'orgunitType' );
hideById( 'phoneType' );
hideById( 'trRawPhone' );
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/patientRegistrationList.vm'
--- dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/patientRegistrationList.vm 2013-03-19 05:39:35 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/patientRegistrationList.vm 2013-03-20 04:23:51 +0000
@@ -1,38 +1,12 @@
-<style>
- .overlaps
- {
- background-color: #BAFFBC;
- border: 1px solid #12CD17;
- display: none;
- margin: 1em;
- padding: 1em;
- width: 500px;
- }
-</style>
-<div class="overlaps" style="display:block;">
- <table>
- <tr>
- <td class='text-column' ><strong>$i18n.getString( "search_result_matching_the_search_criteria" ):</strong></td>
- <td> </td>
- <td> </td>
- <td>
- #if( $!listAll )
- $i18n.getString( "list_all_patients" )
- #else
- $i18n.getString( "search_patients_by_attributes" )
- #end
- </td>
- </tr>
-
- <tr>
- <td class='text-column' ><strong>$i18n.getString( "total_result" ):</strong></td>
- <td> </td>
- <td> </td>
- <td>$!total</td>
- </tr>
- </table>
-</div>
+<table>
+ <tr>
+ <td class='text-column'>$i18n.getString( "total_result" ):</td>
+ <td> </td>
+ <td> </td>
+ <td>$!total</td>
+ </tr>
+</table>
#if( $patients.size() > 0 )
<table class="mainPageTable">
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/sendBeneficiarySMSPage.vm'
--- dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/sendBeneficiarySMSPage.vm 2013-03-19 05:39:35 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/sendBeneficiarySMSPage.vm 2013-03-20 04:23:51 +0000
@@ -26,23 +26,25 @@
}
</style>
-<h3>$i18n.getString( "send_sms_beneficiary" )</h3>
+<h3>$i18n.getString( "send_sms" )</h3>
#if ( $!gatewayMap && $!gatewayMap.size() > 0 )
<div>
<form id="sendSMSForm" name="sendSMSForm" action="sendSMS.action" onsubmit="selectAllById('recipients')">
<input type="hidden" id="orgunitId" name="orgunitId" />
<table id="detailsList">
- <col width="85px"/>
+ <col width="100px"/>
<tbody>
<tr>
- <td>$i18n.getString( "send_sms_to_target" ):<td>
+ <td>$i18n.getString( "send_sms_to_target" )<td>
<td>
<select id="sendTarget" name="sendTarget" onchange="javascript:toggleBasicSMSGUI( this.value );">
<option value="phone">$i18n.getString( "raw_phone_number" )</option>
<option value="userGroup">$i18n.getString( "user_group" )</option>
<option value="user">$i18n.getString( "assigned_user_number" )</option>
<option value="unit">$i18n.getString( "stakeholder_contact_person" )</option>
+ #if( $auth.hasAccess( "dhis-web-sms", "showBeneficiarySMSForm" ) )
<option value="patient" selected="true">$i18n.getString( "patients_registered" )</option>
+ #end
</select>
</td>
</tr>
@@ -60,17 +62,17 @@
<tr><th colspan="2">$i18n.getString( "phone_number" )</th></tr>
<tr>
<td colspan="2">
- <select id="recipients" name="recipients" multiple="true" style="width:50em;height:10em" class="{validate:{required:true}}"
+ <select id="recipients" name="recipients" multiple="true" size='10' style="width:600px" class="{validate:{required:true}}"
ondblclick="removePhoneFromList( 'recipients', this.value );"></select>
</td>
</tr>
<tr><th colspan="2">$i18n.getString( "message" ) ($i18n.getString( "do_not_send_patient_confidential_messages_using_sms" ))</th></tr>
- <tr><td colspan="2"><textarea id="smsMessage" name="smsMessage" cols="95" rows="5" class="{validate:{required:true}}"></textarea></td></tr>
+ <tr><td colspan="2"><textarea id="smsMessage" name="smsMessage" rows="5" style="width:600px;" class="{validate:{required:true}}"></textarea></td></tr>
</tbody>
<tbody>
- <tr><td><input type="submit" name="send" value="$i18n.getString( 'send_sms' )" /></td></tr>
+ <tr><td><input type="submit" class='large-button' name="send" value="$i18n.getString( 'send' )" /></td></tr>
</tbody>
</table>
</form>
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/sendSMSPage.vm'
--- dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/sendSMSPage.vm 2013-03-19 05:52:08 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/sendSMSPage.vm 2013-03-20 04:23:51 +0000
@@ -1,20 +1,16 @@
<script type="text/javascript">
jQuery(document).ready( function() {
validation( "sendSMSForm", function( form ) { sendSMSMessage( form ); } );
-
selectionTreeSelection.setListenerFunction( selectedOrganisationUnitSendSMS );
-
+
var target = '${sendTo}';
-
jQuery( "#sendTarget > option" ).each( function( i, item )
{
if ( item.value == target )
{
-
item.selected = true;
}
} );
-
toggleSMSGUI( target );
});
@@ -39,22 +35,24 @@
#if ( $!gatewayMap && $!gatewayMap.size() > 0 )
<form id="sendSMSForm" name="sendSMSForm" action="sendSMS.action" >
<table id="detailsList">
- <col width="90px"/>
+ <col width="100px"/>
<tbody>
<tr>
- <td>$i18n.getString( "send_sms_to_target" ):</td>
+ <td>$i18n.getString( "send_sms_to_target" )</td>
<td>
<select id="sendTarget" name="sendTarget" onchange="javascript:toggleSMSGUI( this.value );">
<option value="phone">$i18n.getString( "raw_phone_number" )</option>
<option value="userGroup">$i18n.getString( "user_group" )</option>
<option value="user">$i18n.getString( "assigned_user_number" )</option>
<option value="unit">$i18n.getString( "stakeholder_contact_person" )</option>
- <option value="patient">$i18n.getString( "patients_registered" )</option>
+ #if( $auth.hasAccess( "dhis-web-sms", "showBeneficiarySMSForm" ) )
+ <option value="patient" selected="true">$i18n.getString( "patients_registered" )</option>
+ #end
</select>
</td>
</tr>
<tr id="trUserGroup" style="display:none">
- <td>$i18n.getString( "user_group" ):</td>
+ <td>$i18n.getString( "user_group" )</td>
<td>
<select id="userGroup" name="userGroup">
#foreach( $group in $userGroups )
@@ -64,16 +62,20 @@
</td>
</tr>
<tr id="trRawPhone">
- <td>$i18n.getString( "phone_number" ):</td>
- <td><input type="text" id="recipient" name="recipient" style="width:65%"/></td>
- </tr>
-
- <tr id="orgunitType" style="display:none"><td colspan="2"><br/>#organisationUnitSelectionTree( true, true, false )</td></tr>
+ <td>$i18n.getString( "phone_number" )</td>
+ <td><input type="text" id="recipient" name="recipient" /></td>
+ </tr>
+
+ <tr id="orgunitType" style="display:none">
+
+ <td colspan="2">
+ #organisationUnitSelectionTree( true, true, false )
+ </tr>
<tr><th colspan="2">$i18n.getString( "message" ) ($i18n.getString( "do_not_send_patient_confidential_messages_using_sms" ))</th></tr>
- <tr><td colspan="2"><textarea id="smsMessage" name="smsMessage" cols="86" rows="5" class="{validate:{required:true}}"></textarea></td></tr>
+ <tr><td colspan="2"><textarea id="smsMessage" name="smsMessage" rows="5" style="width:544px;" class="{validate:{required:true}}"></textarea></td></tr>
<tr>
- <td><input type="submit" name="send" value="$i18n.getString( 'send_sms' )"/>
+ <td><input type="submit" class='large-button' name="send" value="$i18n.getString( 'send' )"/>
</tr>
</tbody>
</table>