=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/sms/parse/ParserType.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/sms/parse/ParserType.java 2013-08-23 15:56:19 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/sms/parse/ParserType.java 2013-12-24 08:11:09 +0000 @@ -34,5 +34,5 @@ J2ME_PARSER, ALERT_PARSER, UNREGISTERED_PARSER, - ; + ANONYMOUS_PROGRAM_PARSER; } === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/smscommand/CreateSMSCommandForm.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/smscommand/CreateSMSCommandForm.java 2013-12-01 22:32:50 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/smscommand/CreateSMSCommandForm.java 2013-12-24 08:11:09 +0000 @@ -30,6 +30,7 @@ import org.hisp.dhis.dataset.DataSet; import org.hisp.dhis.dataset.DataSetService; +import org.hisp.dhis.program.ProgramService; import org.hisp.dhis.sms.parse.ParserType; import org.hisp.dhis.smscommand.SMSCommand; import org.hisp.dhis.smscommand.SMSCommandService; @@ -66,6 +67,13 @@ this.userGroupService = userGroupService; } + // private ProgramService programService; + // + // public void setProgramService( ProgramService programService ) + // { + // this.programService = programService; + // } + // ------------------------------------------------------------------------- // Input && Output // ------------------------------------------------------------------------- @@ -98,6 +106,13 @@ this.userGroupID = userGroupID; } + private Integer selectedAnonymousProgramID; + + public void setSelectedAnonymousProgramID( Integer selectedAnonymousProgramID ) + { + this.selectedAnonymousProgramID = selectedAnonymousProgramID; + } + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -121,7 +136,11 @@ userGroup = userGroupService.getUserGroup( userGroupID ); command.setUserGroup( userGroup ); } - + else if ( parserType.equals( ParserType.ANONYMOUS_PROGRAM_PARSER ) ) + { + + } + smsCommandService.save( command ); return SUCCESS; } === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/smscommand/SMSCommandAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/smscommand/SMSCommandAction.java 2013-11-20 04:03:42 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/smscommand/SMSCommandAction.java 2013-12-24 08:11:09 +0000 @@ -39,6 +39,8 @@ import org.hisp.dhis.dataelement.comparator.DataElementSortOrderComparator; import org.hisp.dhis.dataset.DataSet; import org.hisp.dhis.dataset.DataSetService; +import org.hisp.dhis.program.Program; +import org.hisp.dhis.program.ProgramService; import org.hisp.dhis.sms.parse.ParserType; import org.hisp.dhis.smscommand.SMSCode; import org.hisp.dhis.smscommand.SMSCommand; @@ -51,41 +53,47 @@ public class SMSCommandAction implements Action { - + // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- - + private SMSCommandService smsCommandService; - + public void setSmsCommandService( SMSCommandService smsCommandService ) { this.smsCommandService = smsCommandService; } private DataSetService dataSetService; - + public void setDataSetService( DataSetService dataSetService ) { this.dataSetService = dataSetService; } - + private UserGroupService userGroupService; - public void setUserGroupService( UserGroupService userGroupService ) { this.userGroupService = userGroupService; } - + + private ProgramService programService; + + public void setProgramService( ProgramService programService ) + { + this.programService = programService; + } + // ------------------------------------------------------------------------- // Input & Output // ------------------------------------------------------------------------- - + private SMSCommand smsCommand; - + private List dataElements; - + private List userGroupList; public List getUserGroupList() @@ -93,8 +101,9 @@ return userGroupList; } + public List anonymousProgramList; + private int selectedCommandID = -1; - public int getSelectedCommandID() { @@ -107,7 +116,6 @@ } private Map codes = new HashMap(); - public Map getCodes() { @@ -118,8 +126,9 @@ { this.codes = codes; } - - public ParserType[] getParserType(){ + + public ParserType[] getParserType() + { return ParserType.values(); } @@ -134,7 +143,7 @@ { smsCommand = smsCommandService.getSMSCommand( selectedCommandID ); } - + if ( smsCommand != null && smsCommand.getCodes() != null ) { for ( SMSCode x : smsCommand.getCodes() ) @@ -142,14 +151,16 @@ codes.put( "" + x.getDataElement().getId() + x.getOptionId(), x.getCode() ); } } - userGroupList = new ArrayList(userGroupService.getAllUserGroups()); + userGroupList = new ArrayList( userGroupService.getAllUserGroups() ); + anonymousProgramList = new ArrayList( + programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) ); return SUCCESS; } // ------------------------------------------------------------------------- // Supporting methods // ------------------------------------------------------------------------- - + public List getDataElements() { if ( smsCommand != null ) @@ -164,7 +175,6 @@ } return null; } - public Collection getDataSets() { @@ -175,9 +185,9 @@ { return smsCommandService.getSMSCommands(); } - + public SMSCommand getSmsCommand() { return smsCommand; - } + } } === 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-12-17 08:41:46 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/META-INF/dhis/beans.xml 2013-12-24 08:11:09 +0000 @@ -143,6 +143,7 @@ + @@ -57,6 +57,19 @@ + + + $i18n.getString( "program" ) + + + + + +