← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12953: support special characters in SMS command

 

------------------------------------------------------------
revno: 12953
committer: Lai <lai.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-11-15 16:01:08 +0700
message:
  support special characters in SMS command
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DataValueSMSListener.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-core/src/main/java/org/hisp/dhis/sms/DataValueSMSListener.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DataValueSMSListener.java	2013-11-12 08:46:01 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/sms/DataValueSMSListener.java	2013-11-15 09:01:08 +0000
@@ -348,11 +348,11 @@
 
             if ( StringUtils.equals( dv.getDataElement().getType(), DataElement.VALUE_TYPE_BOOL ) )
             {
-                if ( "Y".equals( value.toUpperCase() ) || "YES".equals( value.toUpperCase() ) )
+                if ( "Y".equals( value.toUpperCase() ) || "YES".equals( value.toUpperCase() ) || "1".equals( value ) )
                 {
                     value = "true";
                 }
-                else if ( "N".equals( value.toUpperCase() ) || "NO".equals( value.toUpperCase() ) )
+                else if ( "N".equals( value.toUpperCase() ) || "NO".equals( value.toUpperCase() ) || "0".equals( value ) )
                 {
                     value = "false";
                 }
@@ -361,6 +361,15 @@
             {
                 try
                 {
+                    if( value.equals( "l" ) )
+                    {
+                        value = "1";
+                    }
+                    else if( value.equals( "o" ) )
+                    {
+                        value = "0";
+                    }
+                        
                     Integer.parseInt( value );
                 }
                 catch ( NumberFormatException e )