← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14955: R. 14947

 

------------------------------------------------------------
revno: 14955
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-04-24 07:45:11 +0800
message:
  R. 14947
removed:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SendSmsToListAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SearchTrackedEntityInstanceAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm
modified:
  dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramStageInstanceByIdAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTrackedEntityInstanceCriteria.vm
  dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java	2014-04-23 20:15:31 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java	2014-04-23 23:45:11 +0000
@@ -161,7 +161,8 @@
         {
             if ( !organisationUnit.hasLevel() )
             {
-                organisationUnit.setLevel( organisationUnitService.getLevelOfOrganisationUnit( organisationUnit.getId() ) );
+                organisationUnit
+                    .setLevel( organisationUnitService.getLevelOfOrganisationUnit( organisationUnit.getId() ) );
             }
         }
 
@@ -175,12 +176,14 @@
         {
             if ( params.hasProgram() )
             {
-                params.addAttributesIfNotExist( QueryItem.getQueryItems( params.getProgram().getTrackedEntityAttributes() ) );
+                params.addAttributesIfNotExist( QueryItem.getQueryItems( params.getProgram()
+                    .getTrackedEntityAttributes() ) );
             }
             else
             {
                 Collection<TrackedEntityAttribute> filters = attributeService.getAllTrackedEntityAttributes();
-                Collection<TrackedEntityAttribute> attributes = attributeService.getTrackedEntityAttributesDisplayInList( true );
+                Collection<TrackedEntityAttribute> attributes = attributeService
+                    .getTrackedEntityAttributesDisplayInList( true );
                 filters.removeAll( attributes );
 
                 params.addAttributesIfNotExist( QueryItem.getQueryItems( attributes ) );
@@ -414,7 +417,8 @@
         {
             return getItem( item, null, null );
         }
-        else // Filter
+        else
+        // Filter
         {
             String[] split = item.split( DimensionalObjectUtils.DIMENSION_NAME_SEP );
 

=== removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java	2014-04-22 23:37:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java	1970-01-01 00:00:00 +0000
@@ -1,231 +0,0 @@
-package org.hisp.dhis.caseentry.action.caseentry;
-
-/*
- * Copyright (c) 2004-2014, 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.
- */
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-
-import org.hisp.dhis.common.Grid;
-import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
-import org.hisp.dhis.paging.ActionPagingSupport;
-import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramInstance;
-import org.hisp.dhis.program.ProgramService;
-import org.hisp.dhis.program.ProgramStageInstance;
-import org.hisp.dhis.program.ProgramStageInstanceService;
-import org.hisp.dhis.trackedentity.TrackedEntityInstance;
-import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
-import org.hisp.dhis.trackedentity.TrackedEntityInstanceService;
-
-public class GetDataRecordsAction
-    extends ActionPagingSupport<TrackedEntityInstance>
-{
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private OrganisationUnitSelectionManager selectionManager;
-
-    public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
-    {
-        this.selectionManager = selectionManager;
-    }
-
-    private TrackedEntityInstanceService entityInstanceService;
-
-    public void setEntityInstanceService( TrackedEntityInstanceService entityInstanceService )
-    {
-        this.entityInstanceService = entityInstanceService;
-    }
-
-    private ProgramService programService;
-
-    public void setProgramService( ProgramService programService )
-    {
-        this.programService = programService;
-    }
-
-    private ProgramStageInstanceService programStageInstanceService;
-
-    public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
-    {
-        this.programStageInstanceService = programStageInstanceService;
-    }
-
-    private I18n i18n;
-
-    public void setI18n( I18n i18n )
-    {
-        this.i18n = i18n;
-    }
-
-    // -------------------------------------------------------------------------
-    // Input/output
-    // -------------------------------------------------------------------------
-
-    private String programId;
-
-    public void setProgramId( String programId )
-    {
-        this.programId = programId;
-    }
-
-    private List<String> searchTexts = new ArrayList<String>();
-
-    public void setSearchTexts( List<String> searchTexts )
-    {
-        this.searchTexts = searchTexts;
-    }
-
-    private Integer total;
-
-    public Integer getTotal()
-    {
-        return total;
-    }
-
-    private Map<TrackedEntityInstance, ProgramInstance> programInstanceMap = new HashMap<TrackedEntityInstance, ProgramInstance>();
-
-    public Map<TrackedEntityInstance, ProgramInstance> getProgramInstanceMap()
-    {
-        return programInstanceMap;
-    }
-
-    private Collection<TrackedEntityInstance> entityInstances;
-
-    public Collection<TrackedEntityInstance> getEntityInstances()
-    {
-        return entityInstances;
-    }
-
-    private List<ProgramStageInstance> programStageInstances = new ArrayList<ProgramStageInstance>();
-
-    public List<ProgramStageInstance> getProgramStageInstances()
-    {
-        return programStageInstances;
-    }
-
-    private List<TrackedEntityAttribute> attributes = new ArrayList<TrackedEntityAttribute>();
-
-    public List<TrackedEntityAttribute> getAttributes()
-    {
-        return attributes;
-    }
-
-    private Program program;
-
-    public Program getProgram()
-    {
-        return program;
-    }
-
-    private String type;
-
-    public void setType( String type )
-    {
-        this.type = type;
-    }
-
-    private Grid grid;
-
-    public Grid getGrid()
-    {
-        return grid;
-    }
-
-    private Boolean followup;
-
-    public void setFollowup( Boolean followup )
-    {
-        this.followup = followup;
-    }
-
-    private Boolean trackingReport;
-
-    public void setTrackingReport( Boolean trackingReport )
-    {
-        this.trackingReport = trackingReport;
-    }
-
-    // -------------------------------------------------------------------------
-    // Implementation Action
-    // -------------------------------------------------------------------------
-
-    public String execute()
-        throws Exception
-    {
-//        OrganisationUnit orgunit = selectionManager.getSelectedOrganisationUnit();
-//
-//        Collection<OrganisationUnit> orgunits = new HashSet<OrganisationUnit>();
-//        orgunits.add( orgunit );
-//
-//        if ( programId != null )
-//        {
-//            program = programService.getProgram( programId );
-//        }
-//
-//        if ( searchTexts.size() > 0 )
-//        {
-//            if ( type == null )
-//            {
-//                total = entityInstanceService.countSearchTrackedEntityInstances( searchTexts, orgunits, followup,
-//                    ProgramInstance.STATUS_ACTIVE );
-//                this.paging = createPaging( total );
-//
-//                List<Integer> stageInstanceIds = entityInstanceService.getProgramStageInstances( searchTexts, orgunits,
-//                    followup, ProgramInstance.STATUS_ACTIVE, paging.getStartPos(), paging.getPageSize() );
-//
-//                for ( Integer stageInstanceId : stageInstanceIds )
-//                {
-//                    ProgramStageInstance programStageInstance = programStageInstanceService
-//                        .getProgramStageInstance( stageInstanceId );
-//                    programStageInstances.add( programStageInstance );
-//                }
-//            }
-//            else if ( trackingReport != null && trackingReport )
-//            {
-//                grid = entityInstanceService.getTrackingEventsReport( program, searchTexts, orgunits, followup,
-//                    ProgramInstance.STATUS_ACTIVE, i18n );
-//            }
-//            else
-//            {
-//                grid = entityInstanceService.getScheduledEventsReport( searchTexts, orgunits, followup,
-//                    ProgramInstance.STATUS_ACTIVE, null, null, i18n );
-//            }
-//        }
-
-        return type == null ? SUCCESS : type;
-    }
-}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramStageInstanceByIdAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramStageInstanceByIdAction.java	2014-04-22 23:37:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramStageInstanceByIdAction.java	2014-04-23 23:45:11 +0000
@@ -56,9 +56,9 @@
     // Getter && Setter
     // -------------------------------------------------------------------------
 
-    private Integer programStageInstanceId;
+    private String programStageInstanceId;
 
-    public void setProgramStageInstanceId( Integer programStageInstanceId )
+    public void setProgramStageInstanceId( String programStageInstanceId )
     {
         this.programStageInstanceId = programStageInstanceId;
     }

=== removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SendSmsToListAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SendSmsToListAction.java	2014-04-22 23:37:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SendSmsToListAction.java	1970-01-01 00:00:00 +0000
@@ -1,204 +0,0 @@
-package org.hisp.dhis.caseentry.action.reminder;
-
-/*
- * Copyright (c) 2004-2014, 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.
- */
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.hisp.dhis.i18n.I18n;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
-import org.hisp.dhis.program.ProgramInstance;
-import org.hisp.dhis.program.ProgramStageInstanceService;
-import org.hisp.dhis.sms.SmsSender;
-import org.hisp.dhis.sms.SmsServiceException;
-import org.hisp.dhis.sms.outbound.OutboundSms;
-import org.hisp.dhis.trackedentity.TrackedEntityInstanceService;
-import org.hisp.dhis.user.CurrentUserService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Chau Thu Tran
- * 
- * @version SendSmsToListAction.java 13:29:34 AM Aug 16, 2012 $
- */
-public class SendSmsToListAction
-    implements Action
-{
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private OrganisationUnitSelectionManager selectionManager;
-
-    private TrackedEntityInstanceService entityInstanceService;
-
-    private SmsSender smsSender;
-
-    private ProgramStageInstanceService programStageInstanceService;
-
-    private CurrentUserService currentUserService;
-
-    private I18n i18n;
-
-    // -------------------------------------------------------------------------
-    // Input/output
-    // -------------------------------------------------------------------------
-
-    private List<String> searchTexts = new ArrayList<String>();
-
-    private Boolean searchBySelectedOrgunit;
-
-    private Boolean searchByUserOrgunits;
-
-    private Boolean followup;
-
-    // -------------------------------------------------------------------------
-    // Getters && Setters
-    // -------------------------------------------------------------------------
-
-    public void setCurrentUserService( CurrentUserService currentUserService )
-    {
-        this.currentUserService = currentUserService;
-    }
-
-    public void setSmsSender( SmsSender smsSender )
-    {
-        this.smsSender = smsSender;
-    }
-
-    public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
-    {
-        this.programStageInstanceService = programStageInstanceService;
-    }
-
-    public void setI18n( I18n i18n )
-    {
-        this.i18n = i18n;
-    }
-
-    public void setFollowup( Boolean followup )
-    {
-        this.followup = followup;
-    }
-
-    public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
-    {
-        this.selectionManager = selectionManager;
-    }
-
-    public void setSearchBySelectedOrgunit( Boolean searchBySelectedOrgunit )
-    {
-        this.searchBySelectedOrgunit = searchBySelectedOrgunit;
-    }
-
-    public void setSearchByUserOrgunits( Boolean searchByUserOrgunits )
-    {
-        this.searchByUserOrgunits = searchByUserOrgunits;
-    }
-
-    public void setEntityInstanceService( TrackedEntityInstanceService entityInstanceService )
-    {
-        this.entityInstanceService = entityInstanceService;
-    }
-
-    public void setSearchTexts( List<String> searchTexts )
-    {
-        this.searchTexts = searchTexts;
-    }
-
-    private String msg;
-
-    public void setMsg( String msg )
-    {
-        this.msg = msg;
-    }
-
-    private String message = "";
-
-    public String getMessage()
-    {
-        return message;
-    }
-
-    // -------------------------------------------------------------------------
-    // Action Implementation
-    // -------------------------------------------------------------------------
-
-    @Override
-    public String execute()
-        throws Exception
-    {
-        OrganisationUnit organisationUnit = selectionManager.getSelectedOrganisationUnit();
-        Collection<OrganisationUnit> orgunits = new HashSet<OrganisationUnit>();
-
-        if ( searchByUserOrgunits )
-        {
-            Collection<OrganisationUnit> userOrgunits = currentUserService.getCurrentUser().getOrganisationUnits();
-            orgunits.addAll( userOrgunits );
-        }
-        else if ( searchBySelectedOrgunit )
-        {
-            orgunits.add( organisationUnit );
-        }
-        else
-        {
-            organisationUnit = null;
-        }
-
-        Collection<Integer> programStageInstanceIds = entityInstanceService.getProgramStageInstances( searchTexts, orgunits,
-            followup, ProgramInstance.STATUS_ACTIVE, null, null );
-
-//        Set<String> phoneNumberList = new HashSet<String>( entityInstanceService.getTrackedEntityInstancePhoneNumbers( searchTexts,
-//            orgunits, followup, ProgramInstance.STATUS_ACTIVE, null, null ) );
-//        try
-//        {
-//            OutboundSms outboundSms = new OutboundSms();
-//            outboundSms.setMessage( msg );
-//            outboundSms.setRecipients( phoneNumberList );
-//            outboundSms.setSender( currentUserService.getCurrentUsername() );
-//
-//            smsSender.sendMessage( outboundSms, null );
-//
-//            programStageInstanceService.updateProgramStageInstances( programStageInstanceIds, outboundSms );
-//
-//            message = i18n.getString( "sent_message_success" );
-//        }
-//        catch ( SmsServiceException e )
-//        {
-//            message = e.getMessage();
-//        }
-
-        return SUCCESS;
-    }
-}

=== removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SearchTrackedEntityInstanceAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SearchTrackedEntityInstanceAction.java	2014-04-22 23:37:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SearchTrackedEntityInstanceAction.java	1970-01-01 00:00:00 +0000
@@ -1,320 +0,0 @@
-package org.hisp.dhis.caseentry.action.trackedentity;
-
-/*
- * Copyright (c) 2004-2014, 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.
- */
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
-import org.hisp.dhis.paging.ActionPagingSupport;
-import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramService;
-import org.hisp.dhis.trackedentity.TrackedEntityInstance;
-import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
-import org.hisp.dhis.trackedentity.TrackedEntityInstanceService;
-import org.hisp.dhis.trackedentity.comparator.TrackedEntityAttributeSortOrderInListNoProgramComparator;
-import org.hisp.dhis.user.CurrentUserService;
-import org.hisp.dhis.user.User;
-import org.hisp.dhis.user.UserService;
-import org.springframework.beans.factory.annotation.Autowired;
-
-/**
- * @author Abyot Asalefew Gizaw
- */
-public class SearchTrackedEntityInstanceAction
-    extends ActionPagingSupport<TrackedEntityInstance>
-{
-    private final String SEARCH_IN_ALL_ORGUNITS = "searchInAllOrgunits";
-
-    private final String SEARCH_IN_USER_ORGUNITS = "searchInUserOrgunits";
-
-    private final String SEARCH_IN_BELOW_SELECTED_ORGUNIT = "searchInBelowSelectedOrgunit";
-
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private OrganisationUnitSelectionManager selectionManager;
-
-    private TrackedEntityInstanceService entityInstanceService;
-
-    private ProgramService programService;
-
-    private CurrentUserService currentUserService;
-
-    private OrganisationUnitService organisationUnitService;
-
-    private UserService userService;
-
-    @Autowired
-    private TrackedEntityAttributeService attributeService;
-
-    // -------------------------------------------------------------------------
-    // Input/output
-    // -------------------------------------------------------------------------
-
-    private List<String> searchTexts = new ArrayList<String>();
-
-    private Integer statusEnrollment;
-
-    private String facilityLB;
-
-    private boolean listAll;
-
-    private Collection<TrackedEntityInstance> entityInstances = new ArrayList<TrackedEntityInstance>();
-
-    // -------------------------------------------------------------------------
-    // Getters && Setters
-    // -------------------------------------------------------------------------
-
-    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
-    {
-        this.organisationUnitService = organisationUnitService;
-    }
-
-    public void setUserService( UserService userService )
-    {
-        this.userService = userService;
-    }
-
-    public void setCurrentUserService( CurrentUserService currentUserService )
-    {
-        this.currentUserService = currentUserService;
-    }
-
-    public void setStatusEnrollment( Integer statusEnrollment )
-    {
-        this.statusEnrollment = statusEnrollment;
-    }
-
-    public void setFacilityLB( String facilityLB )
-    {
-        this.facilityLB = facilityLB;
-    }
-
-    public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
-    {
-        this.selectionManager = selectionManager;
-    }
-
-    public void setProgramService( ProgramService programService )
-    {
-        this.programService = programService;
-    }
-
-    public void setEntityInstanceService( TrackedEntityInstanceService entityInstanceService )
-    {
-        this.entityInstanceService = entityInstanceService;
-    }
-
-    public void setSearchTexts( List<String> searchTexts )
-    {
-        this.searchTexts = searchTexts;
-    }
-
-    public boolean isListAll()
-    {
-        return listAll;
-    }
-
-    public void setListAll( boolean listAll )
-    {
-        this.listAll = listAll;
-    }
-
-    public Collection<TrackedEntityInstance> getEntityInstances()
-    {
-        return entityInstances;
-    }
-
-    private Integer total;
-
-    public Integer getTotal()
-    {
-        return total;
-    }
-
-    private Map<Integer, String> mapEntityInstanceOrgunit = new HashMap<Integer, String>();
-
-    public Map<Integer, String> getMapEntityInstanceOrgunit()
-    {
-        return mapEntityInstanceOrgunit;
-    }
-
-    private Integer programId;
-
-    public void setProgramId( Integer programId )
-    {
-        this.programId = programId;
-    }
-
-    private OrganisationUnit organisationUnit;
-
-    public OrganisationUnit getOrganisationUnit()
-    {
-        return organisationUnit;
-    }
-
-    private Map<String, String> mapUsers = new HashMap<String, String>();
-
-    public Map<String, String> getMapUsers()
-    {
-        return mapUsers;
-    }
-
-    private Program program;
-
-    public Program getProgram()
-    {
-        return program;
-    }
-
-    private List<TrackedEntityAttribute> attributes;
-
-    public List<TrackedEntityAttribute> getAttributes()
-    {
-        return attributes;
-    }
-
-    // -------------------------------------------------------------------------
-    // Action implementation
-    // -------------------------------------------------------------------------
-
-    public String execute()
-        throws Exception
-    {
-//        organisationUnit = selectionManager.getSelectedOrganisationUnit();
-//
-//        Collection<OrganisationUnit> orgunits = new HashSet<OrganisationUnit>();
-//
-//        if ( programId != null )
-//        {
-//            program = programService.getProgram( programId );
-//        }
-//        else
-//        {
-//            attributes = new ArrayList<TrackedEntityAttribute>(
-//                attributeService.getTrackedEntityAttributesDisplayInList( true ) );
-//            Collections.sort( attributes, new TrackedEntityAttributeSortOrderInListNoProgramComparator() );
-//        }
-//
-//        // List all entityInstances
-//        if ( listAll )
-//        {
-//            total = entityInstanceService.countGetTrackedEntityInstancesByOrgUnit( organisationUnit );
-//            this.paging = createPaging( total );
-//
-//            entityInstances = new ArrayList<TrackedEntityInstance>( entityInstanceService.getTrackedEntityInstances(
-//                organisationUnit, paging.getStartPos(), paging.getPageSize() ) );
-//        }
-//        // search entityInstances
-//        else if ( searchTexts.size() > 0 )
-//        {
-//            // selected orgunit
-//            if ( facilityLB == null || facilityLB.isEmpty() )
-//            {
-//                orgunits.add( organisationUnit );
-//            }
-//            else if ( facilityLB.equals( SEARCH_IN_USER_ORGUNITS ) )
-//            {
-//                Collection<OrganisationUnit> userOrgunits = currentUserService.getCurrentUser().getOrganisationUnits();
-//                orgunits.addAll( userOrgunits );
-//            }
-//            else if ( facilityLB.equals( SEARCH_IN_BELOW_SELECTED_ORGUNIT ) )
-//            {
-//                Collection<Integer> orgunitIds = organisationUnitService.getOrganisationUnitHierarchy().getChildren(
-//                    organisationUnit.getId() );
-//                orgunits.add( organisationUnit );
-//                orgunits.addAll( organisationUnitService.getOrganisationUnits( orgunitIds ) );
-//            }
-//            else if ( facilityLB.equals( SEARCH_IN_ALL_ORGUNITS ) )
-//            {
-//                orgunits = null;
-//            }
-//
-//            // -----------------------------------------------------------------
-//            // Users by orgunits for searching
-//            // -----------------------------------------------------------------
-//
-//            Collection<User> users = userService.getAllUsers();
-//            for ( User user : users )
-//            {
-//                mapUsers.put( user.getId() + "", user.getName() );
-//            }
-//
-//            // -----------------------------------------------------------------
-//            // Searching
-//            // -----------------------------------------------------------------
-//
-//            total = entityInstanceService.countSearchTrackedEntityInstances( searchTexts, orgunits, null,
-//                statusEnrollment );
-//            this.paging = createPaging( total );
-//            entityInstances = entityInstanceService.searchTrackedEntityInstances( searchTexts, orgunits, null, null,
-//                statusEnrollment, paging.getStartPos(), paging.getPageSize() );
-//
-//            if ( facilityLB != null && !facilityLB.isEmpty() )
-//            {
-//                for ( TrackedEntityInstance entityInstance : entityInstances )
-//                {
-//                    mapEntityInstanceOrgunit.put( entityInstance.getId(),
-//                        getHierarchyOrgunit( entityInstance.getOrganisationUnit() ) );
-//                }
-//            }
-//
-//        }
-
-        return SUCCESS;
-    }
-
-    // -------------------------------------------------------------------------
-    // Supportive method
-    // -------------------------------------------------------------------------
-
-    private String getHierarchyOrgunit( OrganisationUnit orgunit )
-    {
-        String hierarchyOrgunit = orgunit.getName();
-
-        while ( orgunit.getParent() != null )
-        {
-            hierarchyOrgunit = orgunit.getParent().getName() + " / " + hierarchyOrgunit;
-
-            orgunit = orgunit.getParent();
-        }
-
-        return hierarchyOrgunit;
-    }
-}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2014-04-22 23:37:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2014-04-23 23:45:11 +0000
@@ -12,19 +12,6 @@
 			ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
 	</bean>
 
-	<bean id="org.hisp.dhis.caseentry.action.trackedentity.SearchTrackedEntityInstanceAction"
-		class="org.hisp.dhis.caseentry.action.trackedentity.SearchTrackedEntityInstanceAction"
-		scope="prototype">
-		<property name="selectionManager"
-			ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
-		<property name="entityInstanceService" ref="org.hisp.dhis.trackedentity.TrackedEntityInstanceService" />
-		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
-		<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
-		<property name="organisationUnitService"
-			ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
-		<property name="userService" ref="org.hisp.dhis.user.UserService" />
-	</bean>
-
 	<bean
 		id="org.hisp.dhis.caseentry.action.caseentry.SaveExecutionDateAction"
 		class="org.hisp.dhis.caseentry.action.caseentry.SaveExecutionDateAction"
@@ -182,17 +169,6 @@
 			ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
 	</bean>
 
-	<bean id="org.hisp.dhis.caseentry.action.caseentry.GetDataRecordsAction"
-		class="org.hisp.dhis.caseentry.action.caseentry.GetDataRecordsAction"
-		scope="prototype">
-		<property name="selectionManager"
-			ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
-		<property name="entityInstanceService" ref="org.hisp.dhis.trackedentity.TrackedEntityInstanceService" />
-		<property name="programStageInstanceService"
-			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
-		<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
-	</bean>
-
 	<!-- Single-event DataEntry -->
 
 	<bean
@@ -742,18 +718,6 @@
 		<property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
 	</bean>
 
-	<bean id="org.hisp.dhis.caseentry.action.reminder.SendSmsToListAction"
-		class="org.hisp.dhis.caseentry.action.reminder.SendSmsToListAction"
-		scope="prototype">
-		<property name="selectionManager"
-			ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
-		<property name="entityInstanceService" ref="org.hisp.dhis.trackedentity.TrackedEntityInstanceService" />
-		<property name="smsSender" ref="org.hisp.dhis.sms.SmsSender" />
-		<property name="programStageInstanceService"
-			ref="org.hisp.dhis.program.ProgramStageInstanceService" />
-		<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
-	</bean>
-
 	<bean id="org.hisp.dhis.caseentry.action.reminder.SetEventStatusAction"
 		class="org.hisp.dhis.caseentry.action.reminder.SetEventStatusAction"
 		scope="prototype">

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2014-04-22 23:37:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2014-04-23 23:45:11 +0000
@@ -43,21 +43,6 @@
 			<param name="requiredAuthorities">F_TRACKED_ENTITY_INSTANCE_SEARCH</param>
 		</action>
 
-		<action name="searchTrackedEntityInstance"
-			class="org.hisp.dhis.caseentry.action.trackedentity.SearchTrackedEntityInstanceAction">
-			<result name="success" type="velocity">/content.vm</result>
-			<param name="page">/dhis-web-caseentry/listTrackedEntityInstance.vm</param>
-			<param name="requiredAuthorities">F_TRACKED_ENTITY_INSTANCE_SEARCH</param>
-		</action>
-
-		<action name="listAllTrackedEntityInstances"
-			class="org.hisp.dhis.caseentry.action.trackedentity.SearchTrackedEntityInstanceAction">
-			<result name="success" type="velocity">/content.vm</result>
-			<param name="listAll">true</param>
-			<param name="page">/dhis-web-caseentry/listTrackedEntityInstance.vm</param>
-			<param name="requiredAuthorities">F_TRACKED_ENTITY_INSTANCE_SEARCH</param>
-		</action>
-
 		<action name="loadProgramStageInstances"
 			class="org.hisp.dhis.caseentry.action.caseentry.LoadProgramStageInstancesAction">
 			<result name="success" type="velocity-json">
@@ -464,13 +449,6 @@
 			<param name="requiredAuthorities">F_TRACKED_ENTITY_INSTANCE_MANAGEMENT</param>
 		</action>
 
-		<action name="searchRegistrationTrackedEntityInstance"
-			class="org.hisp.dhis.caseentry.action.trackedentity.SearchTrackedEntityInstanceAction">
-			<result name="success" type="velocity">/content.vm</result>
-			<param name="page">/dhis-web-caseentry/trackedEntityInstanceRegistrationList.vm</param>
-			<param name="requiredAuthorities">F_TRACKED_ENTITY_INSTANCE_SEARCH</param>
-		</action>
-
 		<action name="removeTrackedEntityInstance"
 			class="org.hisp.dhis.caseentry.action.trackedentity.RemoveTrackedEntityInstanceAction">
 			<result name="success" type="velocity-json">
@@ -806,14 +784,6 @@
 			<param name="requiredAuthorities">F_PROGRAM_TRACKING_MANAGEMENT</param>
 		</action>
 
-		<action name="getSMSTrackedEntityInstanceRecords"
-			class="org.hisp.dhis.caseentry.action.caseentry.GetDataRecordsAction">
-			<result name="success" type="velocity">/content.vm</result>
-			<param name="page">/dhis-web-caseentry/programTrackingRecords.vm</param>
-			<param name="stylesheets">style/style.css</param>
-			<param name="requiredAuthorities">F_PROGRAM_TRACKING_SEARCH</param>
-		</action>
-
 		<action name="programTrackingList"
 			class="org.hisp.dhis.caseentry.action.reminder.GetProgramTrackingListAction">
 			<result name="success" type="velocity">/content.vm</result>
@@ -834,16 +804,6 @@
 			<param name="requiredAuthorities">F_MOBILE_SENDSMS</param>
 		</action>
 
-		<action name="sendSMSTotList"
-			class="org.hisp.dhis.caseentry.action.reminder.SendSmsToListAction">
-			<result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm
-			</result>
-			<result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm
-			</result>
-			<param name="onExceptionReturn">plainTextError</param>
-			<param name="requiredAuthorities">F_MOBILE_SENDSMS</param>
-		</action>
-
 		<action name="setEventStatus"
 			class="org.hisp.dhis.caseentry.action.reminder.SetEventStatusAction">
 			<result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm
@@ -859,6 +819,12 @@
 			<param name="page">/dhis-web-caseentry/trackingEventMessage.vm</param>
 			<param name="stylesheets">style/style.css</param>
 		</action>
+		
+		<action name="getProgramStageInstanceByUid"
+			class="org.hisp.dhis.caseentry.action.reminder.GetProgramStageInstanceByIdAction">
+			<result name="success" type="velocity-json">/dhis-web-caseentry/jsonProgramStageInstance.vm
+			</result>
+		</action>
 
 		<!-- Dashboard -->
 
@@ -923,15 +889,6 @@
 			<param name="requiredAuthorities">F_ACTIVITY_PLAN</param>
 		</action>
 
-		<action name="getActivityPlanRecords"
-			class="org.hisp.dhis.caseentry.action.caseentry.GetDataRecordsAction">
-			<result name="success" type="velocity">/content.vm</result>
-			<param name="page">/dhis-web-caseentry/activityPlanRecords.vm</param>
-			<param name="stylesheets">style/style.css</param>
-			<result name="xls" type="gridXlsResult" />
-			<result name="pdf" type="gridPdfResult" />
-		</action>
-
 		<action name="accessAttributes" class="org.hisp.dhis.caseentry.action.NoAction">
 			<result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm
 			</result>

=== removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm	2014-04-22 23:37:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm	1970-01-01 00:00:00 +0000
@@ -1,94 +0,0 @@
-<script src="javascript/tooltip.js" type="text/javascript"></script>
-<table>
-	<tr>
-		<td class='text-column'>$i18n.getString( "total_result" ):</td>
-		<td>&nbsp;</td>
-		<td>&nbsp;</td>
-		<td>$!total</td>
-	</tr>
-</table>
-
-#if( $programStageInstances && $programStageInstances.size()>0 )
-
-<table class='listTable gridTable'>
-	<thead>
-		<tr>
-			<th>#</th>
-			<th>$i18n.getString('date_scheduled')</th>
-			<th>$i18n.getString('orgunit')</th>
-			
-			#if( $auth.hasAccess( "dhis-web-caseentry", "accessAttributes" ) )
-				#foreach( $programAttribute in $program.programAttributes )
-					#if($programAttribute.displayInList=='true')
-						<th id="attributeName">$encoder.htmlEncode($programAttribute.attribute.displayName)</th>
-					#end
-				#end
-			#end
-			
-			<th>$i18n.getString('events')</th>
-			<th>$i18n.getString('operations')</th>
-		</tr>
-	</thead>
-	<tbody id="list">
-	#set( $mark = false ) 
-	#foreach( $programStageInstance in $programStageInstances )
-		#set($entityInstance = $programStageInstance.programInstance.entityInstance)
-		<tr id='tr$programStageInstance.id'>
-			<td>
-				#set( $nr = ( ( $paging.getCurrentPage() - 1  ) * $paging.pageSize ) + $velocityCount )
-				$nr
-			</td>
-			
-			<td>
-				#if($!programStageInstance.executionDate)
-					$format.formatDate($!programStageInstance.executionDate)
-				#else
-					$format.formatDate($!programStageInstance.dueDate)
-				#end
-			</td>
-			
-			<td>
-				#if($!programStageInstance.executionDate)
-					$!programStageInstance.organisationUnit.name
-				#else
-					$entityInstance.organisationUnit.name
-				#end
-			</td>
-			
-			#if( $auth.hasAccess( "dhis-web-caseentry", "accessAttributes" ) )
-				#foreach( $programAttribute in $program.programAttributes )
-					#if($programAttribute.displayInList=='true')
-						<td style="cursor:pointer;" onclick="javascript:isDashboard=true;showTrackedEntityInstanceDashboardForm( '$entityInstance.uid' )">
-							#foreach( $attributeValue in $entityInstance.attributeValues)
-								#if($!attributeValue.attribute.id==$programAttribute.attribute.id)
-									#set($value=$attributeValue.value)
-									#if( $programAttribute.attribute.valueType == 'bool')
-										#set($value=$i18n.getString($attributeValue.value))
-									#end
-								#end
-							#end  
-							<a>$encoder.htmlEncode($value)</a>
-						</td>
-					#end
-				#end
-			#end
-			
-			<td><a href="javascript:loadDataEntryDialog( $programStageInstance.id, '$programStageInstance.programStage.uid' );">$programStageInstance.programStage.displayName</a></td>
-			
-			<td>
-				<a href="javascript:isDashboard=false;showTrackedEntityInstanceDashboardForm( '$entityInstance.uid' )" title="$i18n.getString( 'dashboard' )"><img src="../images/enroll.png" alt='$i18n.getString( "dashboard" )'></a>
-				<a href="javascript:loadDataEntryDialog( $programStageInstance.id, '$programStageInstance.programStage.uid' );" title="$i18n.getString( 'data_entry' )"><img src="images/data_entry.png" alt="$i18n.getString( 'data_entry' )"></a>   
-				<a href="javascript:showTrackedEntityInstanceHistory('$entityInstance.uid')" title='$i18n.getString( "tracked_entity_instance_details_and_history" )'><img src="../images/information.png" alt='$i18n.getString( "tracked_entity_instance_details_and_history" )'></a>
-			</td>
-			
-		</tr>
-	#end
-	</tbody>
-</table>
-<div class="paging-container">
-	#parse( "/dhis-web-commons/paging/paging.vm" )
-</div>
-
-<div id="detailsInfo"></div>
-
-#end

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js	2014-04-22 23:37:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js	2014-04-23 23:45:11 +0000
@@ -64,6 +64,7 @@
 		success : function(json) {
 			setInnerHTML('listEntityInstanceDiv', displayevents(json, page));
 			showById('listEntityInstanceDiv');
+			setTableStyles();
 			jQuery('#loaderDiv').hide();
 			hideLoader();
 		}
@@ -133,12 +134,6 @@
 				+ "'><img src='../images/enroll.png' alt='"
 				+ i18n_dashboard
 				+ "'></a>";
-		table += "<a href=\"javascript:loadDataEntryDialog( '" + uid + "' ) \" "
-				+ " title='"
-				+ i18n_edit
-				+ "'><img src= '../images/edit.png' alt='"
-				+ i18n_edit
-				+ "'></a>";
 		table += "<a href=\"javascript:showTrackedEntityInstanceHistory( '" + uid + "' ) \" "
 				+ " title='"
 				+ i18n_tracked_entity_instance_details_and_history
@@ -236,10 +231,10 @@
 	params += "&programStatus=ACTIVE";
 	params += "&trackedEntityInstance=" + teiUid;
 	if(getFieldValue('status')!=''){
-		params += '&eventStatus=' + getFieldValue('status');
+		params += '&status=' + getFieldValue('status');
 	}
-	params += "&eventStartDate=" + getFieldValue('startDueDate');
-	params += "&eventEndDate=" + getFieldValue('endDueDate');
+	params += "&startDate=" + getFieldValue('startDueDate');
+	params += "&endDate=" + getFieldValue('endDueDate');
 	
 	$.ajax({
 		type : "GET",
@@ -252,7 +247,7 @@
 				var row = json.events[i];
 				var uid = row.event;
 				var eventDate = row.eventDate;
-				table += "<tr><td><a href='javascript:programTrackingList( \"" + uid + "\") ' >" + eventDate + "</a></td></tr>";
+				table += "<tr><td><a href='javascript:loadDataEntryDialog( \"" + uid + "\") ' >" + eventDate + "</a></td></tr>";
 			}
 			table += "</table>";
 			$('#eventList').html(table);
@@ -260,7 +255,7 @@
 				title : i18n_events,
 				maximize : true,
 				closable : true,
-				modal : false,
+				modal : true,
 				width : 380,
 				height : 290
 			}).show('fast');
@@ -296,28 +291,40 @@
 // EntityInstance program tracking
 // --------------------------------------------------------------------
 
-function loadDataEntryDialog( programStageInstanceId, programStageUid )
+function loadDataEntryDialog( programStageInstanceId )
 {
-    jQuery('[id=programStageInstanceId]').val(programStageInstanceId);
-    jQuery('.stage-object-selected').attr('psuid', programStageUid);
-
-    $('#contentDataRecord' ).load("viewProgramStageRecords.action", {
-        programStageInstanceId: programStageInstanceId
-    }, function() {
-        jQuery('#programStageUid').val(programStageUid);
-        showById('reportDateDiv');
-        showById('entityInstanceInforTB');
-        showById('entryForm');
-        showById('inputCriteriaDiv');
-    }).dialog({
-        title:i18n_program_stage,
-        maximize:true,
-        closable:true,
-        modal:false,
-        overlay:{background:'#000000', opacity:0.1},
-        width:850,
-        height:500
-    });
+	$.ajax({
+		type : "GET",
+		url : "getProgramStageInstanceByUid.action?programStageInstanceId=" + programStageInstanceId,
+		dataType : "json",
+		success : function(json) {
+			var psiid = json.id;
+			jQuery('.stage-object-selected').attr('psuid', json.programStage.uid);
+			jQuery('[id=programStageInstanceId]').val(psiid);
+			jQuery('#programStageUid').val(json.programStage.uid);
+					
+			$('#contentDataRecord' ).load("viewProgramStageRecords.action", {
+					programStageInstanceId: psiid
+				}, function( html ) {
+					setInnerHTML('contentDataRecord',html);
+					showById('reportDateDiv');
+					showById('entityInstanceInforTB');
+					showById('entryForm');
+					showById('inputCriteriaDiv');
+					entryFormContainerOnReady();
+				}).dialog({
+					title:i18n_program_stage,
+					maximize:true,
+					closable:true,
+					modal:false,
+					overlay:{background:'#000000', opacity:0.1},
+					width:850,
+					height:500
+			});
+		}
+	});
+	
+	
 }
 
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2014-04-22 23:37:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js	2014-04-23 23:45:11 +0000
@@ -847,7 +847,7 @@
         type: 'GET',
         dataType: 'json'
     } ).done(function(data) {
-		if( data.response=='undefined'){
+		if( data.response==undefined){
 			$( "#programStageInstanceId" ).val( data.id );
 			$( "#entryFormContainer input[id='programStageInstanceId']" ).val( data.id );
 			$( "#entryFormContainer input[id='incidentDate']" ).val( data.programInstance.dateOfIncident );

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js	2014-04-22 23:37:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js	2014-04-23 23:45:11 +0000
@@ -272,15 +272,15 @@
 	var params = "orgUnit=" + getFieldValue("orgunitId");
 	params += "&program=" + getFieldValue('program');
 	params += "&trackedEntityInstance=" + teiUid;
-	params += '&eventStatus=' + getFieldValue('status');
+	params += '&status=' + getFieldValue('status');
 	if( isAdvancedSearch ){ // advanced-search
-		params += "&eventStartDate=" + getFieldValue('startDate');
-		params += "&eventEndDate=" + getFieldValue('endDate');
+		params += "&startDate=" + getFieldValue('startDate');
+		params += "&endDate=" + getFieldValue('endDate');
 	}
 	else // list
 	{
-		params += "&eventStartDate=1900-01-01";
-		params += "&eventEndDate=3000-01-01";
+		params += "&startDate=1900-01-01";
+		params += "&endDate=3000-01-01";
 	}
 	
 	$.ajax({
@@ -369,49 +369,6 @@
 }
 
 // --------------------------------------------------------------------
-// Send SMS 
-// --------------------------------------------------------------------
-
-function showSendSmsForm()
-{
-	jQuery('#sendSmsToListForm').dialog({
-			title: i18n_send_message,
-			maximize: true, 
-			closable: true,
-			modal:true,
-			overlay:{background:'#000000', opacity:0.1},
-			width: 420,
-			height: 200
-		});
-}
-
-function sendSmsToList()
-{
-	params = getSearchParams();
-	params += "&msg=" + getFieldValue( 'smsMessage' );
-	params += "&programStageInstanceId=" + getFieldValue('programStageInstanceId');
-	$.ajax({
-		url: 'sendSMSTotList.action',
-		type:"POST",
-		data: params,
-		success: function( json ){
-			if ( json.response == "success" ) {
-				var programStageName = getFieldValue('programStageName');
-				var currentTime = date.getHours() + ":" + date.getMinutes();
-				jQuery('#commentTB').prepend("<tr><td>" + getFieldValue("currentDate") + " " + currentTime + "</td>"
-						+ "<td>" + programStageName + "</td>"
-						+ "<td>" + getFieldValue( 'smsMessage' ) + "</td></tr>");
-				showSuccessMessage( json.message );
-			}
-			else {
-				showErrorMessage( json.message );
-			}
-			jQuery('#sendSmsFormDiv').dialog('close')
-		}
-	});
-}
-
-// --------------------------------------------------------------------
 // Post Comments/Send Message
 // --------------------------------------------------------------------
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTrackedEntityInstanceCriteria.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTrackedEntityInstanceCriteria.vm	2014-04-22 23:37:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTrackedEntityInstanceCriteria.vm	2014-04-23 23:45:11 +0000
@@ -142,7 +142,6 @@
 	<div style="padding: 10px 0 15px 3px">
 		<input type="button" class='large-button' value='$i18n.getString( "add_filter" )' onclick='addAttributeOption();'>
         <input type="button" class='large-button' value='$i18n.getString( "search" )' onclick='isAdvancedSearch=true;validateAdvancedSearch(1);' id='searchEntityInstanceBtn'>
-        <input type="button" class='large-button hidden' id='sendSmsToListBtn' value="$i18n.getString('sms')" onclick="setFieldValue('sendToList', true);showSendSmsForm();">
     </div>
 </div>
 

=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java'
--- dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java	2014-04-22 23:37:46 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/java/org/hisp/dhis/sms/outcoming/SearchPatientAction.java	2014-04-23 23:45:11 +0000
@@ -139,18 +139,18 @@
                 orgunits.add( organisationUnit );
             }
 
-//            total = patientService.countSearchTrackedEntityInstances( searchTexts, orgunits, null, ProgramInstance.STATUS_ACTIVE );
-//            this.paging = createPaging( total );
-//            patients = patientService.searchTrackedEntityInstances( searchTexts, orgunits, null, null, ProgramInstance.STATUS_ACTIVE,
-//                paging.getStartPos(), paging.getPageSize() );
-//
-//            if ( !searchBySelectedOrgunit )
-//            {
-//                for ( TrackedEntityInstance patient : patients )
-//                {
-//                    mapPatientOrgunit.put( patient.getId(), getHierarchyOrgunit( patient.getOrganisationUnit() ) );
-//                }
-//            }
+            total = patientService.countSearchTrackedEntityInstances( searchTexts, orgunits, null, ProgramInstance.STATUS_ACTIVE );
+            this.paging = createPaging( total );
+            patients = patientService.searchTrackedEntityInstances( searchTexts, orgunits, null, null, ProgramInstance.STATUS_ACTIVE,
+                paging.getStartPos(), paging.getPageSize() );
+
+            if ( !searchBySelectedOrgunit )
+            {
+                for ( TrackedEntityInstance patient : patients )
+                {
+                    mapPatientOrgunit.put( patient.getId(), getHierarchyOrgunit( patient.getOrganisationUnit() ) );
+                }
+            }
         }
 
         return SUCCESS;