← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15626: Add a field which supports search TEI by attribute quickly on the Find/Add Instance form.

 

------------------------------------------------------------
revno: 15626
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-06-11 21:14:42 +0800
message:
  Add a field which supports search TEI by attribute quickly on the Find/Add Instance form.
added:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SearchTrackedEntityInstanceAction.java
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java
  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/hibernate/HibernateTrackedEntityInstanceStore.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/trackedEntityInstance.js
  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/trackedEntityInstanceRegistrationList.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/GetProgramListAction.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-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java	2014-05-21 08:00:16 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceService.java	2014-06-11 13:14:42 +0000
@@ -38,6 +38,7 @@
 import org.hisp.dhis.common.OrganisationUnitSelectionMode;
 import org.hisp.dhis.event.EventStatus;
 import org.hisp.dhis.i18n.I18nFormat;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramStatus;
 import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue;
@@ -235,14 +236,40 @@
     String validateTrackedEntityInstance( TrackedEntityInstance entityInstance, Program program, I18nFormat format );
 
     /**
-     * Validate patient enrollment
+     * Validate tracked entity instance enrollment
      * 
      * @param entityInstance TrackedEntityInstance object
      * @param program Program which person needs to enroll. If this parameter is
-     *        null, the system check identifiers of the patient
+     *        null, the system check identifiers of the tracked entity instance
      * @param format I18nFormat
      * 
      * @return ValidationCriteria object which is violated
      */
     ValidationCriteria validateEnrollment( TrackedEntityInstance entityInstance, Program program, I18nFormat format );
+    
+    /**
+     * Search tracked entity instances by a certain attribute- value
+     * 
+     * @param orgunit OrganisationUnit
+     * @param attributeValue Attribute value
+     * @param program Program
+     * @param min First result
+     * @param max Maximum results
+     * 
+     * @return TrackedEntityInstance list
+     */
+     Collection<TrackedEntityInstance> searchTrackedEntityByAttribute( OrganisationUnit orgunit, String attributeValue, Program program, Integer min , Integer max);
+     
+     /**
+      * Get the number of tracked entity instances who has a certain attribute-value
+      * 
+      * @param orgunit OrganisationUnit
+      * @param attributeValue Attribute value
+      * @param program Program
+      * @param min First result
+      * @param max Maximum results
+      * 
+      * @return The number of TEIs
+      */
+     int countTrackedEntityByAttribute( OrganisationUnit orgunit, String attributeValue, Program program );
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java	2014-05-21 08:00:16 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstanceStore.java	2014-06-11 13:14:42 +0000
@@ -28,10 +28,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.Collection;
 import java.util.List;
 import java.util.Map;
 
 import org.hisp.dhis.common.GenericIdentifiableObjectStore;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.trackedentityattributevalue.TrackedEntityAttributeValue;
 
@@ -59,4 +61,19 @@
      * @return
      */
     String validate( TrackedEntityInstance instance, TrackedEntityAttributeValue attributeValue, Program program );
+
+    /**
+     * Search tracked entity instances by a certain attribute- value
+     * 
+     * @param orgunit OrganisationUnit
+     * @param attributeValue Attribute value
+     * @param min First result
+     * @param max Maximum results
+     * 
+     * @return TrackedEntityInstance list
+     */
+    Collection<TrackedEntityInstance> searchTrackedEntityByAttribute( OrganisationUnit orgunit, String attributeValue, Program program,
+        Integer min, Integer max );
+
+    int countTrackedEntityByAttribute( OrganisationUnit orgunit, String attributeValue, Program program );
 }

=== 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-05-21 08:00:16 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityInstanceService.java	2014-06-11 13:14:42 +0000
@@ -672,4 +672,19 @@
 
         return null;
     }
+
+    @Override
+    public Collection<TrackedEntityInstance> searchTrackedEntityByAttribute( OrganisationUnit orgunit,
+        String attributeValue, Program program, Integer min, Integer max )
+    {
+        return trackedEntityInstanceStore.searchTrackedEntityByAttribute(orgunit, attributeValue, program, min, max);
+    }
+
+    @Override
+    public int countTrackedEntityByAttribute( OrganisationUnit orgunit, String attributeValue, Program program )
+    {
+        return trackedEntityInstanceStore.countTrackedEntityByAttribute( orgunit, attributeValue, program );
+    }
+    
+ 
 }

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java	2014-05-21 08:00:16 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/hibernate/HibernateTrackedEntityInstanceStore.java	2014-06-11 13:14:42 +0000
@@ -45,12 +45,14 @@
 import static org.hisp.dhis.trackedentity.TrackedEntityInstanceService.SEPARATOR;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 import org.apache.commons.lang.StringUtils;
 import org.hibernate.Criteria;
+import org.hibernate.criterion.Order;
 import org.hibernate.criterion.Projections;
 import org.hibernate.criterion.Restrictions;
 import org.hisp.dhis.common.OrganisationUnitSelectionMode;
@@ -432,4 +434,51 @@
         
         return null;
     }
+    
+    
+    @SuppressWarnings( "unchecked" )
+    @Override
+    public Collection<TrackedEntityInstance> searchTrackedEntityByAttribute( OrganisationUnit orgunit, String attributeValue, Program program, Integer min , Integer max )
+    {
+        Criteria criteria = getCriteria();
+        criteria.createAlias( "attributeValues", "attributeValue" );
+        criteria.add( Restrictions.ilike( "attributeValue.value", "%" + attributeValue + "%" ) );
+        criteria.add( Restrictions.eq( "organisationUnit", orgunit ) );
+
+        if( program!= null)
+        {
+            criteria.createAlias( "programInstances", "programInstance" );
+            criteria.createAlias( "programInstance.program", "program" );
+            criteria.add( Restrictions.eq( "program", program ) );
+        }
+        
+        if( min!= null && max != null )
+        {
+            criteria.setFirstResult( min );
+            criteria.setMaxResults( max );
+        }
+
+        criteria.addOrder( Order.asc( "lastUpdated" ));
+        
+        return criteria.list();
+    }
+    
+    @Override
+    public int countTrackedEntityByAttribute( OrganisationUnit orgunit, String attributeValue, Program program )
+    {
+        Criteria criteria = getCriteria();
+        criteria.createAlias( "attributeValues", "attributeValue" );
+        criteria.add( Restrictions.eq( "organisationUnit", orgunit ) );
+         
+        if( program!= null)
+        {
+            criteria.createAlias( "programInstances", "programInstance" );
+            criteria.createAlias( "programInstance.program", "program" );
+            criteria.add( Restrictions.eq( "program", program ) );
+        }
+
+        Number rs = (Number) criteria.setProjection(Projections.rowCount()).uniqueResult();
+
+        return ( rs != null && rs.intValue() > 0 ) ? rs.intValue() : 0;
+    }
 }

=== added 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	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SearchTrackedEntityInstanceAction.java	2014-06-11 13:14:42 +0000
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2004-2013, 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.caseentry.action.trackedentity;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.oust.manager.SelectionTreeManager;
+import org.hisp.dhis.paging.ActionPagingSupport;
+import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramService;
+import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
+import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
+import org.hisp.dhis.trackedentity.TrackedEntityInstance;
+import org.hisp.dhis.trackedentity.TrackedEntityInstanceService;
+import org.hisp.dhis.trackedentity.comparator.TrackedEntityAttributeSortOrderInListNoProgramComparator;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ * 
+ * @version $ SearchTrackedEntityInstanceAction.java Jun 11, 2014 4:28:11 PM $
+ */
+public class SearchTrackedEntityInstanceAction
+    extends ActionPagingSupport<TrackedEntityInstance>
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    @Autowired
+    private OrganisationUnitService orgunitService;
+
+    @Autowired
+    private ProgramService programService;
+
+    @Autowired
+    private TrackedEntityAttributeService attributeService;
+
+    @Autowired
+    private TrackedEntityInstanceService entityInstanceService;
+
+    // -------------------------------------------------------------------------
+    // Input/Output
+    // -------------------------------------------------------------------------
+
+    private String orgunitId;
+
+    public void setOrgunitId( String orgunitId )
+    {
+        this.orgunitId = orgunitId;
+    }
+
+    private String attributeValue;
+
+    public void setAttributeValue( String attributeValue )
+    {
+        this.attributeValue = attributeValue;
+    }
+
+    private String programId;
+
+    public void setProgramId( String programId )
+    {
+        this.programId = programId;
+    }
+
+    private List<TrackedEntityInstance> entityInstances;
+
+    public List<TrackedEntityInstance> getEntityInstances()
+    {
+        return entityInstances;
+    }
+
+    private Program program;
+
+    public Program getProgram()
+    {
+        return program;
+    }
+
+    private List<TrackedEntityAttribute> attributes;
+
+    public List<TrackedEntityAttribute> getAttributes()
+    {
+        return attributes;
+    }
+
+    private int total;
+
+    public int getTotal()
+    {
+        return total;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+    public String execute()
+        throws Exception
+    {
+        OrganisationUnit orgunit = orgunitService.getOrganisationUnit( orgunitId );
+
+        if ( !programId.isEmpty() )
+        {
+            program = programService.getProgram( programId );
+        }
+        else
+        {
+            attributes = new ArrayList<TrackedEntityAttribute>(
+                attributeService.getTrackedEntityAttributesDisplayInList() );
+            Collections.sort( attributes, new TrackedEntityAttributeSortOrderInListNoProgramComparator() );
+        }
+
+        total = entityInstanceService.countTrackedEntityByAttribute( orgunit, attributeValue, program );
+        this.paging = createPaging( total );
+
+        entityInstances = new ArrayList<TrackedEntityInstance>( entityInstanceService.searchTrackedEntityByAttribute(
+            orgunit, attributeValue, program, paging.getStartPos(), paging.getPageSize() ) );
+
+        return SUCCESS;
+    }
+}

=== 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-06-10 07:41:19 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2014-06-11 13:14:42 +0000
@@ -494,6 +494,10 @@
 			ref="org.hisp.dhis.oust.manager.SelectionTreeManager" />
 	</bean>
 
+	<bean id="org.hisp.dhis.caseentry.action.trackedentity.SearchTrackedEntityInstanceAction"
+		class="org.hisp.dhis.caseentry.action.trackedentity.SearchTrackedEntityInstanceAction" scope="prototype">
+	</bean>
+	
 	<!-- Program Enrollment -->
 
 	<bean

=== 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-06-10 07:41:19 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2014-06-11 13:14:42 +0000
@@ -545,6 +545,14 @@
 			</result>
 			<param name="requiredAuthorities">F_TRACKED_ENTITY_INSTANCE_CHANGE_LOCATION</param>
 		</action>
+		
+		<action name="searchTrackedEntityInstance"
+			class="org.hisp.dhis.caseentry.action.trackedentity.SearchTrackedEntityInstanceAction">
+			<result name="success" type="velocity-json">
+				/dhis-web-caseentry/trackedEntityInstanceRegistrationList.vm
+			</result>
+			<param name="requiredAuthorities">F_TRACKED_ENTITY_INSTANCE_SEARCH</param>
+		</action>
 
 		<!-- Program Enrollment -->
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/trackedEntityInstance.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/trackedEntityInstance.js	2014-05-25 14:36:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/trackedEntityInstance.js	2014-06-11 13:14:42 +0000
@@ -608,4 +608,26 @@
 				}
 				registrationProgress = false;
 			});
-}
\ No newline at end of file
+}
+
+function searchByIdsOnclick()
+{
+	if( getFieldValue('searchPatientByAttributes')==''){
+		return;
+	}
+	
+	jQuery('#listEntityInstanceDiv').load(
+		'searchTrackedEntityInstance.action', {
+			orgunitId: getFieldValue('orgunitId'),
+			attributeValue: getFieldValue('searchPatientByAttributes'),
+			programId: getFieldValue('program')
+		}, function() {
+			setInnerHTML('orgunitInfor', getFieldValue('orgunitName'));
+			if( getFieldValue('program')!= ''){
+				var programName = jQuery('#programIdAddTrackedEntity option:selected').text();
+				setInnerHTML('enrollmentInfor', i18n_enrollments_in + " " + programName + " " + i18n_program);
+			}
+			showById('listEntityInstanceDiv');
+			jQuery('#loaderDiv').hide();
+		});
+}

=== 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-05-25 09:27:50 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTrackedEntityInstanceCriteria.vm	2014-06-11 13:14:42 +0000
@@ -35,7 +35,6 @@
 		</td>
 		<td id='listEntityInstanceBtnTD'>
 			<input type="button" id='listEntityInstanceBtn' value="$i18n.getString( 'list_all_tracked_entity_instances' )" onclick="isAdvancedSearch=false;listAllTrackedEntityInstance(1);">
-			<input type="button" id='advancedSearchBtn' value='$i18n.getString( "advanced_search" )' onclick="advancedSearchOnclick();">
 		</td>
 	</tr>
 	
@@ -69,7 +68,15 @@
 			<input type='checkbox' id='followup' name='followup' />
 		</td>
 	</tr>
-	
+	<tr id='searchByIdTR' class='hidden'>
+		<td colspan='2'>
+			<input type='text' id='searchPatientByAttributes' name='searchPatientByAttributes' onchange='searchByIdsOnclick();' style='width:350px;' placeholder='$i18n.getString("search_by_identifier")' />
+		</td>
+		<td>
+			<input type='button' value='$i18n.getString("search")' onclick='searchByIdsOnclick();'>
+			<input type="button" id='advancedSearchBtn' value='$i18n.getString( "advanced_search" )' onclick="advancedSearchOnclick();">
+		</td>
+	</tr>
 </table>
 
 <div id='showSearchCriteriaDiv' class='hidden green-background'><img src='../images/move_bottom.png' onclick='showSearchCriteria();' >&nbsp;&nbsp; $i18n.getString("there_are_active_search_filter_click_on_arrow_to_show_them")</div>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceRegistrationList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceRegistrationList.vm	2014-04-17 16:00:32 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceRegistrationList.vm	2014-06-11 13:14:42 +0000
@@ -1,7 +1,7 @@
 <table>
 	<tr>
 		<td class='text-column'>
-			$i18n.getString( "the_following_tracked_entity_instances_found_in" ) $organisationUnit.name <span id='enrollmentInfor'></span> 
+			$i18n.getString( "the_following_tracked_entity_instances_found_in" ) <span id='orgunitInfor'></span> <span id='enrollmentInfor'></span> 
 			<script>
 				setInnerHTML('orgunitForSearch',"$organisationUnit.name");
 				var i18n_for = '$encoder.jsEscape( $i18n.getString( "for_infor" ), "'")';
@@ -45,10 +45,7 @@
 					<col/>
 				#end
 			#end
-		  #if($!mapTrackedEntityInstanceOrgunit 
-			&& $!mapTrackedEntityInstanceOrgunit.size()!=0)
-		  <col/>
-		  #end
+		
 		  <col width="200"/>    
 		  
 		  <thead>
@@ -66,10 +63,6 @@
 					#end
 				#end
 				
-				#if($mapEntityInstanceOrgunit.size()!=0)
-					<th>$i18n.getString( "hierachy_orgunit" )</th>
-				#end
-				
 				<th style="text-align:center">$i18n.getString( "operations" )</th>
 			  </tr>
           </thead>
@@ -120,11 +113,6 @@
 					#end
 				#end
 				
-				#if($!mapTrackedEntityInstanceOrgunit 
-					&& $!mapTrackedEntityInstanceOrgunit.size()!=0)
-					<td>$!mapTrackedEntityInstanceOrgunit.get($entityInstance.id)</td>
-				#end
-				
 				<td>
 				  <a href="javascript:isDashboard=true;showTrackedEntityInstanceDashboardForm( '$entityInstance.uid' )" title='$i18n.getString( "dashboard" )'><img src="../images/enroll.png" alt='$i18n.getString( "dashboard" )'></a>
 				  <a href="javascript:isDashboard=false;showUpdateTrackedEntityInstanceForm( '$entityInstance.uid' )" title='$i18n.getString( "edit_profile" )'><img src="../images/edit.png" alt='$i18n.getString( "edit_profile" )'></a>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/GetProgramListAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/GetProgramListAction.java	2014-04-15 14:30:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/program/GetProgramListAction.java	2014-06-11 13:14:42 +0000
@@ -97,7 +97,7 @@
         else
         {
             this.paging = createPaging( programService.getProgramCount() );
-
+            
             programs = new ArrayList<Program>( programService.getProgramsBetween( paging.getStartPos(),
                 paging.getPageSize() ) );
         }