← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14786: Applied web-api for Lost to follow-up..

 

------------------------------------------------------------
revno: 14786
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-04-11 08:54:51 +0800
message:
  Applied web-api for Lost to follow-up..
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramTrackingListAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetProgramInstanceHistoryAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SelectAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.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/jsonProgramAttributes.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm
  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/searchTrackedEntityInstanceCriteria.vm


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java	2014-04-06 15:48:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/MultiDataEntrySelectAction.java	2014-04-11 00:54:51 +0000
@@ -30,13 +30,19 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
 
+import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramService;
+import org.hisp.dhis.trackedentity.TrackedEntity;
 import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
 import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
+import org.hisp.dhis.trackedentity.TrackedEntityService;
+import org.springframework.beans.factory.annotation.Autowired;
 
 import com.opensymphony.xwork2.Action;
 
@@ -68,6 +74,9 @@
         this.attributeService = attributeService;
     }
 
+    @Autowired
+    private TrackedEntityService trackedEntityService;
+
     // -------------------------------------------------------------------------
     // Input/Output
     // -------------------------------------------------------------------------
@@ -98,13 +107,20 @@
         return programs;
     }
 
-    private Collection<TrackedEntityAttribute> attributes = new ArrayList<TrackedEntityAttribute>();
+    private List<TrackedEntityAttribute> attributes = new ArrayList<TrackedEntityAttribute>();
 
-    public Collection<TrackedEntityAttribute> getAttributes()
+    public List<TrackedEntityAttribute> getAttributes()
     {
         return attributes;
     }
 
+    private List<TrackedEntity> trackedEntities = new ArrayList<TrackedEntity>();
+
+    public List<TrackedEntity> getTrackedEntities()
+    {
+        return trackedEntities;
+    }
+
     // -------------------------------------------------------------------------
     // Implementation Action
     // -------------------------------------------------------------------------
@@ -112,7 +128,11 @@
     public String execute()
         throws Exception
     {
-        attributes = attributeService.getAllTrackedEntityAttributes();
+        attributes = new ArrayList<TrackedEntityAttribute>( attributeService.getAllTrackedEntityAttributes() );
+        Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );
+        
+        trackedEntities = new ArrayList<TrackedEntity>( trackedEntityService.getAllTrackedEntity() );
+        Collections.sort( trackedEntities, IdentifiableObjectNameComparator.INSTANCE );
 
         organisationUnit = selectionManager.getSelectedOrganisationUnit();
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramTrackingListAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramTrackingListAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/GetProgramTrackingListAction.java	2014-04-11 00:54:51 +0000
@@ -78,7 +78,7 @@
     // Input/Output
     // -------------------------------------------------------------------------
 
-    private Integer programStageInstanceId;
+    private String programStageInstanceId;
 
     private ProgramStageInstance programStageInstance;
 
@@ -107,7 +107,7 @@
         return currentUsername;
     }
 
-    public void setProgramStageInstanceId( Integer programStageInstanceId )
+    public void setProgramStageInstanceId( String programStageInstanceId )
     {
         this.programStageInstanceId = programStageInstanceId;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetProgramInstanceHistoryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetProgramInstanceHistoryAction.java	2014-03-26 14:01:14 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetProgramInstanceHistoryAction.java	2014-04-11 00:54:51 +0000
@@ -65,9 +65,9 @@
     // Getters && Setters
     // -------------------------------------------------------------------------
 
-    private Integer programInstanceId;
+    private String programInstanceId;
 
-    public void setProgramInstanceId( Integer programInstanceId )
+    public void setProgramInstanceId( String programInstanceId )
     {
         this.programInstanceId = programInstanceId;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SelectAction.java	2014-04-04 17:58:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SelectAction.java	2014-04-11 00:54:51 +0000
@@ -50,97 +50,102 @@
  * @author Abyot Asalefew Gizaw
  * @version $Id$
  */
-public class SelectAction implements Action {
-	// -------------------------------------------------------------------------
-	// Dependencies
-	// -------------------------------------------------------------------------
-
-	private OrganisationUnitSelectionManager selectionManager;
-
-	public void setSelectionManager(
-			OrganisationUnitSelectionManager selectionManager) {
-		this.selectionManager = selectionManager;
-	}
-
-	private TrackedEntityAttributeService attributeService;
-
-	public void setAttributeService(
-			TrackedEntityAttributeService attributeService) {
-		this.attributeService = attributeService;
-	}
-
-	private ProgramService programService;
-
-	public void setProgramService(ProgramService programService) {
-		this.programService = programService;
-	}
-
-	@Autowired
-	private TrackedEntityService trackedEntityService;
-
-	// -------------------------------------------------------------------------
-	// Input/output
-	// -------------------------------------------------------------------------
-
-	private List<TrackedEntityAttribute> attributes;
-
-	public List<TrackedEntityAttribute> getAttributes() {
-		return attributes;
-	}
-
-	private List<Program> programs;
-
-	public List<Program> getPrograms() {
-		return programs;
-	}
-
-	private OrganisationUnit organisationUnit;
-
-	public OrganisationUnit getOrganisationUnit() {
-		return organisationUnit;
-	}
-
-	private int status;
-
-	public int getStatus() {
-		return status;
-	}
-
-	private List<TrackedEntity> trackedEntities = new ArrayList<TrackedEntity>();
-
-	public List<TrackedEntity> getTrackedEntities() {
-		return trackedEntities;
-	}
-
-	// -------------------------------------------------------------------------
-	// Action implementation
-	// -------------------------------------------------------------------------
-
-	public String execute() throws Exception {
-
-		organisationUnit = selectionManager.getSelectedOrganisationUnit();
-
-		Collection<TrackedEntityAttribute> _attributes = attributeService
-				.getTrackedEntityAttributesWithoutProgram();
-		_attributes.addAll(attributeService
-				.getTrackedEntityAttributesDisplayInList(true));
-		attributes = new ArrayList<TrackedEntityAttribute>(_attributes);
-		Collections.sort(attributes, IdentifiableObjectNameComparator.INSTANCE);
-
-		trackedEntities = new ArrayList<TrackedEntity>(
-				trackedEntityService.getAllTrackedEntity());
-		Collections.sort(trackedEntities, IdentifiableObjectNameComparator.INSTANCE);
-
-		if (organisationUnit != null) {
-			programs = new ArrayList<Program>(
-					programService.getProgramsByCurrentUser(organisationUnit));
-			programs.removeAll(programService
-					.getPrograms(Program.SINGLE_EVENT_WITHOUT_REGISTRATION));
-
-			Collections.sort(programs,
-					IdentifiableObjectNameComparator.INSTANCE);
-		}
-
-		return SUCCESS;
-	}
+public class SelectAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependencies
+    // -------------------------------------------------------------------------
+
+    private OrganisationUnitSelectionManager selectionManager;
+
+    public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
+    {
+        this.selectionManager = selectionManager;
+    }
+
+    private TrackedEntityAttributeService attributeService;
+
+    public void setAttributeService( TrackedEntityAttributeService attributeService )
+    {
+        this.attributeService = attributeService;
+    }
+
+    private ProgramService programService;
+
+    public void setProgramService( ProgramService programService )
+    {
+        this.programService = programService;
+    }
+
+    @Autowired
+    private TrackedEntityService trackedEntityService;
+
+    // -------------------------------------------------------------------------
+    // Input/output
+    // -------------------------------------------------------------------------
+
+    private List<TrackedEntityAttribute> attributes;
+
+    public List<TrackedEntityAttribute> getAttributes()
+    {
+        return attributes;
+    }
+
+    private List<Program> programs;
+
+    public List<Program> getPrograms()
+    {
+        return programs;
+    }
+
+    private OrganisationUnit organisationUnit;
+
+    public OrganisationUnit getOrganisationUnit()
+    {
+        return organisationUnit;
+    }
+
+    private int status;
+
+    public int getStatus()
+    {
+        return status;
+    }
+
+    private List<TrackedEntity> trackedEntities = new ArrayList<TrackedEntity>();
+
+    public List<TrackedEntity> getTrackedEntities()
+    {
+        return trackedEntities;
+    }
+
+    // -------------------------------------------------------------------------
+    // Action implementation
+    // -------------------------------------------------------------------------
+
+    public String execute()
+        throws Exception
+    {
+
+        organisationUnit = selectionManager.getSelectedOrganisationUnit();
+
+        Collection<TrackedEntityAttribute> _attributes = attributeService.getTrackedEntityAttributesWithoutProgram();
+        _attributes.addAll( attributeService.getTrackedEntityAttributesDisplayInList( true ) );
+        attributes = new ArrayList<TrackedEntityAttribute>( _attributes );
+        Collections.sort( attributes, IdentifiableObjectNameComparator.INSTANCE );
+
+        trackedEntities = new ArrayList<TrackedEntity>( trackedEntityService.getAllTrackedEntity() );
+        Collections.sort( trackedEntities, IdentifiableObjectNameComparator.INSTANCE );
+
+        if ( organisationUnit != null )
+        {
+            programs = new ArrayList<Program>( programService.getProgramsByCurrentUser( organisationUnit ) );
+            programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
+
+            Collections.sort( programs, IdentifiableObjectNameComparator.INSTANCE );
+        }
+
+        return SUCCESS;
+    }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2014-04-06 18:03:57 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2014-04-11 00:54:51 +0000
@@ -683,4 +683,5 @@
 auto_save_tracked_entity_registration_forms = Auto save tracked entity registration forms 
 children = Children
 cancelled_enrollments_only = Cancelled enrollments only
-all_statuses = All statuses
\ No newline at end of file
+all_statuses = All statuses
+event_date = Event date
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2014-04-08 15:19:50 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2014-04-11 00:54:51 +0000
@@ -134,15 +134,28 @@
 	}
 	else if (getFieldValue('program') != '') {
 		params += "&program=" + getFieldValue('program');
+		if( getFieldValue('programStatus')!=""){
+			params += "&programStatus=" + getFieldValue('programStatus');
+		}
 	}
 	
 	if(getFieldValue('programStatus') != ''){
 		params += "&programStatus=" + getFieldValue('programStatus');
 	}
 	
+	if( getFieldValue('startDate') != ''){
+		params += "&startDate=" + getFieldValue('startDate');
+		params += "&endDate=" + getFieldValue('endDate');
+	}
+	
+	if( getFieldValue('status')!= '' ){
+		params += "&status=" + getFieldValue('status');
+	}
+	
 	var flag = false;
 	$('#advancedSearchTB tr').each(
 		function(i, row) {
+			var isProgramDate = false;
 			var dateOperator = "";
 			var p = "";
 			jQuery(this).find(':input').each(
@@ -150,15 +163,18 @@
 					if (item.type != "button") {
 						if (idx == 0) {
 							if (item.value == 'programDate') {
-								p += "&programDate=";
+								isProgramDate = true;
 							} else {
-								p += "&filter=" + item.value;
+								p += "&attribute=" + item.value;
 							}
 						} else if (item.name == 'dateOperator') {
 							dateOperator = item.value;
 						} else if (item.name == 'searchText') {
 							if (item.value != '') {
-								if (dateOperator.length > 0) {
+								if( isProgramDate ){
+									p += "&programDate=EQ:" + item.value;
+								}
+								else if (dateOperator.length > 0) {
 									p += dateOperator + ":" + item.value.toLowerCase();
 								} else {
 									var key = item.value.toLowerCase()
@@ -174,7 +190,16 @@
 				});
 			params += p;
 		});
-			
+	
+	var p = params;
+	$('#searchingAttributeIdTD [id=searchObjectId] option').each(
+		function(i, item) {
+				if ($(item).attr('displayed')=="true" 
+					&& p.indexOf(item.value) < 0 ) {
+						params += "&attribute=" + item.value;
+			}
+		}); 
+		
 	params += '&ouMode=' + getFieldValue('ouMode');
 	
 	return params;
@@ -350,7 +375,7 @@
 		clearListById('searchObjectId');
 		if (getFieldValue('program') != '') {
 			jQuery('#searchObjectId').append(
-				'<option value="programDate" displayed="true">' + i18n_enrollment_date
+				'<option value="programDate" >' + i18n_enrollment_date
 					+ '</option>');
 		}
 

=== 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-06 15:48:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js	2014-04-11 00:54:51 +0000
@@ -57,48 +57,132 @@
 // List all events
 // --------------------------------------------------------------------
 
-function listAllTrackedEntityInstance()
+function listAllTrackedEntityInstance( page )
 {
 	hideById('listEventDiv');
 	hideById('advanced-search');
 	contentDiv = 'listEventDiv';
 	$('#contentDataRecord').html('');
 	hideById('advanced-search');
-	eventList = 1;
-	
-	var date = new Date();
-	var d = date.getDate() - 1;
-	var m = date.getMonth();
-	var y1 = date.getFullYear() - 100;
-	var y2 = date.getFullYear() + 100;
-	var startDate = jQuery.datepicker.formatDate( dateFormat, new Date(y1, m, d) );
-	var endDate = jQuery.datepicker.formatDate( dateFormat, new Date(y2, m, d) );
-	
-	var programId = getFieldValue('program');
-	var searchTexts = "stat_" + programId + "_" 
-				+ startDate + "_" + endDate + "_" 
-				+ getFieldValue('orgunitId') + "_true_" 
-				+ getFieldValue('statusEvent');
-	var followup = "";
-	if( byId('followup').checked ){
-		followup = "followup=true";
+	
+	var params = "orgUnit=" + getFieldValue("orgunitId");
+	params += "&ouMode=SELECTED";
+	params += "&program=" + getFieldValue('program');
+	if( $('#followup').attr('checked')=='checked'){
+		params += "followUp=true";
 	}
-	
-	generateResultParams = followup + "&programId=" + programId + "&searchTexts=" + searchTexts;
-	
-	showLoader();
-	jQuery('#listEventDiv').load('getSMSTrackedEntityInstanceRecords.action?' + followup,
-		{
-			programId:programId,
-			listAll:false,
-			searchTexts: searchTexts
-		}, 
-		function()
-		{
-			showById('colorHelpLink');
+	$.ajax({
+		type : "GET",
+		url : "../api/events.json",
+		data : params,
+		dataType : "json",
+		success : function(json) {
+			setInnerHTML('listEventDiv', displayEventList(json, page));
 			showById('listEventDiv');
-			hideLoader();
-		});
+			jQuery('#loaderDiv').hide();
+			setTableStyles();
+		}
+	});
+	
+}
+
+
+function displayEventList(json, page) {
+
+	var table = "";
+	
+	// Header
+	if (json.pager.total > 0) {
+		table += "<p>" + i18n_total_result + " : " + json.pager.total
+				+ "</p>";
+	} else {
+		table += "<p>" + i18n_no_result_found + "</p>";
+	}
+	
+	if( json.pager.total > 0 ){
+		// Event list
+		table += "<table class='listTable' width='100%'>";
+		
+		table += "<col width='30' />";
+		table += "<col />"; // Ordered no.
+		table += "<col />"; // Event-date
+		for(var i in json.events[0].dataValues.length ){
+			table += "<col />";
+		}
+		table += "<col width='200' />";
+		
+		table += "<thead><tr><th>#</th>";
+		table += "<th>" + i18n_event_date + "</th>";
+		for(var i in json.events[0].dataValues ){
+			table += "<th>" + json.events[0].dataValues[i].dataElement + "</th>";
+		}
+		table += "<th>" + i18n_operations + "</th>";
+		table += "</tr></thead>";
+		
+		table += "<tbody id='list'>";
+		for ( var i in json.events) {
+			var cols = json.events[i];
+			var uid = cols.event;
+			var teiUid = cols.trackedEntityInstance;
+			var no = eval(json.pager.page);
+			no = (no - 1) * json.pager.pageSize + eval(i) + 1;
+			table += "<tr id='tr" + uid + "'>";
+			table += "<td>" + no + "</td>";
+			table += "<td>" + json.events[i].eventDate + "</td>";
+			for (var j in cols.dataValues) {
+				table += "<td>" +  cols.dataValues[j].value + "</td>";
+			}
+			
+			// Operations column
+			table += "<td>";
+			table += "<a href=\"javascript:isDashboard=false;showTrackedEntityInstanceDashboardForm( '"
+					+ teiUid
+					+ "' )\" title='"
+					+ i18n_dashboard
+					+ "'><img src='../images/enroll.png' alt='"
+					+ i18n_dashboard
+					+ "'></a>";
+			table += "<a href=\"javascript:programTrackingList( '" + uid + "', false ) \" "
+					+ " title='"
+					+ i18n_edit
+					+ "'><img src= '../images/edit.png' alt='"
+					+ i18n_edit
+					+ "'></a>";
+			table += "</td>";
+			table += "</tr>";
+		}
+		table += "</tbody>";
+		table += "</table>";
+	
+		table += paging(json, page);
+	}
+	return table;
+}
+
+// Paging
+
+function paging(json, page) {
+	var table = "<table width='100%' style='background-color: #ebf0f6;'><tr><td colspan='"
+			+ json.width + "'>";
+	table += "<div class='paging'>";
+	table += "<span class='first' title='" + i18n_first + "'>««</span>";
+	table += "<span class='prev' title='" + i18n_prev + "'>«</span>";
+	for (var i = 1; i <= json.pager.pageCount; i++) {
+		if (i == page) {
+			table += "<span class='page' title='" + i18n_page + " " + i + "'>"
+					+ i + "</span>";
+		} else {
+			table += "<a class='page' title='" + i18n_page + " " + i
+					+ "' href='javascript:listAllTrackedEntityInstance( " + i
+					+ ");'>" + i + "</a>";
+		}
+		table += "<span class='seperator'>|</span>";
+	}
+	table += "<span class='next' title='" + i18n_next + "'>» </span>";
+	table += "<span class='last' title='" + i18n_last + "'>»»</span>";
+	table += "</div>";
+	table += "</tr></table>";
+	return table;
 }
 
 // --------------------------------------------------------------------
@@ -107,29 +191,26 @@
 
 followup = true;
 
-function advancedSearch( params )
+function advancedSearch( params, page )
 {
 	setFieldValue('listAll', "false");
 	$('#contentDataRecord').html('');
 	$('#listEventDiv').html('');
 	hideById('listEventDiv');
 	showLoader();
-	params += "&programId=" + getFieldValue('program');
-	generateResultParams = params;
-	
+	params += "&orgUnit=" + getFieldValue("orgunitId");
 	$.ajax({
-		url: 'getSMSEntityInstanceRecords.action',
-		type:"POST",
-		data: params,
-		success: function( html ){
-			jQuery('#listEventDiv').html(html);
-			showById('colorHelpLink');
+		url : '../api/events.json',
+		type : "GET",
+		data : params,
+		success : function(json) {
+			setInnerHTML('listEventDiv', displayEventList(json, page));
 			showById('listEventDiv');
-			eventList = 2;
+			jQuery('#loaderDiv').hide();
 			setTableStyles();
-			hideLoader();
 		}
 	});
+	
 }
 
 function exportXlsFile()

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramAttributes.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramAttributes.vm	2014-04-04 17:58:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramAttributes.vm	2014-04-11 00:54:51 +0000
@@ -5,7 +5,7 @@
 #end
 
 #if( $!program.attributes )
-	#set( $size = $size + $!program.attributes.size() ) 
+	#set( $size = $size + $program.attributes.size() ) 
 #end
 
 { "attributes": [
@@ -17,7 +17,7 @@
   }#if( $velocityCount < $size ),#end
 #end
 
-#set( $idx = $attributes.size() )
+#set( $idx = $attributes.size() + 1 )
 #foreach( $programAttribute in $program.attributes )
  {
 	"id":  "${programAttribute.attribute.uid}",
@@ -25,7 +25,7 @@
 	"displayed": "$programAttribute.displayInList"
   }#if( $idx < $size ),#end
   
-  #set( $idx = $idx + 1 )
+  #set( $idx = $idx + 1 ) 
 #end
 ]
 }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm	2014-04-07 12:46:17 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm	2014-04-11 00:54:51 +0000
@@ -1,4 +1,6 @@
-#if( $auth.hasAccess( "dhis-web-caseentry", "trackedEntityInstance" ) || $auth.hasAccess( "dhis-web-caseentry", "activityPlanSelect" ) 	|| $auth.hasAccess( "dhis-web-caseentry", "smsReminderSelect" ) )
+#if( $auth.hasAccess( "dhis-web-caseentry", "trackedEntityInstance" ) 
+	|| $auth.hasAccess( "dhis-web-caseentry", "activityPlanSelect" ) 
+	|| $auth.hasAccess( "dhis-web-caseentry", "smsReminderSelect" ) )
 <h2>$i18n.getString( "tracked_entity_instance" )&nbsp;</h2>
 #end
 <ul>
@@ -12,8 +14,9 @@
 		<li><a href="smsReminderSelect.action">$i18n.getString( "program_tracking" )</a></li>     
 	#end
 </ul>
-
-#if( $auth.hasAccess( "dhis-web-caseentry", "singleEventSelect" ) || $auth.hasAccess( "dhis-web-caseentry", "anonymousRegistration" ) )
+#if( $auth.hasAccess( "dhis-web-caseentry", "multipledataEntrySelect" ) 
+	|| $auth.hasAccess( "dhis-web-caseentry", "singleEventSelect" ) 
+	|| $auth.hasAccess( "dhis-web-caseentry", "anonymousRegistration" ) )
 <h2>$i18n.getString( "data_entry" )&nbsp;</h2>
 #end
 <ul>
@@ -25,7 +28,9 @@
 	#end
 </ul>
 
-#if( $auth.hasAccess( "dhis-web-caseentry", "reportSelect" ) || $auth.hasAccess( "dhis-web-caseentry", "statisticalProgramReportSelect" ) || $auth.hasAccess( "dhis-web-caseentry", "programStageCompletenessSelect" ) )	
+#if( $auth.hasAccess( "dhis-web-caseentry", "reportSelect" ) 
+	|| $auth.hasAccess( "dhis-web-caseentry", "statisticalProgramReportSelect" ) 
+	|| $auth.hasAccess( "dhis-web-caseentry", "programStageCompletenessSelect" ) )	
 <h2>$i18n.getString( "reports" )&nbsp;</h2>
 #end
 <ul>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm	2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm	2014-04-11 00:54:51 +0000
@@ -5,7 +5,7 @@
 </h3>
 
 <input type='hidden' id='currentUsername' name='currentUsername' value='$currentUsername'>
-<input type='hidden' id='programInstanceId' name='programInstanceId' value='$programStageInstance.programInstance.id'>
+<input type='hidden' id='programInstanceId' name='programInstanceId' value='$programStageInstance.programInstance.uid'>
 <input type='hidden' id='ps_$programStageInstance.id' name='ps_$programStageInstance.id' programStageName='$programStageInstance.programStage.displayName' >
 
 #set($programInstance = $programStageInstance.programInstance)
@@ -157,8 +157,8 @@
 	
 	<div id='tab-3'>
 		<p>
-			<input type="button" onclick="exportProgramReports( '$programInstance.id', 'xls' )" value="$i18n.getString('get_report_as_xls')" style='width:150px;'>
-			<input type="button" onclick="exportProgramReports( '$programInstance.id', 'pdf' )" value="$i18n.getString('get_report_as_pdf')" style='width:150px;'>
+			<input type="button" onclick="exportProgramReports( '$programInstance.uid', 'xls' )" value="$i18n.getString('get_report_as_xls')" style='width:150px;'>
+			<input type="button" onclick="exportProgramReports( '$programInstance.uid', 'pdf' )" value="$i18n.getString('get_report_as_pdf')" style='width:150px;'>
 		</p>
 		<div id='programReportDiv'></div>
 	</div>

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm	2014-03-25 09:41:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm	2014-04-11 00:54:51 +0000
@@ -98,7 +98,7 @@
 			#if( $entityInstanceId != $entityInstance.id ) 
 			<td class='$alterclass' name='opt_$entityInstance.id'>
 				<a href="javascript:isDashboard=false;showTrackedEntityInstanceDashboardForm( '$entityInstance.id' )" title="$i18n.getString( 'dashboard' )"><img src="../images/enroll.png" alt='$i18n.getString( "dashboard" )'></a>
-				<a href="javascript:programTrackingReport( $programStageInstance.programInstance.id )" title='$i18n.getString( "program_report" )'><img src="../images/information.png" alt='$i18n.getString( "program_report" )'></a>
+				<a href="javascript:programTrackingReport( $programStageInstance.programInstance.uid )" title='$i18n.getString( "program_report" )'><img src="../images/information.png" alt='$i18n.getString( "program_report" )'></a>
 			</td>
 			#else
 				<script>

=== 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-06 18:09:34 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm	2014-04-11 00:54:51 +0000
@@ -4,18 +4,20 @@
         showById('sendSmsToListBtn');
         jQuery("#program option").each(function() {
             var item = jQuery(this);
-            if( item.attr('type') != 1 || item.val() != '' ) {
+            if( item.val() != '' && item.attr('type') != 1 ) {
                 item.remove();
             }
         });
 
+		jQuery("#program option[value='']").text(i18n_please_select);
         jQuery("#searchObjectId").prepend('<option value="-100">' + i18n_please_select_criteria + '</option>');
         jQuery("#searchObjectId [value=]").attr("selected", "selected");
 
-        disable('statusEvent');
+        disable('status');
         disable('listEntityInstanceBtn');
         hideById('addEntityInstanceBtn');
         hideById('searchBySelectedUnitTD');
+		hideById('trackedEntityTR');
         disable('advancedSearchBtn');
         setFieldValue('searchByProgramStage', 'true');
         setFieldValue('hideLink', 'true');
@@ -28,6 +30,7 @@
         jQuery('#listEntityInstanceBtnTD').attr('rowspan', 2);
         jQuery('#listEntityInstanceBtnTD').attr('valign', 'bottom');
 
+		jQuery('#advancedSearchTB').remove();
         mainPage = 0;
     });
 </script>
@@ -162,6 +165,16 @@
     var i18n_comment = '$encoder.jsEscape( $i18n.getString( "comment" ) , "'")';
 	var i18n_message = '$encoder.jsEscape( $i18n.getString( "message" ) , "'")';
 	var i18n_program_report = '$encoder.jsEscape( $i18n.getString( "program_report" ) , "'")';
+	var i18n_event_date = '$encoder.jsEscape( $i18n.getString( "event_date" ) , "'")';
+	var i18n_operations = '$encoder.jsEscape( $i18n.getString( "operations" ) , "'")';
+	var i18n_edit = '$encoder.jsEscape( $i18n.getString( "edit" ) , "'")';
+	var i18n_total_result = '$encoder.jsEscape( $i18n.getString( "total_result" ) , "'")';
+	var i18n_dashboard = '$encoder.jsEscape( $i18n.getString( "dashboard" ) , "'")';
+	var i18n_first = '$encoder.jsEscape( $i18n.getString( "first" ) , "'")';
+	var i18n_prev = '$encoder.jsEscape( $i18n.getString( "prev" ) , "'")';
+	var i18n_page = '$encoder.jsEscape( $i18n.getString( "page" ) , "'")';
+	var i18n_next = '$encoder.jsEscape( $i18n.getString( "next" ) , "'")';
+	var i18n_last = '$encoder.jsEscape( $i18n.getString( "last" ) , "'")';
 	
 	var checkedDuplicate = false;
 	var registration = false;
@@ -177,7 +190,7 @@
 	var y= date.getFullYear();
 	
 	var newDate = jQuery.datepicker.formatDate( dateFormat, new Date(y-100, m, d) ) ;
-	jQuery('#startDueDate').datepicker('setDate', newDate);
+	$('#startDate').datepicker('setDate', newDate);
 	newDate = jQuery.datepicker.formatDate( dateFormat, new Date(y, m, d-1) ) ;
-	jQuery('#endDueDate').datepicker('setDate', newDate);
+	$('#endDate').datepicker('setDate', newDate);
 </script>

=== 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-06 18:09:34 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTrackedEntityInstanceCriteria.vm	2014-04-11 00:54:51 +0000
@@ -47,6 +47,7 @@
 		<td>$i18n.getString('status')</td>
 		<td>
 			<select id="status" name="status">
+				<option value=''>$i18n.getString("all")</option>
 				<option value='LATE_VISIT'>$i18n.getString("overdue")</option>
 				<option value='ACTIVE'>$i18n.getString("active")</option>
 				<option value='VISITED'>$i18n.getString("incomplete")</option>
@@ -113,8 +114,8 @@
 		<tr id='dueDateTR' class='hidden'>
 			<td>$i18n.getString('due_date_from_to')</td>
 			<td>
-				<input type='text' id='startDueDate' name='startDueDate' style='width:127px;'>
-				<input type='text' id='endDueDate' name='endDueDate' style='width:127px;'>
+				<input type='text' id='startDate' name='startDate' style='width:127px;'>
+				<input type='text' id='endDate' name='endDate' style='width:127px;'>
 			</td>
 		</tr>
 		<tr>