← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7047: [mobile] add repeatable registration form

 

------------------------------------------------------------
revno: 7047
committer: Long <thanhlongngo1988@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2012-05-26 19:31:07 +0700
message:
  [mobile] add repeatable registration form
added:
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetRepeatableEventRegistrationFormAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveRepeatableEvemtAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/repeatableEventRegistrationForm.vm
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/RegisterIrregularEncounterAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageListAction.java
  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/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties
  dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramStageList.vm


--
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-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/RegisterIrregularEncounterAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/RegisterIrregularEncounterAction.java	2012-03-27 08:30:45 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/RegisterIrregularEncounterAction.java	2012-05-26 12:31:07 +0000
@@ -95,7 +95,6 @@
         programStageInstance.setDueDate( format.parseDate( dueDate ) );
 
         programStageInstanceService.addProgramStageInstance( programStageInstance );
-
         selectedStateManager.setSelectedProgramStageInstance( programStageInstance );
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java	2012-05-24 14:51:18 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryenrollment/action/SaveMobileProgramEnrollmentAction.java	2012-05-26 12:31:07 +0000
@@ -188,8 +188,6 @@
             return ERROR;
         }
 
-        System.out.println( "service: " + patientService );
-
         patient = patientService.getPatient( patientId );
 
         program = programService.getProgram(  programId );

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java	2012-05-24 14:51:18 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java	2012-05-26 12:31:07 +0000
@@ -120,7 +120,7 @@
                 programInstances.add( programInstance );
             }
         }
-
+        
         return SUCCESS;
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageListAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageListAction.java	2012-05-24 14:51:18 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageListAction.java	2012-05-26 12:31:07 +0000
@@ -27,12 +27,13 @@
 
 package org.hisp.dhis.light.namebaseddataentry.action;
 
+import java.util.HashSet;
 import java.util.Set;
-
 import org.hisp.dhis.patient.Patient;
 import org.hisp.dhis.patient.PatientService;
 import org.hisp.dhis.program.ProgramInstance;
 import org.hisp.dhis.program.ProgramInstanceService;
+import org.hisp.dhis.program.ProgramStage;
 import org.hisp.dhis.program.ProgramStageInstance;
 import com.opensymphony.xwork2.Action;
 
@@ -42,9 +43,9 @@
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
-    
+
     private PatientService patientService;
-    
+
     public PatientService getPatientService()
     {
         return patientService;
@@ -54,9 +55,9 @@
     {
         this.patientService = patientService;
     }
-    
+
     private ProgramInstanceService programInstanceService;
-    
+
     public ProgramInstanceService getProgramInstanceService()
     {
         return programInstanceService;
@@ -66,13 +67,13 @@
     {
         this.programInstanceService = programInstanceService;
     }
-    
+
     // -------------------------------------------------------------------------
     // Input & Output
     // -------------------------------------------------------------------------
 
     private Set<ProgramStageInstance> programStageInstances;
-    
+
     public Set<ProgramStageInstance> getProgramStageInstances()
     {
         return programStageInstances;
@@ -82,9 +83,9 @@
     {
         this.programStageInstances = programStageInstances;
     }
-    
+
     private int programInstanceId;
-    
+
     public int getProgramInstanceId()
     {
         return programInstanceId;
@@ -94,9 +95,9 @@
     {
         this.programInstanceId = programInstanceId;
     }
-    
+
     private Integer patientId;
-    
+
     public Integer getPatientId()
     {
         return patientId;
@@ -106,9 +107,9 @@
     {
         this.patientId = patientId;
     }
-    
+
     private Patient patient;
-    
+
     public Patient getPatient()
     {
         return patient;
@@ -118,9 +119,9 @@
     {
         this.patient = patient;
     }
-    
+
     private int programId;
-    
+
     public int getProgramId()
     {
         return programId;
@@ -130,9 +131,9 @@
     {
         this.programId = programId;
     }
-    
+
     private boolean validated;
-    
+
     public boolean isValidated()
     {
         return validated;
@@ -143,6 +144,18 @@
         this.validated = validated;
     }
 
+    private Set<ProgramStage> repeatableStages;
+    
+    public Set<ProgramStage> getRepeatableStages()
+    {
+        return repeatableStages;
+    }
+
+    public void setRepeatableStages( Set<ProgramStage> repeatableStages )
+    {
+        this.repeatableStages = repeatableStages;
+    }
+
     @Override
     public String execute()
         throws Exception
@@ -150,6 +163,20 @@
         ProgramInstance programInstance = programInstanceService.getProgramInstance( programInstanceId );
         patient = patientService.getPatient( patientId );
         programStageInstances = programInstance.getProgramStageInstances();
+        repeatableStages = new HashSet<ProgramStage>();
+        
+        for ( ProgramStageInstance programStageInstance : programStageInstances )
+        {
+           ProgramStage programStage =  programStageInstance.getProgramStage();
+           if (programStage.getIrregular()) {
+               repeatableStages.add( programStage );
+           }
+           
+           if (programStage.getIrregular() && !programStageInstance.isCompleted()) {
+               repeatableStages.remove(programStage);
+           }
+        }
+        System.out.println("Size: " + repeatableStages.size());
         return SUCCESS;
     }
 

=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetRepeatableEventRegistrationFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetRepeatableEventRegistrationFormAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetRepeatableEventRegistrationFormAction.java	2012-05-26 12:31:07 +0000
@@ -0,0 +1,101 @@
+/*
+ * 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.light.namebaseddataentry.action;
+
+import org.hisp.dhis.program.ProgramStage;
+import org.hisp.dhis.program.ProgramStageService;
+
+import com.opensymphony.xwork2.Action;
+
+public class GetRepeatableEventRegistrationFormAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+    
+    private ProgramStageService programStageService;
+
+    public ProgramStageService getProgramStageService()
+    {
+        return programStageService;
+    }
+
+    public void setProgramStageService( ProgramStageService programStageService )
+    {
+        this.programStageService = programStageService;
+    }
+    
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+
+    private Integer programInstanceId;
+
+    public Integer getProgramInstanceId()
+    {
+        return programInstanceId;
+    }
+
+    public void setProgramInstanceId( Integer programInstanceId )
+    {
+        this.programInstanceId = programInstanceId;
+    }
+
+    private Integer programStageId;
+
+    public Integer getProgramStageId()
+    {
+        return programStageId;
+    }
+
+    public void setProgramStageId( Integer programStageId )
+    {
+        this.programStageId = programStageId;
+    }
+    
+    private ProgramStage programStage;
+    
+    public ProgramStage getProgramStage()
+    {
+        return programStage;
+    }
+
+    public void setProgramStage( ProgramStage programStage )
+    {
+        this.programStage = programStage;
+    }
+
+    @Override
+    public String execute()
+        throws Exception
+    {
+        programStage = programStageService.getProgramStage( programStageId );
+        return SUCCESS;
+    }
+
+}

=== 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	2012-05-24 14:51:18 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveProgramStageFormAction.java	2012-05-26 12:31:07 +0000
@@ -45,6 +45,7 @@
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.patient.PatientService;
+import org.hisp.dhis.program.ProgramStageService;
 import org.hisp.dhis.util.ContextUtils;
 import com.opensymphony.xwork2.Action;
 import com.opensymphony.xwork2.ActionContext;
@@ -52,6 +53,9 @@
 public class SaveProgramStageFormAction
     implements Action
 {
+    private static final String SUCCESS_AND_BACK_TO_PROGRAMSTAGE = "success_back_to_programstage";
+
+    private static final String REGISTER_NEXT_DUEDATE = "register_next_duedate";
 
     // -------------------------------------------------------------------------
     // Dependencies
@@ -114,6 +118,18 @@
         this.dataElementCategoryService = dataElementCategoryService;
     }
 
+    private ProgramStageService programStageService;
+
+    public ProgramStageService getProgramStageService()
+    {
+        return programStageService;
+    }
+
+    public void setProgramStageService( ProgramStageService programStageService )
+    {
+        this.programStageService = programStageService;
+    }
+
     // -------------------------------------------------------------------------
     // Input & Output
     // -------------------------------------------------------------------------
@@ -144,17 +160,17 @@
         this.programStageInstanceId = programStageInstanceId;
     }
 
-//    private Integer programInstanceId;
-//
-//    public Integer getProgramInstanceId()
-//    {
-//        return programInstanceId;
-//    }
-//
-//    public void setProgramInstanceId( Integer programInstanceId )
-//    {
-//        this.programInstanceId = programInstanceId;
-//    }
+    // private Integer programInstanceId;
+    //
+    // public Integer getProgramInstanceId()
+    // {
+    // return programInstanceId;
+    // }
+    //
+    // public void setProgramInstanceId( Integer programInstanceId )
+    // {
+    // this.programInstanceId = programInstanceId;
+    // }
 
     private Integer patientId;
 
@@ -313,13 +329,18 @@
             return ERROR;
         }
 
+        if ( programStageService.getProgramStage( programStageId ).getIrregular() )
+        {
+            return REGISTER_NEXT_DUEDATE;
+        }
+
         if ( orgUnitId != 0 )
         {
             return SUCCESS;
         }
         else
         {
-            return "success_find";
+            return SUCCESS_AND_BACK_TO_PROGRAMSTAGE;
         }
     }
 }

=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveRepeatableEvemtAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveRepeatableEvemtAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveRepeatableEvemtAction.java	2012-05-26 12:31:07 +0000
@@ -0,0 +1,155 @@
+/*
+ * 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.light.namebaseddataentry.action;
+
+import org.hisp.dhis.program.ProgramInstance;
+import org.hisp.dhis.program.ProgramInstanceService;
+import org.hisp.dhis.program.ProgramStage;
+import org.hisp.dhis.program.ProgramStageInstance;
+import org.hisp.dhis.program.ProgramStageInstanceService;
+import org.hisp.dhis.program.ProgramStageService;
+import org.joda.time.format.DateTimeFormatter;
+import org.joda.time.format.ISODateTimeFormat;
+import com.opensymphony.xwork2.Action;
+
+public class SaveRepeatableEvemtAction
+    implements Action
+{
+
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private ProgramInstanceService programInstanceService;
+
+    public ProgramInstanceService getProgramInstanceService()
+    {
+        return programInstanceService;
+    }
+
+    public void setProgramInstanceService( ProgramInstanceService programInstanceService )
+    {
+        this.programInstanceService = programInstanceService;
+    }
+
+    private ProgramStageService programStageService;
+
+    public ProgramStageService getProgramStageService()
+    {
+        return programStageService;
+    }
+
+    public void setProgramStageService( ProgramStageService programStageService )
+    {
+        this.programStageService = programStageService;
+    }
+
+    private ProgramStageInstanceService programStageInstanceService;
+
+    public ProgramStageInstanceService getProgramStageInstanceService()
+    {
+        return programStageInstanceService;
+    }
+
+    public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
+    {
+        this.programStageInstanceService = programStageInstanceService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+
+    private Integer programInstanceId;
+
+    public Integer getProgramInstanceId()
+    {
+        return programInstanceId;
+    }
+
+    public void setProgramInstanceId( Integer programInstanceId )
+    {
+        this.programInstanceId = programInstanceId;
+    }
+
+    private Integer programStageId;
+
+    public Integer getProgramStageId()
+    {
+        return programStageId;
+    }
+
+    public void setProgramStageId( Integer programStageId )
+    {
+        this.programStageId = programStageId;
+    }
+
+    private String nextDueDate;
+
+    public String getNextDueDate()
+    {
+        return nextDueDate;
+    }
+
+    public void setNextDueDate( String nextDueDate )
+    {
+        this.nextDueDate = nextDueDate;
+    }
+
+    public Integer currentProgramStageInstanceId;
+
+    public Integer getCurrentProgramStageInstanceId()
+    {
+        return currentProgramStageInstanceId;
+    }
+
+    public void setCurrentProgramStageInstanceId( Integer currentProgramStageInstanceId )
+    {
+        this.currentProgramStageInstanceId = currentProgramStageInstanceId;
+    }
+
+    @Override
+    public String execute()
+        throws Exception
+    {
+        ProgramStageInstance currentStageInstance = programStageInstanceService
+            .getProgramStageInstance( currentProgramStageInstanceId );
+        DateTimeFormatter sdf = ISODateTimeFormat.yearMonthDay();
+        ProgramInstance programInstance = programInstanceService.getProgramInstance( programInstanceId );
+        ProgramStage programStage = programStageService.getProgramStage( programStageId );
+
+        ProgramStageInstance programStageInstance = new ProgramStageInstance();
+        programStageInstance.setDueDate( sdf.parseDateTime( nextDueDate ).toDate() );
+        programStageInstance.setProgramInstance( programInstance );
+        programStageInstance.setProgramStage( programStage );
+        programStageInstance.setStageInProgram( currentStageInstance.getStageInProgram() );
+        
+        programStageInstanceService.addProgramStageInstance( programStageInstance );
+        return SUCCESS;
+    }
+}

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml	2012-05-24 14:51:18 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml	2012-05-26 12:31:07 +0000
@@ -238,6 +238,24 @@
 			ref="org.hisp.dhis.patient.PatientService"/>
 		<property name="programInstanceService"
 			ref="org.hisp.dhis.program.ProgramInstanceService"/>
+	</bean>
+	
+	<bean
+		id="org.hisp.dhis.light.namebaseddataentry.action.GetRepeatableEventRegistrationFormAction"
+		class="org.hisp.dhis.light.namebaseddataentry.action.GetRepeatableEventRegistrationFormAction">
+		<property name="programStageService"
+			ref="org.hisp.dhis.program.ProgramStageService"/>
+	</bean>
+	
+	<bean
+		id="org.hisp.dhis.light.namebaseddataentry.action.SaveRepeatableEvemtAction"
+		class="org.hisp.dhis.light.namebaseddataentry.action.SaveRepeatableEvemtAction">
+		<property name="programInstanceService"
+			ref="org.hisp.dhis.program.ProgramInstanceService"/>
+		<property name="programStageService"
+			ref="org.hisp.dhis.program.ProgramStageService"/>
+		<property name="programStageInstanceService"
+			ref="org.hisp.dhis.program.ProgramStageInstanceService"/>
 	</bean>
 	
 	<!-- Beneficiary Registration -->

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties	2012-05-15 07:40:06 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties	2012-05-26 12:31:07 +0000
@@ -79,4 +79,6 @@
 search_by_name_or_id=Search By Name or ID
 select_orgunit=Select Organisation Unit
 all_orgunit=All Organisation Unit
-tracking_menu=Tracking Menu
\ No newline at end of file
+tracking_menu=Tracking Menu
+due_date=Due Date
+register_due_date_for=Register Due Date For
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml	2012-05-24 14:51:18 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml	2012-05-26 12:31:07 +0000
@@ -129,7 +129,7 @@
 			class="org.hisp.dhis.light.namebaseddataentry.action.SaveProgramStageFormAction">
 			<result name="success" type="redirect">
 				/mobile/selectBeneficiary.action?organisationUnitId=${orgUnitId}&amp;current=${current}&amp;validated=true</result>
-			<result name="success_find" type="redirect">
+			<result name="success_back_to_programstage" type="redirect">
 				/mobile/showPatientProgramStageList.action?patientId=${patientId}&amp;programInstanceId=${programInstanceId}&amp;programId=${programId}&amp;validated=true</result>
 			<result name="error" type="velocity">/dhis-web-light/main.vm</result>
 			<param name="page">/dhis-web-light/namebased/programStageForm.vm</param>
@@ -180,6 +180,14 @@
 				/dhis-web-light/main.vm</result>
 			<param name="page">
 				/dhis-web-light/namebased/beneficiaryProgramStageList.vm</param>
+		</action>
+		
+		<action name="showRepeatableEventRegistrationForm"
+			class="org.hisp.dhis.light.namebaseddataentry.action.GetRepeatableEventRegistrationFormAction">
+			<result name="success" type="velocity">
+				/dhis-web-light/main.vm</result>
+			<param name="page">
+				/dhis-web-light/namebased/repeatableEventRegistrationForm.vm</param>
 		</action>
 		
 		<!-- Beneficiary Registration -->

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramStageList.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramStageList.vm	2012-05-24 14:51:18 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramStageList.vm	2012-05-26 12:31:07 +0000
@@ -10,7 +10,9 @@
 
 <p>
 <ul>
+#set($programInstanceId = 0)
 #foreach( $programStageInstance in $programStageInstances )
+	#set($programInstanceId = $programStageInstance.getProgramInstance().getId())
 	<li>
 		 #if( $programStageInstance.isCompleted() == true )
 		 	<a href="showCompletedProgramStageForm.action?programId=$programId&programStageId=$programStageInstance.getProgramStage().getId()&programStageInstanceId=$programStageInstance.getId()&patientId=$patient.getId()&programInstanceId=$programStageInstance.getProgramInstance().getId()&orgUnitId=0">
@@ -21,6 +23,11 @@
 		 #end
 	</li>
 #end
+<br/>
+#foreach($programStage in $repeatableStages)
+	<li><a href="showRepeatableEventRegistrationForm.action?programInstanceId=$programInstanceId&programStageId=$programStage.getId()&">[+]$i18n.getString("add") $programStage.getName()</a></li>
+#end
+
 </ul>
 </p>
 

=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/repeatableEventRegistrationForm.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/repeatableEventRegistrationForm.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/repeatableEventRegistrationForm.vm	2012-05-26 12:31:07 +0000
@@ -0,0 +1,29 @@
+<h2>$i18n.getString( "register_due_date_for" ) $programStage.getName()</h2>
+<form action="saveMobileProgramEnrollment.action" method="POST">
+<div class="header-box" align="center">
+<input type="hidden" name="patientId" value="$patientId"/>	
+<input type="hidden" name="programId" value="$programId"/>	
+	<p style="text-align: left;">
+		<label>$i18n.getString( "due_date" ) [yyyy-MM-dd] </label>
+		#if( $validationMap.get( "enrollmentDate" ) )
+           	<br /><span style="color: #990000;"> $i18n.getString($validationMap.get( "dueDate" ))</span>
+     	#end
+		<input type="text" name="enrollmentDate" value="$!previousValues.get("dueDate")" />
+	</p>
+</div>
+
+<div class="header-box" align="center">
+	<p>
+		<input type="submit" style="width: 100%;" value="$i18n.getString("enroll")" />
+	</p>
+</div>
+
+</form>
+
+<div id="footer">
+<h2>$i18n.getString( "navigate_to" )</h2>
+<ul>
+	<li> <a href="selectEnrollmentProgram.action?patientId=$patientId"> $i18n.getString("program_list")</a> </li>
+	<li><a href="index.action">$i18n.getString("home")</a></li>
+</ul>
+</div>