← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10841: fix sms notification bug, minor change

 

------------------------------------------------------------
revno: 10841
committer: Lai <lai.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-05-15 11:10:55 +0700
message:
  fix sms notification bug, minor change
modified:
  dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/OutboundSmsServiceImpl.java
  dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsMessageSender.java
  dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsSender.java
  dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/smslib/SmsLibService.java
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/settings/userGeneralSettings.vm
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveProgramStageFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/incoming/ReceivingSMSAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/receiveSMSPage.vm
  dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/ProcessingSendSMSAction.java


--
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-sms/src/main/java/org/hisp/dhis/sms/outbound/OutboundSmsServiceImpl.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/OutboundSmsServiceImpl.java	2012-10-22 08:51:28 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/OutboundSmsServiceImpl.java	2013-05-15 04:10:55 +0000
@@ -146,7 +146,9 @@
     {
         try
         {
-            return transportService.sendMessage( sms, id );
+            String message = transportService.sendMessage( sms, id );
+            
+            return message;
         }
         catch ( SmsServiceException e )
         {

=== modified file 'dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsMessageSender.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsMessageSender.java	2013-03-13 14:14:24 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsMessageSender.java	2013-05-15 04:10:55 +0000
@@ -60,7 +60,7 @@
     /**
      * Note this methods is invoked asynchronously.
      */
-    @Async
+    //@Async
     @SuppressWarnings( "unchecked" )
     public String sendMessage( String subject, String text, User sender, boolean isPhone, Set<?> recipients,
         String gatewayId )

=== modified file 'dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsSender.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsSender.java	2013-05-09 17:21:51 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/outbound/SmsSender.java	2013-05-15 04:10:55 +0000
@@ -49,7 +49,7 @@
 public class SmsSender
     implements MessageSender
 {
-    private static final Log log = LogFactory.getLog( SmsMessageSender.class );
+    private static final Log log = LogFactory.getLog( SmsSender.class );
     
     // -------------------------------------------------------------------------
     // Dependencies
@@ -112,7 +112,7 @@
             {
                 text = createMessage( subject, text, sender );
                 
-                phoneNumbers = getRecipientsPhoneNumber( users );
+                phoneNumbers = getRecipientsPhoneNumber( toSendUserList );
                 
                 if ( !phoneNumbers.isEmpty() && phoneNumbers.size() > 0 )
                 {
@@ -147,7 +147,7 @@
 
         text = "From " + name + subject + ": " + text;
 
-        // Simplistic cutoff 160 characters
+        // Simplistic cut off 160 characters
         int length = text.length();
 
         return (length > 160) ? text.substring( 0, 157 ) + "..." : text;

=== modified file 'dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/smslib/SmsLibService.java'
--- dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/smslib/SmsLibService.java	2013-05-14 11:32:11 +0000
+++ dhis-2/dhis-services/dhis-service-sms/src/main/java/org/hisp/dhis/sms/smslib/SmsLibService.java	2013-05-15 04:10:55 +0000
@@ -218,7 +218,7 @@
         {
             outboundSmsStore.update( sms );
         }
-
+        
         return message;
     }
 

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/settings/userGeneralSettings.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/settings/userGeneralSettings.vm	2012-11-20 14:43:33 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/settings/userGeneralSettings.vm	2013-05-15 04:10:55 +0000
@@ -9,12 +9,20 @@
                 messageSmsNotification: jQuery( '#messageSmsNotification' ).is(':checked' )
 			}, function ( json ) {
 				if ( json.response == "success" )
+				{	
 					setHeaderDelayMessage( json.message );
+					//setTimeout( "refreshPage()", 4000);
+				}
 			});
 		});
 	});
+	
+	//function refreshPage()
+	//{
+		//window.location = "userSettings.action";
+	//};
+	
 </script>
-
 <h3>$i18n.getString( "settings" ) #openHelp( "userGeneralSettings" )</h3>
 
 <div class="settingLabel">$i18n.getString( "language" )</div>

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveProgramStageFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveProgramStageFormAction.java	2013-04-22 03:11:28 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveProgramStageFormAction.java	2013-05-15 04:10:55 +0000
@@ -613,6 +613,5 @@
                 }
             }
         }
-
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/incoming/ReceivingSMSAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/incoming/ReceivingSMSAction.java	2013-03-13 10:11:52 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/incoming/ReceivingSMSAction.java	2013-05-15 04:10:55 +0000
@@ -108,7 +108,7 @@
         }
         else
         {
-            pollingInterval = 0;
+            pollingInterval = 4000;
         }
         listIncomingSms = incomingSmsService.listAllMessageFromModem();
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/receiveSMSPage.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/receiveSMSPage.vm	2013-04-04 02:42:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/receiveSMSPage.vm	2013-05-15 04:10:55 +0000
@@ -55,7 +55,7 @@
 		
 		if( result != "")
 		{
-			var confirmation = window.confirm( "$i18n.getString( 'confirm_delete_items' )"+result );
+			var confirmation = window.confirm( "$i18n.getString( 'confirm_delete_items' )" );
 			if ( confirmation )
 			{
 				jQuery.get( 'deleteReceiveSMS.action?' + result, {},
@@ -177,8 +177,7 @@
 					<input type="hidden" id="$incomingSms.id" value="$incomingSms.text" onblur="makeVisible( $incomingSms.id, $velocityCount )"/></td>
 				<td>$incomingSms.originator</td>
 				<td>update</td>
-				<td style="text-align:center"><a href="javascript:removeSingleItem( '$incomingSms.id', '$incomingSms.getText()' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"/></td>
-				
+				<td style="text-align:center"><a href="javascript:removeSingleItem( '$incomingSms.id', '$incomingSms.getText()' )" title="$i18n.getString( 'remove' )"><img src="../images/delete.png" alt="$i18n.getString( 'remove' )"/></td>				
 			</tr>
 			#end
 		</tbody>

=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/ProcessingSendSMSAction.java'
--- dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/ProcessingSendSMSAction.java	2013-03-14 03:32:14 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/ProcessingSendSMSAction.java	2013-05-15 04:10:55 +0000
@@ -192,7 +192,6 @@
             {
                 e.printStackTrace();
             }
-
             message = messageSender.sendMessage( smsSubject, smsMessage, currentUser, true, recipients, gatewayId );
         }
         else if ( sendTarget.equals( "userGroup" ) )