← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6941: [mobile] change flow mobile browser

 

------------------------------------------------------------
revno: 6941
committer: Long <thanhlongngo1988@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-05-15 14:40:06 +0700
message:
  [mobile] change flow mobile browser
added:
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/FindBeneficiarytAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetFindBeneficiaryFormAction.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/webapp/dhis-web-light/enrollment/
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryList.vm
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramList.vm
  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/completedProgramStageForm.vm
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/findBeneficiaryForm.vm
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/registration/
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/singleevent/
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/trackingMenu.vm
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java
  dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageFormAction.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/beneficiaryDetail.vm
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/beneficiarySearchingForm.vm
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/programStageForm.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-api/src/main/java/org/hisp/dhis/patient/PatientService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java	2012-04-17 04:39:03 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java	2012-05-15 07:40:06 +0000
@@ -109,6 +109,15 @@
     Collection<Patient> getPatients( String searchText, int min, int max );
     
     /**
+     * Search Patient for mobile base on identifier value
+     * 
+     * @param searchText value
+     * @param orgUnitId
+     * @return Patient List
+     */
+    Collection<Patient> getPatientsForMobile( String searchText, int orgUnitId );
+    
+    /**
      * Search Patient base on organization unit with result limited
      * 
      * @param organisationUnit organisationUnit

=== 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	2012-04-10 06:49:47 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java	2012-05-15 07:40:06 +0000
@@ -235,7 +235,6 @@
 
         ProgramStageInstance programStageInstance = programStageInstanceService.getProgramStageInstance( activityValue
             .getProgramInstanceId() );
-
         if ( programStageInstance == null )
         {
             throw NotAllowedException.INVALID_PROGRAM_STAGE;

=== 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	2011-12-21 04:23:59 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java	2012-05-15 07:40:06 +0000
@@ -253,6 +253,35 @@
     }
 
     @Override
+    public Collection<Patient> getPatientsForMobile( String searchText, int orgUnitId )
+    {
+        int countPatientName = patientStore.countGetPatientsByName( searchText );
+        int countPatientIndentifier = patientIdentifierService.countGetPatientsByIdentifier( searchText );
+
+        Set<Patient> patients = new HashSet<Patient>();
+        patients.addAll( patientIdentifierService.getPatientsByIdentifier( searchText, 0, countPatientIndentifier ) );
+
+        Collection<Patient> patientByName = getPatientsByNames( searchText, 0, countPatientName );
+
+        if ( orgUnitId != 0 )
+        {
+            for ( Patient patient : patientByName )
+            {
+                if ( patient.getOrganisationUnit().getId() != orgUnitId )
+                {
+                    patientByName.remove( patient );
+                }
+            }
+        }
+        else
+        {
+            patients.addAll( patientByName );
+        }
+
+        return patients;
+    }
+
+    @Override
     public Collection<Patient> getPatients( OrganisationUnit organisationUnit )
     {
         return patientStore.getByOrgUnit( organisationUnit );

=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/FindBeneficiarytAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/FindBeneficiarytAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/FindBeneficiarytAction.java	2012-05-15 07:40:06 +0000
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2004-2009, 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 java.util.Collection;
+import org.hisp.dhis.patient.Patient;
+import org.hisp.dhis.patient.PatientService;
+import com.opensymphony.xwork2.Action;
+
+public class FindBeneficiarytAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private PatientService patientService;
+
+    public PatientService getPatientService()
+    {
+        return patientService;
+    }
+
+    public void setPatientService( PatientService patientService )
+    {
+        this.patientService = patientService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+
+    private Collection<Patient> patients;
+
+    public Collection<Patient> getPatients()
+    {
+        return patients;
+    }
+
+    public void setPatients( Collection<Patient> patients )
+    {
+        this.patients = patients;
+    }
+
+    private String keyword;
+
+    public String getKeyword()
+    {
+        return keyword;
+    }
+
+    public void setKeyword( String keyword )
+    {
+        this.keyword = keyword;
+    }
+
+    private int organisationUnitId;
+
+    public int getOrganisationUnitId()
+    {
+        return organisationUnitId;
+    }
+
+    public void setOrganisationUnitId( int organisationUnitId )
+    {
+        this.organisationUnitId = organisationUnitId;
+    }
+
+    @Override
+    public String execute()
+        throws Exception
+    {
+        if ( keyword != null )
+        {
+            int index = keyword.indexOf( ' ' );
+
+            if ( index != -1 && index == keyword.lastIndexOf( ' ' ) )
+            {
+                String[] keys = keyword.split( " " );
+                keyword = keys[0] + "  " + keys[1];
+            }
+        }
+
+        patients = patientService.getPatientsForMobile( keyword, organisationUnitId );
+        return SUCCESS;
+    }
+
+}

=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetFindBeneficiaryFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetFindBeneficiaryFormAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetFindBeneficiaryFormAction.java	2012-05-15 07:40:06 +0000
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2004-2011, 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 java.util.Collection;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.user.CurrentUserService;
+import com.opensymphony.xwork2.Action;
+
+public class GetFindBeneficiaryFormAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+    
+    private CurrentUserService currentUserService;
+    
+    public CurrentUserService getCurrentUserService()
+    {
+        return currentUserService;
+    }
+
+    public void setCurrentUserService( CurrentUserService currentUserService )
+    {
+        this.currentUserService = currentUserService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+
+    private Collection<OrganisationUnit> organisationUnits;
+    
+    public Collection<OrganisationUnit> getOrganisationUnits()
+    {
+        return organisationUnits;
+    }
+
+    public void setOrganisationUnits( Collection<OrganisationUnit> organisationUnits )
+    {
+        this.organisationUnits = organisationUnits;
+    }
+
+    @Override
+    public String execute()
+        throws Exception
+    {
+        organisationUnits = currentUserService.getCurrentUser().getOrganisationUnits();        
+        return SUCCESS;
+    }
+
+}

=== added 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	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetPatientProgramListAction.java	2012-05-15 07:40:06 +0000
@@ -0,0 +1,125 @@
+/*
+ * 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 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 com.opensymphony.xwork2.Action;
+
+public class GetPatientProgramListAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private ProgramInstanceService programInstanceService;
+
+    public ProgramInstanceService getProgramInstanceService()
+    {
+        return programInstanceService;
+    }
+
+    public void setProgramInstanceService( ProgramInstanceService programInstanceService )
+    {
+        this.programInstanceService = programInstanceService;
+    }
+
+    private PatientService patientService;
+
+    public PatientService getPatientService()
+    {
+        return patientService;
+    }
+
+    public void setPatientService( PatientService patientService )
+    {
+        this.patientService = patientService;
+    }
+
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+
+    private int patientId;
+
+    public int getPatientId()
+    {
+        return patientId;
+    }
+
+    public void setPatientId( int patientId )
+    {
+        this.patientId = patientId;
+    }
+
+    private Set<ProgramInstance> programInstances = new HashSet<ProgramInstance>();
+
+    public Set<ProgramInstance> getProgramInstances()
+    {
+        return programInstances;
+    }
+
+    public void setProgramInstances( Set<ProgramInstance> programInstances )
+    {
+        this.programInstances = programInstances;
+    }
+
+    private Patient patient;
+    
+    public Patient getPatient()
+    {
+        return patient;
+    }
+
+    public void setPatient( Patient patient )
+    {
+        this.patient = patient;
+    }
+
+    @Override
+    public String execute()
+        throws Exception
+    {
+        programInstances.clear();
+        patient = patientService.getPatient( patientId );
+        for ( ProgramInstance programInstance : programInstanceService.getProgramInstances( patient ) )
+        {
+            if (!programInstance.getProgram().getAnonymous() && !programInstance.getProgram().getSingleEvent()) {
+            programInstances.add( programInstance );
+            }
+        }
+
+        return SUCCESS;
+    }
+
+}

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageFormAction.java	2012-04-10 06:49:47 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageFormAction.java	2012-05-15 07:40:06 +0000
@@ -36,12 +36,15 @@
 import org.hisp.dhis.light.utils.NamebasedUtils;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.program.ProgramStageInstanceService;
 
 import com.opensymphony.xwork2.Action;
 
 public class GetProgramStageFormAction
     implements Action
 {
+    private static final String INCOMPLETE = "incomplete";
+
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
@@ -65,18 +68,42 @@
         return util;
     }
 
+    private ProgramStageInstanceService programStageInstanceService;
+
+    public ProgramStageInstanceService getProgramStageInstanceService()
+    {
+        return programStageInstanceService;
+    }
+
+    public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
+    {
+        this.programStageInstanceService = programStageInstanceService;
+    }
+
     // -------------------------------------------------------------------------
     // Input & Output
     // -------------------------------------------------------------------------
 
-    private String programStageInstanceId;
-
-    public String getProgramStageInstanceId()
+    private int programInstanceId;
+
+    public int getProgramInstanceId()
+    {
+        return programInstanceId;
+    }
+
+    public void setProgramInstanceId( int programInstanceId )
+    {
+        this.programInstanceId = programInstanceId;
+    }
+    
+    private int programStageInstanceId;
+    
+    public int getProgramStageInstanceId()
     {
         return programStageInstanceId;
     }
 
-    public void setProgramStageInstanceId( String programStageInstanceId )
+    public void setProgramStageInstanceId( int programStageInstanceId )
     {
         this.programStageInstanceId = programStageInstanceId;
     }
@@ -99,8 +126,7 @@
     {
         return this.organisationUnit;
     }
-    
-    
+
     public void setOrganisationUnit( OrganisationUnit organisationUnit )
     {
         this.organisationUnit = organisationUnit;
@@ -176,9 +202,9 @@
     {
         return this.program;
     }
-    
+
     private boolean current;
-    
+
     // -------------------------------------------------------------------------
     // Action Implementation
     // -------------------------------------------------------------------------
@@ -197,12 +223,13 @@
     public String execute()
         throws Exception
     {
-        organisationUnit = organisationUnitService.getOrganisationUnit( Integer.parseInt( orgUnitId ) );
+        // organisationUnit = organisationUnitService.getOrganisationUnit(
+        // Integer.parseInt( orgUnitId ) );
 
         programStage = util.getProgramStage( Integer.parseInt( programId ), Integer.parseInt( programStageId ) );
-
         dataElements = programStage.getDataElements();
-
+       
         return SUCCESS;
+
     }
 }

=== added 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	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/GetProgramStageListAction.java	2012-05-15 07:40:06 +0000
@@ -0,0 +1,156 @@
+/*
+ * 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 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.ProgramStageInstance;
+import com.opensymphony.xwork2.Action;
+
+public class GetProgramStageListAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+    
+    private PatientService patientService;
+    
+    public PatientService getPatientService()
+    {
+        return patientService;
+    }
+
+    public void setPatientService( PatientService patientService )
+    {
+        this.patientService = patientService;
+    }
+    
+    private ProgramInstanceService programInstanceService;
+    
+    public ProgramInstanceService getProgramInstanceService()
+    {
+        return programInstanceService;
+    }
+
+    public void setProgramInstanceService( ProgramInstanceService programInstanceService )
+    {
+        this.programInstanceService = programInstanceService;
+    }
+    
+    // -------------------------------------------------------------------------
+    // Input & Output
+    // -------------------------------------------------------------------------
+
+    private Set<ProgramStageInstance> programStageInstances;
+    
+    public Set<ProgramStageInstance> getProgramStageInstances()
+    {
+        return programStageInstances;
+    }
+
+    public void setProgramStageInstances( Set<ProgramStageInstance> programStageInstances )
+    {
+        this.programStageInstances = programStageInstances;
+    }
+    
+    private int programInstanceId;
+    
+    public int getProgramInstanceId()
+    {
+        return programInstanceId;
+    }
+
+    public void setProgramInstanceId( int programInstanceId )
+    {
+        this.programInstanceId = programInstanceId;
+    }
+    
+    private int patientId;
+    
+    public int getPatientId()
+    {
+        return patientId;
+    }
+
+    public void setPatientId( int patientId )
+    {
+        this.patientId = patientId;
+    }
+    
+    private Patient patient;
+    
+    public Patient getPatient()
+    {
+        return patient;
+    }
+
+    public void setPatient( Patient patient )
+    {
+        this.patient = patient;
+    }
+    
+    private int programId;
+    
+    public int getProgramId()
+    {
+        return programId;
+    }
+
+    public void setProgramId( int programId )
+    {
+        this.programId = programId;
+    }
+    
+    private boolean validated;
+    
+    public boolean isValidated()
+    {
+        return validated;
+    }
+
+    public void setValidated( boolean validated )
+    {
+        this.validated = validated;
+    }
+
+    @Override
+    public String execute()
+        throws Exception
+    {
+        ProgramInstance programInstance = programInstanceService.getProgramInstance( programInstanceId );
+        patient = patientService.getPatient( patientId );
+        programStageInstances = programInstance.getProgramStageInstances();
+        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-04-13 04:19:58 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveProgramStageFormAction.java	2012-05-15 07:40:06 +0000
@@ -43,6 +43,7 @@
 import org.hisp.dhis.light.utils.NamebasedUtils;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.patient.PatientService;
 import org.hisp.dhis.util.ContextUtils;
 import com.opensymphony.xwork2.Action;
 import com.opensymphony.xwork2.ActionContext;
@@ -88,18 +89,30 @@
         this.organisationUnitService = organisationUnitService;
     }
 
+    private PatientService patientService;
+
+    public PatientService getPatientService()
+    {
+        return patientService;
+    }
+
+    public void setPatientService( PatientService patientService )
+    {
+        this.patientService = patientService;
+    }
+
     // -------------------------------------------------------------------------
     // Input & Output
     // -------------------------------------------------------------------------
 
-    private String orgUnitId;
+    private int orgUnitId;
 
-    public void setOrgUnitId( String orgUnitId )
+    public void setOrgUnitId( int orgUnitId )
     {
         this.orgUnitId = orgUnitId;
     }
 
-    public String getOrgUnitId()
+    public int getOrgUnitId()
     {
         return orgUnitId;
     }
@@ -118,6 +131,18 @@
         this.programStageInstanceId = programStageInstanceId;
     }
 
+    private String programInstanceId;
+
+    public String getProgramInstanceId()
+    {
+        return programInstanceId;
+    }
+
+    public void setProgramInstanceId( String programInstanceId )
+    {
+        this.programInstanceId = programInstanceId;
+    }
+
     private String beneficiaryId;
 
     public void setBeneficiaryId( String beneficiaryId )
@@ -199,7 +224,14 @@
     public String execute()
         throws Exception
     {
-        organisationUnit = organisationUnitService.getOrganisationUnit( Integer.parseInt( orgUnitId ) );
+        if ( orgUnitId != 0 )
+        {
+            organisationUnit = organisationUnitService.getOrganisationUnit(  orgUnitId  );
+        }
+        else
+        {
+            organisationUnit = patientService.getPatient( Integer.parseInt( beneficiaryId ) ).getOrganisationUnit();
+        }
 
         programStage = util.getProgramStage( Integer.parseInt( programId ), Integer.parseInt( programStageId ) );
 
@@ -265,11 +297,18 @@
         catch ( NotAllowedException e )
         {
             e.printStackTrace();
-
             return ERROR;
         }
 
-        return SUCCESS;
+        if ( orgUnitId != 0 )
+        {
+            return SUCCESS;
+        }
+        else
+        {
+            return "success_find";
+        }
+
     }
 
 }

=== 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-03 09:53:40 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml	2012-05-15 07:40:06 +0000
@@ -174,7 +174,9 @@
 		class="org.hisp.dhis.light.namebaseddataentry.action.GetProgramStageFormAction">
 		<property name="organisationUnitService"
 			ref="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
-		<property name="util" ref="org.hisp.dhis.light.utils.NamebasedUtils"/>
+		<property name="util" ref="org.hisp.dhis.light.utils.NamebasedUtils"/>
+		<property name="programStageInstanceService"
+			ref="org.hisp.dhis.program.ProgramStageInstanceService"/>
 	</bean>
 	
 	<bean id="org.hisp.dhis.light.utils.NamebasedUtils"
@@ -192,7 +194,8 @@
 			ref="org.hisp.dhis.mobile.api.ActivityReportingService"/>
 		<property name="dataElementService"
 			ref="org.hisp.dhis.dataelement.DataElementService"/>
-		<property name="util" ref="org.hisp.dhis.light.utils.NamebasedUtils"/>
+		<property name="util" ref="org.hisp.dhis.light.utils.NamebasedUtils"/>
+		<property name="patientService" ref="org.hisp.dhis.patient.PatientService"/>
 	</bean>
 	
 	<bean
@@ -200,6 +203,38 @@
 		class="org.hisp.dhis.light.namebaseddataentry.action.GetBeneficiaryDetailAction">
 		<property name="patientService"
 			ref="org.hisp.dhis.patient.PatientService"/>
+	</bean>
+	
+	<bean
+		id="org.hisp.dhis.light.namebaseddataentry.action.GetFindBeneficiaryFormAction"
+		class="org.hisp.dhis.light.namebaseddataentry.action.GetFindBeneficiaryFormAction">
+		<property name="currentUserService"
+			ref="org.hisp.dhis.user.CurrentUserService"/>
+	</bean>
+	
+	<bean
+		id="org.hisp.dhis.light.namebaseddataentry.action.FindBeneficiarytAction"
+		class="org.hisp.dhis.light.namebaseddataentry.action.FindBeneficiarytAction">
+		<property name="patientService"
+			ref="org.hisp.dhis.patient.PatientService"/>
+	</bean>
+	
+	<bean
+		id="org.hisp.dhis.light.namebaseddataentry.action.GetPatientProgramListAction"
+		class="org.hisp.dhis.light.namebaseddataentry.action.GetPatientProgramListAction">
+		<property name="patientService"
+			ref="org.hisp.dhis.patient.PatientService"/>
+		<property name="programInstanceService"
+			ref="org.hisp.dhis.program.ProgramInstanceService"/>
+	</bean>
+	
+	<bean
+		id="org.hisp.dhis.light.namebaseddataentry.action.GetProgramStageListAction"
+		class="org.hisp.dhis.light.namebaseddataentry.action.GetProgramStageListAction">
+		<property name="patientService"
+			ref="org.hisp.dhis.patient.PatientService"/>
+		<property name="programInstanceService"
+			ref="org.hisp.dhis.program.ProgramInstanceService"/>
 	</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-03 09:53:40 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties	2012-05-15 07:40:06 +0000
@@ -73,3 +73,10 @@
 program_list=Program List
 single_event=Single Event
 single_event_list=Single Event List
+tracking=Tracking
+find_beneficiary=Find Beneficiary
+activity_plan=Activity Plan
+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

=== 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-03 09:53:40 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml	2012-05-15 07:40:06 +0000
@@ -73,6 +73,14 @@
 		</action>
 		
 		<!-- Namebased Data Entry -->
+		
+		<action name="trackingMenu"
+			class="org.hisp.dhis.light.action.NoAction">
+			<result name="success" type="velocity">
+				/dhis-web-light/main.vm</result>
+			<param name="page">
+				/dhis-web-light/trackingMenu.vm</param>
+		</action>
 		
 		<action name="selectNamebasedOrganisationUnit"
 			class="org.hisp.dhis.light.namebaseddataentry.action.GetNamebasedOrganisationUnitsAction">
@@ -104,16 +112,25 @@
 		</action>
 		
 		<action name="showProgramStageForm"
-			class="org.hisp.dhis.light.namebaseddataentry.action.GetProgramStageFormAction">
-			<result name="success" type="velocity">
-				/dhis-web-light/main.vm</result>
+			class="org.hisp.dhis.light.namebaseddataentry.action.GetProgramStageFormAction">
+			<result name="success" type="velocity">
+				/dhis-web-light/main.vm</result>
 			<param name="page">/dhis-web-light/programStageForm.vm</param>
+		</action>
+		
+		<action name="showCompletedProgramStageForm"
+			class="org.hisp.dhis.light.namebaseddataentry.action.GetProgramStageFormAction">
+			<result name="success" type="velocity">
+				/dhis-web-light/main.vm</result>
+			<param name="page">/dhis-web-light/namebased/completedProgramStageForm.vm</param>
 		</action>
 		
 		<action name="saveProgramStageForm"
 			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>
+				/mobile/selectBeneficiary.action?organisationUnitId=${orgUnitId}&amp;current=${current}&amp;validated=true</result>
+			<result name="success_find" type="redirect">
+				/mobile/showPatientProgramStageList.action?patientId=${beneficiaryId}&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/programStageForm.vm</param>
 		</action>
@@ -123,6 +140,46 @@
 			<result name="success" type="velocity">
 				/dhis-web-light/main.vm</result>
 			<param name="page">/dhis-web-light/beneficiaryDetail.vm</param>
+		</action>
+		
+		<action name="showBeneficiaryDetailInSearchPage"
+			class="org.hisp.dhis.light.namebaseddataentry.action.GetBeneficiaryDetailAction">
+			<result name="success" type="velocity">
+				/dhis-web-light/main.vm</result>
+			<param name="page">/dhis-web-light/beneficiaryDetail.vm</param>
+			<param name="previouspage">showPatientProgramList.action?patientId=${beneficiaryId}</param>
+		</action>
+		
+		<action name="showFindBeneficiaryForm"
+			class="org.hisp.dhis.light.namebaseddataentry.action.GetFindBeneficiaryFormAction">
+			<result name="success" type="velocity">
+				/dhis-web-light/main.vm</result>
+			<param name="page">
+				/dhis-web-light/namebased/findBeneficiaryForm.vm</param>
+		</action>
+		
+		<action name="findBeneficiary"
+			class="org.hisp.dhis.light.namebaseddataentry.action.FindBeneficiarytAction">
+			<result name="success" type="velocity">
+				/dhis-web-light/main.vm</result>
+			<param name="page">
+				/dhis-web-light/namebased/beneficiaryList.vm</param>
+		</action>
+		
+		<action name="showPatientProgramList"
+			class="org.hisp.dhis.light.namebaseddataentry.action.GetPatientProgramListAction">
+			<result name="success" type="velocity">
+				/dhis-web-light/main.vm</result>
+			<param name="page">
+				/dhis-web-light/namebased/beneficiaryProgramList.vm</param>
+		</action>
+		
+		<action name="showPatientProgramStageList"
+			class="org.hisp.dhis.light.namebaseddataentry.action.GetProgramStageListAction">
+			<result name="success" type="velocity">
+				/dhis-web-light/main.vm</result>
+			<param name="page">
+				/dhis-web-light/namebased/beneficiaryProgramStageList.vm</param>
 		</action>
 		
 		<!-- Beneficiary Registration -->

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/beneficiaryDetail.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/beneficiaryDetail.vm	2012-04-10 06:49:47 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/beneficiaryDetail.vm	2012-05-15 07:40:06 +0000
@@ -1,4 +1,4 @@
-<h2>$i18n.getString("details_for") $patient.firstName $patient.middleName $patient.lastName   </h2>
+<h2>$i18n.getString("details_for") $!encoder.htmlEncode( ${patient.getFullName()} )   </h2>
 <p>
 
 <ul>
@@ -15,6 +15,10 @@
 <div id="footer">
 <h2>$i18n.getString( "navigate_to" )</h2>
 <ul>
-	<li><a href="selectActivity.action?organisationUnitId=$organisationUnitId&beneficiaryId=$patient.id&current=$current"> $i18n.getString("activity_list")</a></li>
+	#if($organisationUnitId == "0")
+		<li><a href="showPatientProgramList.action?patientId=$patient.id">$!encoder.htmlEncode( ${patient.getFullName()} )</a></li>
+	#else
+		<li><a href="selectActivity.action?organisationUnitId=$organisationUnitId&beneficiaryId=$patient.id&current=$current"> $i18n.getString("activity_list")</a></li>
+	#end
 	<li><a href="index.action">$i18n.getString("home")</a></li>
 </ul>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/beneficiarySearchingForm.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/beneficiarySearchingForm.vm	2012-04-20 02:32:43 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/beneficiarySearchingForm.vm	2012-05-15 07:40:06 +0000
@@ -31,7 +31,7 @@
 <div id="footer">
 <h2>$i18n.getString( "navigate_to" )</h2>
 <ul>
-	<li> <a href="selectRegistrationOrganisationUnit?orgUnitId=$orgUnitId"> $i18n.getString("organisation_unit")</a> </li>
+	<li><a href="trackingMenu.action"> $i18n.getString("tracking_menu")</a> </li>
 	<li><a href="index.action">$i18n.getString("home")</a></li>
 </ul>
 </div>

=== added directory 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/enrollment'
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm	2012-04-20 02:32:43 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm	2012-05-15 07:40:06 +0000
@@ -21,9 +21,7 @@
 <p>
 <ul>
     <li><a href="selectOrganisationUnit.action">$i18n.getString( "data_entry" )</a></li>
-    <li><a href="selectNamebasedOrganisationUnit.action">$i18n.getString( "namebased_data_entry" )</a></li>
-    <li><a href="selectRegistrationOrganisationUnit.action">$i18n.getString( "beneficiary_registration" )</a></li>
-    <li><a href="showBeneficiarySearchingForm.action">$i18n.getString( "beneficiary_enrollment" )</a></li>
+    <li><a href="trackingMenu.action">$i18n.getString( "tracking" )</a></li>
     <li><a href="messages.action">$i18n.getString( "messages" ) #if($unreadMessageConversationCount > 0)($unreadMessageConversationCount)#end</a></li>
     <li><a href="reports.action">$i18n.getString( "reports" )</a></li>
     <li><a href="settings.action">$i18n.getString( "settings" )</a></li>

=== added directory 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased'
=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryList.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryList.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryList.vm	2012-05-15 07:40:06 +0000
@@ -0,0 +1,23 @@
+<h2>$i18n.getString( "beneficiary_list" )</h2>
+	#if( $validated)
+		<div class="header-box">
+			<h3 style="text-align: left;">$i18n.getString("successfully_saved")</h3>
+		</div>
+	#else	
+	
+	#end
+<p>
+<ul>
+#foreach( $patient in $patients )
+	<li><a href="showPatientProgramList.action?patientId=$patient.getId()">$!encoder.htmlEncode( ${patient.getFullName()} )</a></li>
+#end
+</ul>
+</p>
+
+<div id="footer">
+<h2>$i18n.getString( "navigate_to" )</h2>
+<ul>
+	<li> <a href="trackingMenu.action"> $i18n.getString("tracking_menu")</a></li>
+	<li><a href="index.action">$i18n.getString("home")</a></li>
+</ul>
+</div>
\ No newline at end of file

=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramList.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramList.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramList.vm	2012-05-15 07:40:06 +0000
@@ -0,0 +1,25 @@
+<h2>$!encoder.htmlEncode( ${patient.getFullName()} )</h2>
+<p>
+	<ul>
+		<li>
+			<a href="showBeneficiaryDetail.action?beneficiaryId=$patient.getId()&current=true&organisationUnitId=0"> $i18n.getString( "details" ) </a>
+		</li> 
+	</ul>
+<ul>
+#foreach( $programInstance in $programInstances )
+	<li>
+		<a href="showPatientProgramStageList.action?patientId=$patientId&programInstanceId=$programInstance.getId()&programId=$programInstance.getProgram().getId()">
+			 $programInstance.getProgram().getName()
+		</a> 
+	</li>
+#end
+</ul>
+</p>
+
+<div id="footer">
+<h2>$i18n.getString( "navigate_to" )</h2>
+<ul>
+	<li><a href="trackingMenu.action">$i18n.getString("tracking")</a></li>
+	<li><a href="index.action">$i18n.getString("home")</a></li>
+</ul>
+</div>
\ No newline at end of file

=== added 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	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/beneficiaryProgramStageList.vm	2012-05-15 07:40:06 +0000
@@ -0,0 +1,33 @@
+<h2>$!encoder.htmlEncode( ${patient.getFullName()} )</h2>
+
+#if( $validated == true)
+		<div class="header-box">
+			<h3 style="text-align: left;">$i18n.getString("successfully_saved")</h3>
+		</div>
+	#else
+	
+	#end
+
+<p>
+<ul>
+#foreach( $programStageInstance in $programStageInstances )
+	<li>
+		 #if( $programStageInstance.isCompleted() == true )
+		 	<a href="showCompletedProgramStageForm.action?programId=$programId&programStageId=$programStageInstance.getProgramStage().getId()&programStageInstanceId=$programStageInstance.getId()&beneficiaryId=$patient.getId()&programInstanceId=$programStageInstance.getProgramInstance().getId()&orgUnitId=0">
+			$programStageInstance.getProgramStage().getName()<img src="../dhis-web-light/images/checkmark.jpg" /></a>
+		 #else 
+		 	<a href="showProgramStageForm.action?programId=$programId&programStageId=$programStageInstance.getProgramStage().getId()&programStageInstanceId=$programStageInstance.getId()&beneficiaryId=$patient.getId()&programInstanceId=$programStageInstance.getProgramInstance().getId()&orgUnitId=0">
+		 	$programStageInstance.getProgramStage().getName()</a>
+		 #end
+	</li>
+#end
+</ul>
+</p>
+
+<div id="footer">
+<h2>$i18n.getString( "navigate_to" )</h2>
+<ul>
+	<li><a href="showPatientProgramList.action?patientId=$patient.getId()">$!encoder.htmlEncode( ${patient.getFullName()} )</a></li>
+	<li><a href="index.action">$i18n.getString("home")</a></li>
+</ul>
+</div>
\ No newline at end of file

=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/completedProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/completedProgramStageForm.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/completedProgramStageForm.vm	2012-05-15 07:40:06 +0000
@@ -0,0 +1,111 @@
+<h2>$encoder.htmlEncode( $programStage.name )</h2>
+
+#set( $typeViolationsSize = $typeViolations.size() )
+
+#if( $typeViolationsSize > 0 )
+<div class="header-box" align="center">
+	<h3 style="text-align: left; background-color: #990000; color: white;">$i18n.getString("warnings_and_errors")</h3>
+	<p style="text-align: left;">
+		$typeViolationsSize $i18n.getString("type_violation_errors"). <br />
+	</p>
+</div>	
+#end
+
+<form action="saveProgramStageForm.action" method="POST">
+
+<input type="hidden" value=$programStageInstanceId name="programStageInstanceId"/>
+<input type="hidden" value=$programStageId name="programStageId"/>
+<input type="hidden" value=$orgUnitId name="orgUnitId"/>
+<input type="hidden" value=$programId name="programId" />
+<input type="hidden" value=$beneficiaryId name="beneficiaryId" />
+<input type="hidden" id="current" name="current" value=$current />
+
+<div class="header-box" align="center">
+	<p style="text-align: left;">
+		#foreach( $dataElement in $dataElements)
+			#if( $dataElement.shortName )
+				#set( $dataElementName = $dataElement.shortName )
+			#else
+				#set( $dataElementName = $dataElement.name )
+			#end
+				#if ($dataElement.getCategoryOptionCombos().getModels().size() == 1)			
+					#set( $categoryOptionCombo = $dataElement.getCategoryOptionCombos().getModels().get( 0 ) )
+					#set( $key = "DE${dataElement.id}OC${categoryOptionCombo.id}" )
+
+					<label>$encoder.htmlEncode( $dataElementName ) #if( $categoryOptionCombo.name!="(default)")$encoder.htmlEncode( $categoryOptionCombo.name )#end 
+					#if($dataElement.type=="date") [yyyy-MM-dd] #end
+					</label>
+					
+					#if( $typeViolations.get( $key ) )
+                		#set( $typeViolation = $typeViolations.get( $key ) )
+            			<br /><span style="color: #990000;">$prevDataValues.get($key) $i18n.getString($typeViolation)</span>
+            		#end
+					
+					<input type=
+					#if($dataElement.type=="string") 
+						"text"
+					#elseif ($dataElement.type=="int" ) 
+						"text" 
+					#else 
+						"$dataElement.type" 
+					#end 
+					name="$key" value="$!prevDataValues.get($key)" DISABLED/>
+				
+				#elseif ($dataElement.getCategoryOptionCombos().getModels().size() > 1)
+					
+					#set( $categoryOptionCombo = $dataElement.getCategoryOptionCombos().getModels().get( 0 ) )
+					#set( $key = "DE${dataElement.id}OC${categoryOptionCombo.id}" )
+
+					$dataElementName
+
+					#if( $typeViolations.get( $key ) )
+                    	#set( $typeViolation = $typeViolations.get( $key ) )
+                		<br /><span style="color: #990000;"> $prevDataValues.get($key) $i18n.getString($typeViolation)</span>
+                	#end
+                
+					<select type=
+					#if($dataElement.type=="string") 
+						"text"
+					#elseif($dataElement.type=="int" ) 
+						"text"
+					#else 
+						"$dataElement.type"
+					#end 
+					name="$key" DISABLED/>
+				
+					#set( $selected=false )
+
+					#foreach ($categoryOptionCombo in $dataElement.categoryOptionCombos.models)
+						<option value="$categoryOptionCombo.name"
+						#if( !$typeViolations.containsKey( $key ) && $prevDataValues.get( $key ) == $categoryOptionCombo.name ) 
+							selected
+							#set( $selected=true )
+						#end
+						> $categoryOptionCombo.name </option>
+					#end
+
+					#if( !$selected ) 
+						<option selected > $i18n.getString("select_option") </option>
+					#end
+					
+					</select>
+				#end
+		#end
+	</p>
+</div>
+
+<div class="header-box" align="center">
+	<p>
+		<input type="submit" style="width: 100%;" value="$i18n.getString("save")" />
+	</p>
+</div>
+
+</form>
+
+<div id="footer">
+<h2>$i18n.getString( "navigate_to" )</h2>
+<ul>
+	<li><li><a href="trackingMenu.action"> $i18n.getString("tracking_menu")</a> </li></li>
+	<li><a href="index.action">$i18n.getString("home")</a></li>
+</ul>
+</div>

=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/findBeneficiaryForm.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/findBeneficiaryForm.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/findBeneficiaryForm.vm	2012-05-15 07:40:06 +0000
@@ -0,0 +1,47 @@
+<h2>$i18n.getString( "beneficiary_search" )</h2>
+
+	#if( $validated == true)
+		<div class="header-box">
+			<h3 style="text-align: left;">$i18n.getString("successfully_saved")</h3>
+		</div>
+	#else
+	
+	#end
+
+<form action="findBeneficiary.action" method="POST">
+<div class="header-box" align="center">
+<input type="hidden" name="orgUnitId" value="$orgUnitId"/>	
+	<p style="text-align: left;">
+		<label>$i18n.getString( "search_by_name_or_id" )</label>
+		#if( $validationMap.get( "keyword" ) )
+           	<br /><span style="color: #990000;"> $i18n.getString($validationMap.get( "fullName" ))</span>
+     	#end
+		<input type="text" name="keyword" value="$!previousValues.get("fullName")" />
+	</p>
+		<p style="text-align: left;">
+		<label>$i18n.getString( "select_orgunit" )</label>
+		<select name="organisationUnitId">
+			<option value="0">$i18n.getString( "all_orgunit" )</option>
+			#foreach($orgUnit in $organisationUnits)
+				<option value="$orgUnit.getId()">$orgUnit.getName()</option>
+			#end
+		</select>
+	</p>
+	
+</div>
+
+<div class="header-box" align="center">
+	<p>
+		<input type="submit" style="width: 100%;" value="$i18n.getString("search")" />
+	</p>
+</div>
+
+</form>
+
+<div id="footer">
+<h2>$i18n.getString( "navigate_to" )</h2>
+<ul>
+	<li> <a href="trackingMenu.action"> $i18n.getString("tracking_menu")</a> </li>
+	<li><a href="index.action">$i18n.getString("home")</a></li>
+</ul>
+</div>

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/programStageForm.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/programStageForm.vm	2012-04-13 04:19:58 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/programStageForm.vm	2012-05-15 07:40:06 +0000
@@ -13,6 +13,7 @@
 
 <form action="saveProgramStageForm.action" method="POST">
 
+<input type="hidden" value=$programInstanceId name="programInstanceId"/>
 <input type="hidden" value=$programStageInstanceId name="programStageInstanceId"/>
 <input type="hidden" value=$programStageId name="programStageId"/>
 <input type="hidden" value=$orgUnitId name="orgUnitId"/>
@@ -105,7 +106,7 @@
 <div id="footer">
 <h2>$i18n.getString( "navigate_to" )</h2>
 <ul>
-	<li> <a href="selectActivity.action?organisationUnitId=$orgUnitId&beneficiaryId=$beneficiaryId&current=$current"> $i18n.getString("activity_list") </a> </li>
+	<li><a href="trackingMenu.action"> $i18n.getString("tracking_menu")</a></li>
 	<li><a href="index.action">$i18n.getString("home")</a></li>
 </ul>
 </div>

=== added directory 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/registration'
=== added directory 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/singleevent'
=== added file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/trackingMenu.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/trackingMenu.vm	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/trackingMenu.vm	2012-05-15 07:40:06 +0000
@@ -0,0 +1,37 @@
+
+#if( $dataSet.alternativeName )
+    #set( $dataSetName = $dataSet.alternativeName )
+#else
+    #set( $dataSetName = $dataSet.name )
+#end
+
+#if( $complete == true )
+<div class="header-box" align="center">
+    <h3 style="text-align: left; background-color: #719953; border-color: #719953; color: white;">$i18n.getString("completed")</h3>
+    <p style="text-align: left;">
+        $organisationUnit.name <br />
+        $dataSetName <br />
+        $period.name
+    </p>
+</div>
+#end
+
+<h2>$i18n.getString( "tracking_menu" )</h2>
+
+<p>
+<ul>
+    <li><a href="showFindBeneficiaryForm.action">$i18n.getString( "find_beneficiary" )</a></li>
+    <li><a href="selectNamebasedOrganisationUnit.action">$i18n.getString( "activity_plan" )</a></li>
+    <li><a href="showBeneficiarySearchingForm.action">$i18n.getString( "beneficiary_enrollment" )</a></li>
+    <li><a href="selectRegistrationOrganisationUnit.action">$i18n.getString( "beneficiary_registration" )</a></li>
+</ul>
+</p>
+
+<div id="footer">
+<h2>$i18n.getString( "navigate_to" )</h2>
+<ul>
+    <li><a href="feedback.action">$i18n.getString("feedback")</a></li>
+	<li><a href="../dhis-web-commons-security/logout.action">$i18n.getString("logout")</a></li>
+    <li style="padding-top: 5px;"><a href="../">$i18n.getString("desktop_version")</a></li>
+</ul>
+</div>