← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14935: Fixed bug - build fail

 

------------------------------------------------------------
revno: 14935
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-04-22 08:17:55 +0800
message:
  Fixed bug - build fail
modified:
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceServiceTest.java
  dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStoreTest.java
  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/javascript/smsReminder.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.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-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceServiceTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceServiceTest.java	2014-03-26 14:01:14 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceServiceTest.java	2014-04-22 00:17:55 +0000
@@ -47,7 +47,6 @@
 import org.hisp.dhis.program.ProgramInstanceService;
 import org.hisp.dhis.program.ProgramService;
 import org.hisp.dhis.program.ProgramStage;
-import org.hisp.dhis.program.ProgramStageInstance;
 import org.hisp.dhis.relationship.RelationshipType;
 import org.hisp.dhis.relationship.RelationshipTypeService;
 import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue;
@@ -398,112 +397,6 @@
     }
 
     @Test
-    public void testSearchTrackedEntityInstances()
-    {
-        int idA = programService.addProgram( programA );
-        programService.addProgram( programB );
-
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA1 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA2 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA3 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceB1 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceB2 );
-
-        TrackedEntityAttributeValue attributeValue = createTrackedEntityAttributeValue( 'A', entityInstanceA3,
-            entityInstanceAttribute );
-        attributeValueService.addTrackedEntityAttributeValue( attributeValue );
-        entityInstanceA3.getAttributeValues().add( attributeValue );
-
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA3, programA, date, date, organisationUnit );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB1, programA, date, date, organisationUnit );
-
-        List<String> searchKeys = new ArrayList<String>();
-        searchKeys.add( TrackedEntityInstance.PREFIX_TRACKED_ENTITY_ATTRIBUTE + TrackedEntityInstance.SEARCH_SAPERATE
-            + attributeId + TrackedEntityInstance.SEARCH_SAPERATE + "a" );
-        searchKeys.add( TrackedEntityInstance.PREFIX_PROGRAM + TrackedEntityInstance.SEARCH_SAPERATE + idA );
-
-        Collection<OrganisationUnit> orgunits = new HashSet<OrganisationUnit>();
-        orgunits.add( organisationUnit );
-
-        Collection<TrackedEntityInstance> entityInstances = entityInstanceService.searchTrackedEntityInstances( searchKeys, orgunits, null,
-            null, ProgramStageInstance.ACTIVE_STATUS, null, null );
-
-        assertEquals( 1, entityInstances.size() );
-        assertTrue( entityInstances.contains( entityInstanceA3 ) );
-    }
-
-    @Test
-    public void testCountSearchEntityInstances()
-    {
-        int idA = programService.addProgram( programA );
-        programService.addProgram( programB );
-
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA1 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA2 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA3 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceB1 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceB2 );
-
-        TrackedEntityAttributeValue attributeValue = createTrackedEntityAttributeValue( 'A', entityInstanceA3,
-            entityInstanceAttribute );
-        attributeValueService.addTrackedEntityAttributeValue( attributeValue );
-
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA3, programA, date, date, organisationUnit );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB1, programA, date, date, organisationUnit );
-
-        List<String> searchKeys = new ArrayList<String>();
-        searchKeys.add( TrackedEntityInstance.PREFIX_TRACKED_ENTITY_ATTRIBUTE + TrackedEntityInstance.SEARCH_SAPERATE
-            + attributeId + TrackedEntityInstance.SEARCH_SAPERATE + "a" );
-        searchKeys.add( TrackedEntityInstance.PREFIX_PROGRAM + TrackedEntityInstance.SEARCH_SAPERATE + idA );
-
-        Collection<OrganisationUnit> orgunits = new HashSet<OrganisationUnit>();
-        orgunits.add( organisationUnit );
-
-        assertEquals( 1,
-            entityInstanceService.countSearchTrackedEntityInstances( searchKeys, orgunits, null, ProgramStageInstance.ACTIVE_STATUS ) );
-    }
-
-    @Test
-    public void testGetTrackedEntityInstancePhoneNumbers()
-    {
-        int idA = programService.addProgram( programA );
-        programService.addProgram( programB );
-
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA1 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA2 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceA3 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceB1 );
-        entityInstanceService.addTrackedEntityInstance( entityInstanceB2 );
-
-        TrackedEntityAttribute phoneAttribute = createTrackedEntityAttribute( 'B' );
-        phoneAttribute.setValueType( TrackedEntityAttribute.TYPE_PHONE_NUMBER );
-        attributeService.addTrackedEntityAttribute( phoneAttribute );
-
-        Set<TrackedEntityAttributeValue> attributeValues = new HashSet<TrackedEntityAttributeValue>();
-        TrackedEntityAttributeValue attributeValue = createTrackedEntityAttributeValue( 'A', entityInstanceA3, phoneAttribute );
-        attributeValue.setValue( "123456789" );
-        attributeValueService.addTrackedEntityAttributeValue( attributeValue );
-
-        attributeValues.add( attributeValue );
-        entityInstanceA3.addAttributeValue( attributeValue );
-        entityInstanceService.updateTrackedEntityInstance( entityInstanceA3 );
-
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA3, programA, date, date, organisationUnit );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB1, programA, date, date, organisationUnit );
-
-        List<String> searchKeys = new ArrayList<String>();
-        searchKeys.add( TrackedEntityInstance.PREFIX_PROGRAM + TrackedEntityInstance.SEARCH_SAPERATE + idA );
-
-        Collection<OrganisationUnit> orgunits = new HashSet<OrganisationUnit>();
-        orgunits.add( organisationUnit );
-
-        Collection<String> phoneNumbers = entityInstanceService.getTrackedEntityInstancePhoneNumbers( searchKeys, orgunits, null,
-            ProgramStageInstance.ACTIVE_STATUS, null, null );
-
-        assertEquals( 1, phoneNumbers.size() );
-    }
-
-    @Test
     public void testGetTrackedEntityInstancesByPhone()
     {
         entityInstanceService.addTrackedEntityInstance( entityInstanceA1 );

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStoreTest.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStoreTest.java	2014-03-26 14:01:14 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/test/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStoreTest.java	2014-04-22 00:17:55 +0000
@@ -33,11 +33,9 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.HashSet;
-import java.util.List;
 
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -46,7 +44,6 @@
 import org.hisp.dhis.program.ProgramInstanceService;
 import org.hisp.dhis.program.ProgramService;
 import org.hisp.dhis.program.ProgramStage;
-import org.hisp.dhis.program.ProgramStageInstance;
 import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue;
 import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValueService;
 import org.hisp.dhis.validation.ValidationCriteriaService;
@@ -84,16 +81,10 @@
 
     private TrackedEntityInstance entityInstanceA2;
 
-    private TrackedEntityInstance entityInstanceA3;
-
     private TrackedEntityInstance entityInstanceB1;
 
     private TrackedEntityInstance entityInstanceB2;
 
-    private TrackedEntityAttribute entityInstanceAttribute;
-
-    private int attributeId;
-
     private Program programA;
 
     private Program programB;
@@ -114,13 +105,9 @@
         TrackedEntityAttribute entityInstanceAttributeB = createTrackedEntityAttribute( 'B' );
         entityInstanceAttributeB.setUnique( true );
         attributeService.addTrackedEntityAttribute( entityInstanceAttributeB );
-
-        entityInstanceAttribute = createTrackedEntityAttribute( 'A' );
-        attributeId = attributeService.addTrackedEntityAttribute( entityInstanceAttribute );
-
+      
         entityInstanceA1 = createTrackedEntityInstance( 'A', organisationUnit );
         entityInstanceA2 = createTrackedEntityInstance( 'A', organisationUnitB );
-        entityInstanceA3 = createTrackedEntityInstance( 'A', organisationUnit, entityInstanceAttributeB );
         entityInstanceB1 = createTrackedEntityInstance( 'B', organisationUnit );
         entityInstanceB2 = createTrackedEntityInstance( 'B', organisationUnit );
 
@@ -276,38 +263,4 @@
         assertEquals( 2, entityInstanceStore.getByPhoneNumber( "123456789", null, null ).size() );
     }
 
-    @Test
-    public void testSearch()
-    {
-        int idA = programService.addProgram( programA );
-        programService.addProgram( programB );
-
-        entityInstanceStore.save( entityInstanceA1 );
-        entityInstanceStore.save( entityInstanceA2 );
-        entityInstanceStore.save( entityInstanceA3 );
-        entityInstanceStore.save( entityInstanceB1 );
-        entityInstanceStore.save( entityInstanceB2 );
-
-        TrackedEntityAttributeValue attributeValue = createTrackedEntityAttributeValue( 'A', entityInstanceA3,
-            entityInstanceAttribute );
-        attributeValueService.addTrackedEntityAttributeValue( attributeValue );
-
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceA3, programA, date, date, organisationUnit );
-        programInstanceService.enrollTrackedEntityInstance( entityInstanceB1, programA, date, date, organisationUnit );
-
-        List<String> searchKeys = new ArrayList<String>();
-        searchKeys.add( TrackedEntityInstance.PREFIX_TRACKED_ENTITY_ATTRIBUTE + TrackedEntityInstance.SEARCH_SAPERATE
-            + attributeId + TrackedEntityInstance.SEARCH_SAPERATE + "a" + TrackedEntityInstance.SEARCH_SAPERATE
-            + organisationUnit.getId() );
-        searchKeys.add( TrackedEntityInstance.PREFIX_PROGRAM + TrackedEntityInstance.SEARCH_SAPERATE + idA );
-
-        Collection<OrganisationUnit> orgunits = new HashSet<OrganisationUnit>();
-        orgunits.add( organisationUnit );
-
-        Collection<TrackedEntityInstance> entityInstances = entityInstanceStore.search( searchKeys, orgunits, null, null,
-            ProgramStageInstance.ACTIVE_STATUS, null, null );
-
-        assertEquals( 1, entityInstances.size() );
-        assertTrue( entityInstances.contains( entityInstanceA3 ) );
-    }
 }

=== modified 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-06 15:48:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetDataRecordsAction.java	2014-04-22 00:17:55 +0000
@@ -186,45 +186,45 @@
     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 );
-            }
-        }
+//        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/SendSmsToListAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SendSmsToListAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SendSmsToListAction.java	2014-04-22 00:17:55 +0000
@@ -179,25 +179,25 @@
         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();
-        }
+//        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;
     }

=== modified 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-03-20 15:05:57 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SearchTrackedEntityInstanceAction.java	2014-04-22 00:17:55 +0000
@@ -217,85 +217,85 @@
     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() ) );
-                }
-            }
-
-        }
+//        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;
     }

=== 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-21 23:47:56 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js	2014-04-22 00:17:55 +0000
@@ -172,6 +172,12 @@
 				+ "'><img src= '../images/edit.png' alt='"
 				+ i18n_edit
 				+ "'></a>";
+		table += "<a href=\"javascript:showTrackedEntityInstanceHistory( '" + uid + "' ) \" "
+				+ " title='"
+				+ i18n_tracked_entity_instance_details_and_history
+				+ "'><img src= '../images/information.png' alt='"
+				+ i18n_tracked_entity_instance_details_and_history
+				+ "'></a>";
 		table += "</td>";
 		table += "</tr>";
 	}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm	2014-04-21 23:47:56 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm	2014-04-22 00:17:55 +0000
@@ -58,6 +58,7 @@
 <div id='addRelationshipDiv'></div> <!-- Add relationship -->
 <div id='migrationEntityInstanceDiv'></div> <!-- Migration TrackedEntityInstance -->
 <div id='programTrackingReportDiv'></div>
+<div id='detailsInfo'></div>
 
 #parse( "dhis-web-commons/loader/loader.vm" )