← Back to team overview

dhis-mobile-devs team mailing list archive

[Branch ~dhis-mobile-devs/dhis-mobile/lwuit-tracking] Rev 176: Generate Repeatable Event

 

------------------------------------------------------------
revno: 176
committer: Lai <lai.hispvietnam@xxxxxxxxx>
branch nick: lwuit-tracking
timestamp: Wed 2013-10-30 16:20:56 +0700
message:
  Generate Repeatable Event
added:
  src/org/hisp/dhis/mobile/connection/task/GenerateRepeatableEventTask.java
  src/org/hisp/dhis/mobile/view/GenerateRepeatableEventView.java
modified:
  build.xml
  src/org/hisp/dhis/mobile/connection/ConnectionManager.java
  src/org/hisp/dhis/mobile/connection/task/UploadTrackingFormTask.java
  src/org/hisp/dhis/mobile/midlet/NameBasedMIDlet.java
  src/org/hisp/dhis/mobile/model/OrgUnit.java
  src/org/hisp/dhis/mobile/model/ProgramStage.java
  src/org/hisp/dhis/mobile/util/PeriodUtil.java
  src/org/hisp/dhis/mobile/view/FindBeneficiaryView.java
  src/org/hisp/dhis/mobile/view/TrackingDataEntryView.java
  src/org/hisp/dhis/mobile/view/TrackingMainMenuView.java


--
lp:~dhis-mobile-devs/dhis-mobile/lwuit-tracking
https://code.launchpad.net/~dhis-mobile-devs/dhis-mobile/lwuit-tracking

Your team DHIS mobile developers is subscribed to branch lp:~dhis-mobile-devs/dhis-mobile/lwuit-tracking.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis-mobile-devs/dhis-mobile/lwuit-tracking/+edit-subscription
=== modified file 'build.xml'
--- build.xml	2013-10-23 08:18:01 +0000
+++ build.xml	2013-10-30 09:20:56 +0000
@@ -34,11 +34,11 @@
 	<!-- Which logo to use -->
 	<property name="logo" value="dhis2_logo.png" />
 	<!-- Server URL -->
-	<property name="server.url" value="http://localhost:9999/"; />
+	<property name="server.url" value="http://localhost:9999"; />
 	<!-- User Name -->
-	<property name="username" value="long" />
+	<property name="username" value="mobile" />
 	<!-- Password -->
-	<property name="password" value="District1" />
+	<property name="password" value="district" />
 	<!-- Server Phone Number -->
 	<property name="server.phonenumber" value="+8494485878" />
 	<!-- Default Locale -->

=== modified file 'src/org/hisp/dhis/mobile/connection/ConnectionManager.java'
--- src/org/hisp/dhis/mobile/connection/ConnectionManager.java	2013-10-23 04:32:49 +0000
+++ src/org/hisp/dhis/mobile/connection/ConnectionManager.java	2013-10-30 09:20:56 +0000
@@ -34,6 +34,7 @@
 import org.hisp.dhis.mobile.connection.task.FindLatestPersonTask;
 import org.hisp.dhis.mobile.connection.task.FindLostToFollowUpTask;
 import org.hisp.dhis.mobile.connection.task.FindPatientTask;
+import org.hisp.dhis.mobile.connection.task.GenerateRepeatableEventTask;
 import org.hisp.dhis.mobile.connection.task.GetAllAnonymousProgramTask;
 import org.hisp.dhis.mobile.connection.task.GetVariesInfoTask;
 import org.hisp.dhis.mobile.connection.task.LoginTask;
@@ -56,7 +57,6 @@
 public class ConnectionManager
 
 {
-
     public static final String MEDIATYPE_MOBILE_SERIALIZED = "application/vnd.org.dhis2.mobile+serialized";
 
     // Class variables
@@ -249,6 +249,12 @@
         SaveUnregisteredPersonTask saveUnregisteredPersonTask = new SaveUnregisteredPersonTask( patient );
         runTask( saveUnregisteredPersonTask );
     }
+    
+    public static void generateRepeatableEvent( String eventInfo )
+    {
+        GenerateRepeatableEventTask generateRepeatableEventTask = new GenerateRepeatableEventTask( eventInfo );
+        runTask( generateRepeatableEventTask );
+    }
 
     public static void runTask( AbstractTask task )
     {

=== added file 'src/org/hisp/dhis/mobile/connection/task/GenerateRepeatableEventTask.java'
--- src/org/hisp/dhis/mobile/connection/task/GenerateRepeatableEventTask.java	1970-01-01 00:00:00 +0000
+++ src/org/hisp/dhis/mobile/connection/task/GenerateRepeatableEventTask.java	2013-10-30 09:20:56 +0000
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2004-2012, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.hisp.dhis.mobile.connection.task;
+
+import java.io.DataInputStream;
+import java.io.IOException;
+
+import org.hisp.dhis.mobile.connection.ConnectionManager;
+import org.hisp.dhis.mobile.midlet.DHISMIDlet;
+import org.hisp.dhis.mobile.midlet.NameBasedMIDlet;
+import org.hisp.dhis.mobile.model.Patient;
+
+/**
+ * @author Nguyen Kim Lai
+ * 
+ * @version GenerateRepeatableEventTask.java 3:02:13 PM Oct 29, 2013 $
+ */
+public class GenerateRepeatableEventTask
+    extends AbstractTask
+{
+    private String eventInfo;
+
+    NameBasedMIDlet nameBasedMIDlet;
+    
+    public GenerateRepeatableEventTask( String eventInfo )
+    {
+        super();
+        this.eventInfo = eventInfo;
+        nameBasedMIDlet = (NameBasedMIDlet) ConnectionManager.getDhisMIDlet();
+    }
+
+    public void run()
+    {
+        DataInputStream inputStream = null;
+        Patient patient = new Patient();
+        try
+        {
+            inputStream = this.download( eventInfo, "eventInfo" );
+            if ( inputStream != null )
+            {
+                patient.deSerialize( inputStream );
+                nameBasedMIDlet.getPersonDashboardView().setPatient( patient );
+                nameBasedMIDlet.getPersonDashboardView().showView();
+            }
+            inputStream = null;
+            patient = null;
+            System.gc();
+        }
+        catch ( IOException e )
+        {
+            DHISMIDlet.debug( e.getMessage() );
+            e.printStackTrace();
+        }
+    }
+
+}

=== modified file 'src/org/hisp/dhis/mobile/connection/task/UploadTrackingFormTask.java'
--- src/org/hisp/dhis/mobile/connection/task/UploadTrackingFormTask.java	2013-09-10 07:17:17 +0000
+++ src/org/hisp/dhis/mobile/connection/task/UploadTrackingFormTask.java	2013-10-30 09:20:56 +0000
@@ -71,7 +71,7 @@
             DataInputStream messageStream = this.upload( SerializationUtil.serialize( uploadProgramStage ) );
             String message = this.readMessage( messageStream );
 
-            if ( message.equalsIgnoreCase( PROGRAM_STAGE_UPLOADED ) )
+            if ( message.startsWith( PROGRAM_STAGE_UPLOADED ) )
             {
                 programStage.setCompleted( uploadProgramStage.isCompleted() );
 
@@ -96,9 +96,17 @@
                     }
                 }
                 nameBasedMIDlet.getTrackingDataEntryView().setSection( null );
-                nameBasedMIDlet.getPersonDashboardView().setPatient( patient );
-                nameBasedMIDlet.getAlertBoxView( programStage.getName(), Text.UPLOAD_COMPLETED() ).showView();
-                nameBasedMIDlet.getPersonDashboardView().showView();
+                if ( programStage.isRepeatable() )
+                {
+                    String nextDate = message.substring( message.indexOf( "$" )+1, message.length());
+                    nameBasedMIDlet.getGenerateRepeatableEventView( programStage, nextDate, patient ).showView();
+                }
+                else
+                {
+                    nameBasedMIDlet.getPersonDashboardView().setPatient( patient );
+                    nameBasedMIDlet.getAlertBoxView( programStage.getName(), Text.UPLOAD_COMPLETED() ).showView();
+                    nameBasedMIDlet.getPersonDashboardView().showView();
+                }
             }
             else if ( message.equalsIgnoreCase( PROGRAM_STAGE_SECTION_UPLOADED ) )
             {
@@ -117,7 +125,6 @@
                 programStage.setCompleted( true );
                 nameBasedMIDlet.getAlertBoxView( programStage.getName(), Text.UPLOAD_COMPLETED() ).showView();
                 nameBasedMIDlet.getTrackingMainMenuView().showView();
-
             }
 
             patient = null;

=== modified file 'src/org/hisp/dhis/mobile/midlet/NameBasedMIDlet.java'
--- src/org/hisp/dhis/mobile/midlet/NameBasedMIDlet.java	2013-10-09 03:09:25 +0000
+++ src/org/hisp/dhis/mobile/midlet/NameBasedMIDlet.java	2013-10-30 09:20:56 +0000
@@ -19,10 +19,13 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import org.hisp.dhis.mobile.model.Patient;
+import org.hisp.dhis.mobile.model.ProgramStage;
 import org.hisp.dhis.mobile.view.AddingRelationshipView;
 import org.hisp.dhis.mobile.view.AnonymousProgramListView;
 import org.hisp.dhis.mobile.view.DashboardLinkView;
 import org.hisp.dhis.mobile.view.FindBeneficiaryView;
+import org.hisp.dhis.mobile.view.GenerateRepeatableEventView;
 import org.hisp.dhis.mobile.view.HistoryPersonListView;
 import org.hisp.dhis.mobile.view.LostToFollowUpDetailView;
 import org.hisp.dhis.mobile.view.LostToFollowUpView;
@@ -82,6 +85,8 @@
     private LostToFollowUpView lostToFollowUpView;
     
     private LostToFollowUpDetailView lostToFollowUpDetailView;
+    
+    private GenerateRepeatableEventView generateRepeatableEventView;
 
     public NameBasedMIDlet()
     {
@@ -268,4 +273,18 @@
         }
         return lostToFollowUpDetailView;
     }
+
+    public GenerateRepeatableEventView getGenerateRepeatableEventView( ProgramStage programStage, String defaultDueDate, Patient patient )
+    {
+        if ( generateRepeatableEventView == null )
+        {
+            generateRepeatableEventView = new GenerateRepeatableEventView( this, programStage, defaultDueDate, patient );
+        }
+        else
+        {
+            generateRepeatableEventView.setProgramStage( programStage );
+            generateRepeatableEventView.setDefaultDueDate( defaultDueDate );
+        }
+        return generateRepeatableEventView;
+    }
 }

=== modified file 'src/org/hisp/dhis/mobile/model/OrgUnit.java'
--- src/org/hisp/dhis/mobile/model/OrgUnit.java	2013-10-09 03:09:25 +0000
+++ src/org/hisp/dhis/mobile/model/OrgUnit.java	2013-10-30 09:20:56 +0000
@@ -74,6 +74,8 @@
     private String findLostToFollowUpUrl;
     
     private String handleLostToFollowUpUrl;
+    
+    private String generateRepeatableEventUrl;
 
     public static double serverVersion;
 
@@ -202,6 +204,11 @@
         return handleLostToFollowUpUrl;
     }
 
+    public String getGenerateRepeatableEventUrl()
+    {
+        return generateRepeatableEventUrl;
+    }
+
     public void serialize( DataOutputStream dataOutputStream )
         throws IOException
     {
@@ -228,6 +235,7 @@
         dataOutputStream.writeUTF( this.findPatientInAdvancedUrl );
         dataOutputStream.writeUTF( this.findLostToFollowUpUrl );
         dataOutputStream.writeUTF( this.handleLostToFollowUpUrl );
+        dataOutputStream.writeUTF( this.generateRepeatableEventUrl );
     }
 
     public void deSerialize( DataInputStream dataInputStream )
@@ -256,6 +264,7 @@
         this.findPatientInAdvancedUrl = dataInputStream.readUTF();
         this.findLostToFollowUpUrl = dataInputStream.readUTF();
         this.handleLostToFollowUpUrl = dataInputStream.readUTF();
+        this.generateRepeatableEventUrl = dataInputStream.readUTF();
     }
 
     public boolean checkNewVersion( double serverVersion )

=== modified file 'src/org/hisp/dhis/mobile/model/ProgramStage.java'
--- src/org/hisp/dhis/mobile/model/ProgramStage.java	2013-09-08 11:43:54 +0000
+++ src/org/hisp/dhis/mobile/model/ProgramStage.java	2013-10-30 09:20:56 +0000
@@ -36,6 +36,8 @@
     private boolean isCompleted;
 
     private boolean isSingleEvent;
+    
+    private int standardInterval; 
 
     private Vector dataElements = new Vector();
 
@@ -111,6 +113,16 @@
         this.reportDateDescription = reportDateDescription;
     }
 
+    public int getStandardInterval()
+    {
+        return standardInterval;
+    }
+
+    public void setStandardInterval( int standardInterval )
+    {
+        this.standardInterval = standardInterval;
+    }
+
     public void serialize( DataOutputStream dout )
         throws IOException
     {
@@ -118,6 +130,9 @@
         dout.writeUTF( this.reportDate );
         dout.writeUTF( "" );
         dout.writeBoolean( this.isRepeatable() );
+        System.out.println("program stage name: "+ this.getName());
+        dout.writeInt( standardInterval );
+        System.out.println("standard interval: "+standardInterval);
         dout.writeBoolean( this.isCompleted() );
         dout.writeBoolean( this.isSingleEvent() );
 
@@ -144,6 +159,7 @@
         this.setReportDate( din.readUTF() );
         this.setReportDateDescription( din.readUTF() );
         this.setRepeatable( din.readBoolean() );
+        setStandardInterval( din.readInt() );
         this.setCompleted( din.readBoolean() );
         this.setSingleEvent( din.readBoolean() );
         int dataElementSize = din.readInt();

=== modified file 'src/org/hisp/dhis/mobile/util/PeriodUtil.java'
--- src/org/hisp/dhis/mobile/util/PeriodUtil.java	2013-10-09 03:09:25 +0000
+++ src/org/hisp/dhis/mobile/util/PeriodUtil.java	2013-10-30 09:20:56 +0000
@@ -469,13 +469,14 @@
         }
     }
 
-    public static String dateToString( Date date, int y, int m, int d )
+    public static String dateToString( Date date )
     {
+        int y,m,d;
         Calendar c = Calendar.getInstance();
         String dateString = null;
         c.setTime( date );
         y = c.get( Calendar.YEAR );
-        m = c.get( Calendar.MONTH );
+        m = c.get( Calendar.MONTH )+1;
         d = c.get( Calendar.DATE );
         dateString = (y < 10 ? "0" : "") + y + "-" + (m < 10 ? "0" : "") + m + "-" + (d < 10 ? "0" : "") + d;
         c = null;

=== modified file 'src/org/hisp/dhis/mobile/view/FindBeneficiaryView.java'
--- src/org/hisp/dhis/mobile/view/FindBeneficiaryView.java	2013-10-01 08:27:26 +0000
+++ src/org/hisp/dhis/mobile/view/FindBeneficiaryView.java	2013-10-30 09:20:56 +0000
@@ -212,7 +212,6 @@
                         }
                         else
                         {
-
                             for ( int i = 0; i < orgUnitVector.size(); i++ )
                             {
                                 if ( ((String) orgUnitOptions.getSelectedItem()).equals( ((OrgUnit) orgUnitVector

=== added file 'src/org/hisp/dhis/mobile/view/GenerateRepeatableEventView.java'
--- src/org/hisp/dhis/mobile/view/GenerateRepeatableEventView.java	1970-01-01 00:00:00 +0000
+++ src/org/hisp/dhis/mobile/view/GenerateRepeatableEventView.java	2013-10-30 09:20:56 +0000
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2004-2012, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.hisp.dhis.mobile.view;
+
+import org.hisp.dhis.mobile.connection.ConnectionManager;
+import org.hisp.dhis.mobile.midlet.DHISMIDlet;
+import org.hisp.dhis.mobile.midlet.NameBasedMIDlet;
+import org.hisp.dhis.mobile.model.Patient;
+import org.hisp.dhis.mobile.model.ProgramStage;
+import org.hisp.dhis.mobile.ui.Text;
+
+import com.sun.lwuit.Command;
+import com.sun.lwuit.Form;
+import com.sun.lwuit.Label;
+import com.sun.lwuit.TextField;
+import com.sun.lwuit.animations.CommonTransitions;
+import com.sun.lwuit.events.ActionEvent;
+import com.sun.lwuit.events.ActionListener;
+import com.sun.lwuit.layouts.BoxLayout;
+
+/**
+ * @author Nguyen Kim Lai
+ * 
+ * @version GenerateRepeatableEventView.java 3:24:10 PM Oct 28, 2013 $
+ */
+public class GenerateRepeatableEventView
+    extends AbstractView
+    implements ActionListener
+{
+    private Form mainForm;
+
+    private Command createCommand, noCommand;
+    
+    private Label lblProgramStageName;
+
+    private TextField txtDueDate;
+
+    private Label lbldueDate;
+    
+    private String defaultDueDate;
+
+    private ProgramStage programStage;
+    
+    private Patient patient;
+    
+    private NameBasedMIDlet nameBasedMidlet;
+
+    public GenerateRepeatableEventView( DHISMIDlet dhisMIDlet, ProgramStage programStage, String defaultDueDate, Patient patient )
+    {
+        super( dhisMIDlet );
+        this.programStage = programStage;
+        this.defaultDueDate = defaultDueDate;
+        this.patient = patient;
+        nameBasedMidlet = (NameBasedMIDlet) this.dhisMIDlet;
+    }
+
+    public void actionPerformed( ActionEvent ae )
+    {
+        if ( ae.getCommand().getCommandName().equalsIgnoreCase( Text.NO() ) )
+        {
+            nameBasedMidlet.getPersonDashboardView().setPatient( patient );
+            nameBasedMidlet.getPersonDashboardView().showView();
+        }
+        else
+        {
+            ConnectionManager.setUrl( nameBasedMidlet.getCurrentOrgUnit().getGenerateRepeatableEventUrl() );
+            nameBasedMidlet.getWaitingView().showView();
+            ConnectionManager.generateRepeatableEvent( programStage.getId()+"$"+txtDueDate.getText() );
+        }
+
+    }
+
+    public void prepareView()
+    {
+        System.gc();
+        getMainForm();
+        mainForm.removeAll();
+    }
+
+    public void showView()
+    {
+        prepareView();
+        mainForm.show();
+        mainForm.addComponent( getLblProgramStageName() );
+        mainForm.addComponent( getLbldueDate() );
+        mainForm.addComponent( getTxtDueDate() );
+    }
+
+    public Form getMainForm()
+    {
+        if ( mainForm == null )
+        {
+            mainForm = new Form( "Create new event" );
+            mainForm.setLayout( new BoxLayout( BoxLayout.Y_AXIS ) );
+            mainForm.setTransitionOutAnimator( CommonTransitions.createSlide( CommonTransitions.SLIDE_HORIZONTAL, true, 200 ) );
+            mainForm.addCommand( getNoCommand() );
+            mainForm.addCommand( getCreateCommand() );
+            mainForm.addCommandListener( this );
+        }
+        return mainForm;
+    }
+
+    public void setMainForm( Form mainForm )
+    {
+        this.mainForm = mainForm;
+    }
+
+    public Command getCreateCommand()
+    {
+        if ( createCommand == null )
+        {
+            createCommand = new Command( "Create" );
+        }
+        return createCommand;
+    }
+
+    public Command getNoCommand()
+    {
+        if ( noCommand == null )
+        {
+            noCommand = new Command( Text.NO() );
+        }
+        return noCommand;
+    }
+
+    public TextField getTxtDueDate()
+    {
+        if ( txtDueDate == null )
+        {
+            txtDueDate = new TextField( defaultDueDate );
+        }
+        return txtDueDate;
+    }
+
+    public Label getLbldueDate()
+    {
+        if ( lbldueDate == null )
+        {
+            lbldueDate = new Label( "Due date: " );
+        }
+        return lbldueDate;
+    }
+
+    public String getDefaultDueDate()
+    {
+        return defaultDueDate;
+    }
+
+    public void setDefaultDueDate( String defaultDueDate )
+    {
+        this.defaultDueDate = defaultDueDate;
+    }
+
+    public void setProgramStage( ProgramStage programStage )
+    {
+        this.programStage = programStage;
+    }
+
+    public Label getLblProgramStageName()
+    {
+        if ( lblProgramStageName == null )
+        {
+            lblProgramStageName = new Label( programStage.getName() );
+        }
+        return lblProgramStageName;
+    }
+    
+}

=== modified file 'src/org/hisp/dhis/mobile/view/TrackingDataEntryView.java'
--- src/org/hisp/dhis/mobile/view/TrackingDataEntryView.java	2013-10-09 03:09:25 +0000
+++ src/org/hisp/dhis/mobile/view/TrackingDataEntryView.java	2013-10-30 09:20:56 +0000
@@ -273,6 +273,7 @@
         uploadProgramStage.setName( programStage.getName() );
         uploadProgramStage.setCompleted( completeStatusCheckBox.isSelected() );
         uploadProgramStage.setRepeatable( programStage.isRepeatable() );
+        uploadProgramStage.setStandardInterval( programStage.getStandardInterval() );
         uploadProgramStage.setSingleEvent( programStage.isSingleEvent() );
         uploadProgramStage.setDataElements( programStage.getDataElements() );
         uploadProgramStage.setSections( programStage.getSections() );

=== modified file 'src/org/hisp/dhis/mobile/view/TrackingMainMenuView.java'
--- src/org/hisp/dhis/mobile/view/TrackingMainMenuView.java	2013-10-07 08:59:05 +0000
+++ src/org/hisp/dhis/mobile/view/TrackingMainMenuView.java	2013-10-30 09:20:56 +0000
@@ -19,6 +19,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.Date;
+
 import org.hisp.dhis.mobile.connection.ConnectionManager;
 import org.hisp.dhis.mobile.midlet.DHISMIDlet;
 import org.hisp.dhis.mobile.midlet.NameBasedMIDlet;
@@ -27,6 +29,7 @@
 import org.hisp.dhis.mobile.recordstore.OrgUnitRecordStore;
 import org.hisp.dhis.mobile.recordstore.PatientRecordStore;
 import org.hisp.dhis.mobile.ui.Text;
+import org.hisp.dhis.mobile.util.PeriodUtil;
 
 import com.sun.lwuit.Command;
 import com.sun.lwuit.Dialog;
@@ -61,6 +64,7 @@
 
     public void prepareView()
     {
+        System.out.println(PeriodUtil.dateToString( new Date() ));
         System.gc();
         getMenuForm();
     }
@@ -134,7 +138,7 @@
                     ConnectionManager.getAllAnonymousProgram( "1", true );
                 }
             }
-            else if ( nextPageName.equals( "Anonymous" ) )
+            /*else if ( nextPageName.equals( "Anonymous" ) )
             {
                 if ( sizeOfOrgUnits > 1 )
                 {
@@ -148,7 +152,7 @@
                     ConnectionManager.setUrl( nameBasedMidlet.getCurrentOrgUnit().getDownloadAnonymousProgramUrl() );
                     ConnectionManager.getAllAnonymousProgram( "3", false );
                 }
-            }
+            }*/
             else if ( nextPageName.equals( "History" ) )
             {
                 ModelList modelList = PatientRecordStore.getCurrentPatients();
@@ -174,7 +178,7 @@
     {
         // String[] menuItems = { "Find Person", "Person Registration",
         // "Anonymous", "Message", "Update Contact", "Setting" };
-        String[] menuItems = { "Find Person", "Add Person", "Lost to Follow Up", "History", "Offline", "Anonymous" };
+        String[] menuItems = { "Find Person", "Add Person", "Lost to Follow Up", "History", "Offline"};
         if ( menuList == null )
         {
             menuList = new List( menuItems );