← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11967: support J2ME LWUIT

 

------------------------------------------------------------
revno: 11967
committer: Lai <lai.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2013-09-08 15:36:32 +0700
message:
  support J2ME LWUIT
modified:
  dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java
  dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/LWUITmodel/MobileModel.java
  dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java
  dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java
  dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/DefaultProgramService.java
  dhis-2/dhis-services/dhis-service-mobile/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitTest.java
  dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitsTest.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java
  dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileClientController.java
  dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.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/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/receiveSMSPage.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties


--
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-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java	2013-09-08 08:36:32 +0000
@@ -61,6 +61,9 @@
     public Patient findPatient( int patientId )
         throws NotAllowedException;
 
+    public Patient findPatientInAdvanced( String keyword, int orgUnitId, int programId )
+        throws NotAllowedException;
+
     public String saveProgramStage( ProgramStage programStage, int patientId, int orgUnitId )
         throws NotAllowedException;
 

=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/LWUITmodel/MobileModel.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/LWUITmodel/MobileModel.java	2013-09-03 15:04:30 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/LWUITmodel/MobileModel.java	2013-09-08 08:36:32 +0000
@@ -60,7 +60,6 @@
         else
         {
             dout.writeInt( programs.size() );
-            System.out.println( programs.size() );
             for ( Program prog : programs )
             {
                 prog.setClientVersion( DataStreamSerializable.TWO_POINT_TEN );

=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/model/MobileOrgUnitLinks.java	2013-09-08 08:36:32 +0000
@@ -82,6 +82,8 @@
     private String getVariesInfoUrl;
 
     private String findLatestPersonUrl;
+    
+    private String findPatientInAdvancedUrl;
 
     @XmlAttribute
     public int getId()
@@ -295,6 +297,16 @@
         this.findLatestPersonUrl = findLatestPersonUrl;
     }
 
+    public String getFindPatientInAdvancedUrl()
+    {
+        return findPatientInAdvancedUrl;
+    }
+
+    public void setFindPatientInAdvancedUrl( String findPatientInAdvancedUrl )
+    {
+        this.findPatientInAdvancedUrl = findPatientInAdvancedUrl;
+    }
+
     public void serialize( DataOutputStream dataOutputStream )
 
         throws IOException
@@ -319,6 +331,7 @@
         dataOutputStream.writeUTF( this.downloadAnonymousProgramUrl );
         dataOutputStream.writeUTF( this.findProgramUrl );
         dataOutputStream.writeUTF( this.findLatestPersonUrl );
+        dataOutputStream.writeUTF( this.findPatientInAdvancedUrl );
     }
 
     public void deSerialize( DataInputStream dataInputStream )
@@ -344,6 +357,7 @@
         this.downloadAnonymousProgramUrl = dataInputStream.readUTF();
         this.findProgramUrl = dataInputStream.readUTF();
         this.findLatestPersonUrl = dataInputStream.readUTF();
+        this.findPatientInAdvancedUrl = dataInputStream.readUTF();
     }
 
     @Override
@@ -402,5 +416,6 @@
         dataOutputStream.writeUTF( this.downloadAnonymousProgramUrl );
         dataOutputStream.writeUTF( this.findProgramUrl );
         dataOutputStream.writeUTF( this.findLatestPersonUrl );
+        dataOutputStream.writeUTF( this.findPatientInAdvancedUrl );
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java	2013-09-07 12:47:54 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java	2013-09-08 08:36:32 +0000
@@ -141,8 +141,6 @@
 
     private ProgramStageService programStageService;
 
-    private OrganisationUnitService orgUnitService;
-
     private org.hisp.dhis.mobile.service.ModelMapping modelMapping;
 
     private PatientIdentifierTypeService patientIdentifierTypeService;
@@ -1063,8 +1061,16 @@
                 mobileProgramStage.setReportDate( "" );
             }
 
-            mobileProgramStage.setReportDateDescription( programStageInstance.getProgramStage()
-                .getReportDateDescription() );
+            if ( programStageInstance.getProgramStage().getReportDateDescription() == null )
+            {
+                mobileProgramStage.setReportDateDescription( "Report Date" );
+            }
+            else
+            {
+                mobileProgramStage.setReportDateDescription( programStageInstance.getProgramStage()
+                    .getReportDateDescription() );
+            }
+
             // is repeatable
             mobileProgramStage.setRepeatable( eachProgramStage.getIrregular() );
 
@@ -1323,7 +1329,7 @@
     {
         String programsInfo = "";
 
-        OrganisationUnit organisationUnit = orgUnitService.getOrganisationUnit( orgUnitId );
+        OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( orgUnitId );
 
         List<Program> tempPrograms = new ArrayList<Program>(
             programService.getProgramsByCurrentUser( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
@@ -1632,12 +1638,6 @@
     }
 
     @Required
-    public void setOrgUnitService( OrganisationUnitService orgUnitService )
-    {
-        this.orgUnitService = orgUnitService;
-    }
-
-    @Required
     public void setProgramService( ProgramService programService )
     {
         this.programService = programService;
@@ -1865,8 +1865,64 @@
     public org.hisp.dhis.api.mobile.model.LWUITmodel.Patient findPatient( int patientId )
         throws NotAllowedException
     {
-        Patient patient = this.patientService.getPatient( patientId );
+        Patient patient = patientService.getPatient( patientId );
         org.hisp.dhis.api.mobile.model.LWUITmodel.Patient patientMobile = getPatientModel( patient );
         return patientMobile;
     }
+
+    @Override
+    public org.hisp.dhis.api.mobile.model.LWUITmodel.Patient findPatientInAdvanced( String keyword, int orgUnitId,
+        int programId )
+        throws NotAllowedException
+    {
+        Collection<Patient> patients = new HashSet<Patient>( patientService.getPatientsForMobile( keyword, orgUnitId ) );
+        OrganisationUnit orgUnit = organisationUnitService.getOrganisationUnit( orgUnitId );
+        if ( programId != 0 )
+        {
+            Program program = programService.getProgram( programId );
+            List<Patient> tempPatients = (List<Patient>) patientService.getPatients( orgUnit, program, null, null );
+            patients.retainAll( tempPatients );
+        }
+
+        if ( patients.size() > 1 )
+        {
+            String patientsInfo = new String();
+
+            DateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
+
+            /*
+             * Iterator iterator = patients.iterator(); int i = 0; while ( i <
+             * 10 ) { Patient patient = (Patient) iterator.next(); patientsInfo
+             * += patient.getId() + "/" + patient.getFullName() + "/" +
+             * dateFormat.format( patient.getBirthDate() ) + "$"; i++; }
+             */
+            int i = 1;
+            for ( Patient each : patients )
+            {
+                if ( i > 10 )
+                {
+                    break;
+                }
+                patientsInfo += each.getId() + "/" + each.getFullName() + "/" + dateFormat.format( each.getBirthDate() )
+                    + "$";
+                i++;
+            }
+
+            throw new NotAllowedException( patientsInfo );
+        }
+        else if ( patients.size() == 0 )
+        {
+            throw NotAllowedException.NO_BENEFICIARY_FOUND;
+        }
+        else
+        {
+            org.hisp.dhis.api.mobile.model.LWUITmodel.Patient patientMobile = new org.hisp.dhis.api.mobile.model.LWUITmodel.Patient();
+            for ( Patient each : patients )
+            {
+                patientMobile = getPatientModel( each );
+                break;
+            }
+            return patientMobile;
+        }
+    }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/DefaultProgramService.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/DefaultProgramService.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/DefaultProgramService.java	2013-09-08 08:36:32 +0000
@@ -29,6 +29,8 @@
  */
 
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
@@ -39,9 +41,11 @@
 import org.hisp.dhis.api.mobile.model.Program;
 import org.hisp.dhis.api.mobile.model.ProgramStage;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.patient.Patient;
 import org.hisp.dhis.program.ProgramInstance;
 import org.hisp.dhis.program.ProgramStageDataElement;
 import org.hisp.dhis.program.ProgramStageSection;
+import org.hisp.dhis.user.CurrentUserService;
 import org.springframework.beans.factory.annotation.Required;
 
 public class DefaultProgramService
@@ -54,6 +58,13 @@
     private org.hisp.dhis.program.ProgramService programService;
 
     private org.hisp.dhis.mobile.service.ModelMapping modelMapping;
+    
+    private CurrentUserService currentUserService;
+    
+    public void setCurrentUserService( CurrentUserService currentUserService )
+    {
+        this.currentUserService = currentUserService;
+    }
 
     // -------------------------------------------------------------------------
     // ProgramService
@@ -73,13 +84,19 @@
     
     public List<org.hisp.dhis.api.mobile.model.LWUITmodel.Program> getProgramsLWUIT( OrganisationUnit unit )
     {
+        Collection<org.hisp.dhis.program.Program> programByUnit = programService.getPrograms( unit );
+        
+        Collection<org.hisp.dhis.program.Program> programByCurrentUser = new HashSet<org.hisp.dhis.program.Program>( programService.getProgramsByCurrentUser());
+        
+        programByCurrentUser.retainAll( programByUnit );
+        
         List<org.hisp.dhis.api.mobile.model.LWUITmodel.Program> programs = new ArrayList<org.hisp.dhis.api.mobile.model.LWUITmodel.Program>();
 
-        for ( org.hisp.dhis.program.Program program : programService.getPrograms( unit ) )
+        for ( org.hisp.dhis.program.Program program : programByCurrentUser )
         {
             programs.add( getProgramLWUIT( program.getId()) );
         }
-
+        
         return programs;
     }
 
@@ -189,7 +206,13 @@
             //programStage = i18n( i18nService, locale, programStage );
 
             org.hisp.dhis.api.mobile.model.LWUITmodel.ProgramStage prStg = new org.hisp.dhis.api.mobile.model.LWUITmodel.ProgramStage();
-
+            
+            //add report date
+            
+            prStg.setReportDate( "" );
+            
+            prStg.setReportDateDescription( programStage.getReportDateDescription() );
+            
             prStg.setId( programStage.getId() );
 
             prStg.setName( programStage.getName() );

=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/resources/META-INF/dhis/beans.xml	2013-07-18 06:31:42 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/resources/META-INF/dhis/beans.xml	2013-09-08 08:36:32 +0000
@@ -31,7 +31,6 @@
 	<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
 	<property name="patientDataValueService" ref="org.hisp.dhis.patientdatavalue.PatientDataValueService" />
 	<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
-	<property name="orgUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService"></property>
 	<property name="modelMapping" ref="org.hisp.dhis.mobile.service.ModelMapping" />
 	<property name="patientIdentifierTypeService" ref="org.hisp.dhis.patient.PatientIdentifierTypeService"></property>
 	<property name="patientAttributeService" ref="org.hisp.dhis.patient.PatientAttributeService"></property>
@@ -42,6 +41,7 @@
   <bean id="org.hisp.dhis.mobile.api.IProgramService" class="org.hisp.dhis.mobile.service.DefaultProgramService">
     <property name="programService" ref="org.hisp.dhis.program.ProgramService" />
     <property name="modelMapping" ref="org.hisp.dhis.mobile.service.ModelMapping" />
+    <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
   </bean>
 
   <bean id="org.hisp.dhis.mobile.service.ModelMapping" class="org.hisp.dhis.mobile.service.ModelMapping"/>

=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitTest.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitTest.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitTest.java	2013-09-08 08:36:32 +0000
@@ -68,6 +68,7 @@
         unit.setDownloadAnonymousProgramUrl( "downloadAnonymousProgramUrl" );
         unit.setFindProgramUrl( "findProgramUrl" );
         unit.setFindLatestPersonUrl( "findLatestPersonUrl" );
+        unit.setFindPatientInAdvancedUrl( "findPatientInAdvanced" );
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         DataOutputStream dos = new DataOutputStream( baos );

=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitsTest.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitsTest.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/test/java/org/hisp/dhis/mobile/api/model/OrgUnitsTest.java	2013-09-08 08:36:32 +0000
@@ -93,6 +93,7 @@
         unit.setDownloadAnonymousProgramUrl( "downloadAnonymousProgramUrl" );
         unit.setFindProgramUrl( "findProgramUrl" );
         unit.setFindLatestPersonUrl( "findLatestPersonUrl" );
+        unit.setFindPatientInAdvancedUrl( "findPatientInAdvancedUrl" );
         return unit;
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java	2013-09-06 09:34:21 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java	2013-09-08 08:36:32 +0000
@@ -265,8 +265,8 @@
         patients.addAll( getPatientsByNames( searchText, 0, Integer.MAX_VALUE ) );
         patients.addAll( getPatientsByPhone( searchText, 0, Integer.MAX_VALUE ) );
 
-        // if an orgunit has been selected, filter out every patient that has a
-        // different ou
+        // if an org-unit has been selected, filter out every patient that has a
+        // different org-unit
         if ( orgUnitId != 0 )
         {
             Set<Patient> toRemoveList = new HashSet<Patient>();

=== modified file 'dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileClientController.java'
--- dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileClientController.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileClientController.java	2013-09-08 08:36:32 +0000
@@ -156,6 +156,7 @@
         orgUnit.setDownloadAnonymousProgramUrl( getUrl( request, unit.getId(), "downloadAnonymousProgramUrl" ) );
         orgUnit.setFindProgramUrl( getUrl( request, unit.getId(), "findProgram" ) );
         orgUnit.setFindLatestPersonUrl( getUrl( request, unit.getId(), "findLatestPerson" ) );
+        orgUnit.setFindPatientInAdvancedUrl( getUrl( request, unit.getId(), "findPatientInAdvanced" ) );
 
         // generate URL for download new version
         String full = UrlUtils.buildFullRequestUrl( request );

=== modified file 'dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java'
--- dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java	2013-09-08 08:36:32 +0000
@@ -343,6 +343,14 @@
     {
         return activityReportingService.findPatient( keyword, id );
     }
+    
+    @RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/LWUIT/orgUnits/{id}/findPatientInAdvanced/{programId}" )
+    @ResponseBody
+    public Patient findPatientInAdvanced( @PathVariable int programId, @PathVariable int id, @RequestHeader( "name" ) String keyword )
+        throws NotAllowedException
+    {
+        return activityReportingService.findPatientInAdvanced( keyword, id, programId );
+    }
 
     @RequestMapping( method = RequestMethod.POST, value = "{clientVersion}/LWUIT/orgUnits/{id}/uploadProgramStage/{patientId}" )
     @ResponseBody

=== 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-09-04 14:41:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/incoming/ReceivingSMSAction.java	2013-09-08 08:36:32 +0000
@@ -40,6 +40,7 @@
 import org.hisp.dhis.sms.incoming.IncomingSms;
 import org.hisp.dhis.sms.incoming.IncomingSmsService;
 import org.hisp.dhis.sms.incoming.SmsMessageStatus;
+import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.user.User;
 import org.hisp.dhis.user.UserService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -74,6 +75,13 @@
     {
         this.userService = userService;
     }
+    
+    private CurrentUserService currentUserService;
+
+    public void setCurrentUserService( CurrentUserService currentUserService )
+    {
+        this.currentUserService = currentUserService;
+    }
 
     @Autowired
     private SmsConfigurationManager smsConfigurationManager;
@@ -140,6 +148,13 @@
     {
         return total;
     }
+    
+    private User user;
+    
+    public User getUser()
+    {
+        return user;
+    }
 
     // -------------------------------------------------------------------------
     // Action Implementation
@@ -148,6 +163,8 @@
     public String execute()
         throws Exception
     {
+        this.user = currentUserService.getCurrentUser();
+        
         ModemGatewayConfig gatewayConfig = (ModemGatewayConfig) smsConfigurationManager
             .checkInstanceOfGateway( ModemGatewayConfig.class );
 

=== 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	2013-09-04 14:41:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/META-INF/dhis/beans.xml	2013-09-08 08:36:32 +0000
@@ -27,6 +27,7 @@
 		<property name="incomingSmsService"
 			ref="org.hisp.dhis.sms.incoming.IncomingSmsService" />
 		<property name="userService" ref="org.hisp.dhis.user.UserService" />
+		<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
 	</bean>
 
 	<bean id="org.hisp.dhis.mobile.action.incoming.DeleteReceiveSMSAction"

=== 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	2013-08-13 11:54:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/struts.xml	2013-09-08 08:36:32 +0000
@@ -40,6 +40,7 @@
     <action name="deleteReceiveSMS" class="org.hisp.dhis.mobile.action.incoming.DeleteReceiveSMSAction">
       <result name="success" type="velocity-json">../dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
+      <param name="requiredAuthorities">F_MOBILE_DELETE_SMS</param>
     </action>
     
     <action name="updateReceiveSMS" class="org.hisp.dhis.mobile.action.incoming.UpdateReceiveSMSAction">
@@ -51,6 +52,7 @@
       <result name="success" type="velocity-json">../dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
       <result name="error" type="velocity-json">../dhis-web-commons/ajax/jsonResponseError.vm</result>
       <param name="onExceptionReturn">plainTextError</param>
+      <param name="requiredAuthorities">F_MOBILE_DELETE_SMS</param>
     </action>
     
     <action name="reimport" class="org.hisp.dhis.mobile.action.incoming.ReimportSMSAction">

=== 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-09-04 14:41:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/webapp/dhis-web-maintenance-mobile/receiveSMSPage.vm	2013-09-08 08:36:32 +0000
@@ -154,6 +154,9 @@
 
 	var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_sms" ) , "'")';
 </script>
+#foreach( $each in $user.getUserCredentials().getAllAuthorities() )
+	#if( $each == '' )
+#end
 <input id="pollingInterval" name="pollingInterval" type="hidden" value="$pollingInterval"/>
 <h3>$i18n.getString( "show_receive_sms_form" )</h3>
 <form id="receiveSmsPage" name="receiveSmsPage" action="showReceivingPage.action" method="get" >

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties	2013-08-27 03:31:40 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/resources/org/hisp/dhis/user/i18n_module.properties	2013-09-08 08:36:32 +0000
@@ -213,6 +213,7 @@
 F_DV_ADMIN=Administrate data vizualiser
 F_MOBILE_SENDSMS=Send SMS
 F_MOBILE_SETTINGS=Set mobile settings
+F_MOBILE_DELETE_SMS=Delete SMS
 F_PERFORM_MAINTENANCE=Perform maintenance tasks
 F_PRUNE_ORGANISATION_UNITS=Prune organisation units
 F_MERGE_ORGANISATION_UNITS=Merge organisation units