← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14926: Fixed bug - Exception thrown when to click on List all TEI button or Advanced search in Single ev...

 

------------------------------------------------------------
revno: 14926
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-04-21 22:30:25 +0800
message:
  Fixed bug - Exception thrown when to click on List all TEI button or Advanced search in Single event with registration entry form.
modified:
  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/form.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonSingleEventPrograms.vm
  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/selectTrackedEntityInstance.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.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/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-20 02:45:01 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js	2014-04-21 14:30:25 +0000
@@ -1872,6 +1872,7 @@
 // ---------------------------------------------------------------------------------
 // Followup program-instance
 // ---------------------------------------------------------------------------------
+
 function markForFollowup(programInstanceId, followup) {
 	$.postJSON("markForFollowup.action", {
 		programInstanceId : programInstanceId,
@@ -1903,49 +1904,11 @@
 		}
 	});
 }
+
 // --------------------------------------------------------------------------
 // Advanced-search person
 // --------------------------------------------------------------------------
-function searchByIdsOnclick() {
-	if (getFieldValue("searchTrackedEntityInstanceByIds") == '') {
-		hideById('listEntityInstanceDiv');
-		return;
-	}
-	var params = "searchTexts=iden_"
-			+ getFieldValue("searchEntityInstanceByIds").toLowerCase() + "_"
-			+ getFieldValue("orgunitId");
-	params += "&listAll=false";
-	params += "&facilityLB=";
-	if (getFieldValue('program') != "") {
-		params += "&programId=" + getFieldValue('program');
-		params += "&searchTexts=prg_"
-				+ getFieldValue('program');
-	}
-	hideById('listEntityInstanceDiv');
-	$("#loaderDiv").show();
-	$.ajax({
-		url : 'searchTrackedEntityInstance.action',
-		type : "POST",
-		data : params,
-		success : function(html) {
-			setTableStyles();
-			statusSearching = 1;
-			setInnerHTML('listEntityInstanceDiv', html);
-			showById('listEntityInstanceDiv');
-			setFieldValue('listAll', false);
-			var value = getFieldValue('searchEntityInstanceByIds');
-			var searchObject = $("[name=searchObjectId]")[1];
-			if (searchObject.value == 'iden') {
-				$("[name=searchText]")[0].value = value;
-			} else {
-				addAttributeOption();
-				$("input[id=searchText]").last().val(value);
-			}
-			showById('hideSearchCriteriaDiv');
-			$("#loaderDiv").hide();
-		}
-	});
-}
+
 function advancedSearchOnclick() {
 	$('#advanced-search').toggle();
 	if ($('#advanced-search').is(':visible')) {

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.js	2014-04-06 15:48:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.js	2014-04-21 14:30:25 +0000
@@ -49,7 +49,7 @@
 			}
 			showById('entryForm');
 			hideLoader();
-			hideById('contentDiv'); 
+			hideById('listEntityInstanceDiv'); 
 		} );
 }
 
@@ -63,7 +63,7 @@
 	hideById('dataEntryFormDiv');
 	hideById('addNewDiv');
 	showById('searchDiv');
-	showById('contentDiv');
+	showById('listEntityInstanceDiv');
 	showById('mainLinkLbl');
 	jQuery('#createNewEncounterDiv').dialog('close');
 	jQuery('#resultSearchDiv').dialog('close');
@@ -74,26 +74,35 @@
 //--------------------------------------------------------------------------------------------
 
 isAjax = true;
-function listAllTrackedEntityInstance()
+function listAllTrackedEntityInstance(page)
 {
 	hideById('advanced-search');
 	showLoader();
-	jQuery('#contentDiv').load( 'listAllTrackedEntityInstances.action',{
-			listAll:false,
-			programId:	getFieldValue("program"),
-			searchTexts: "prg_" + getFieldValue("program"),
-			searchByUserOrgunits: false,
-			searchBySelectedOrgunit:true
-		},
-		function()
-		{
-			hideById('dataRecordingSelectDiv');
-			hideById('dataEntryFormDiv');
-			showById('searchDiv');
-			setInnerHTML('searchInforTD', i18n_list_all_tracked_entity_instances );
-			setFieldValue('listAll', true);
-			hideLoader();
-		});
+	
+	jQuery('#loaderDiv').show();
+	listEntityInstanceDiv = 'listEntityInstanceDiv';
+	var params = "page=" + page;
+	if (getFieldValue('program') != '') {
+		params += "&program=" + getFieldValue('program');
+	}
+	
+	$('#attributeIds option').each(function(i, item){
+		params += "&attribute=" + item.value;
+	});
+	
+	$.ajax({
+		type : "GET",
+		url : "../api/trackedEntityInstances.json?ou="
+				+ getFieldValue("orgunitId"),
+		data : params,
+		dataType : "json",
+		success : function(json) {
+			setInnerHTML('listEntityInstanceDiv', displayTEIList(json, page));
+			showById('listEntityInstanceDiv');
+			jQuery('#loaderDiv').hide();
+			setTableStyles();
+		}
+	});
 }
 
 //-----------------------------------------------------------------------------
@@ -106,7 +115,7 @@
 	
 	if ( key==13 )// Enter
 	{
-		validateAdvancedSearch();
+		validateAdvancedSearch(1);
 	}
 }
 
@@ -134,29 +143,173 @@
 		{
 			showById('dataRecordingSelectDiv');
 			hideLoader();
-			hideById('contentDiv');
-			hideById('contentDiv');
+			hideById('listEntityInstanceDiv');
+			hideById('listEntityInstanceDiv');
 			hideById('mainLinkLbl');
 			setInnerHTML('singleProgramName',jQuery('#program option:selected').text());
 			loadProgramStages( entityInstanceId, programId );
 		});
 }
 
-function advancedSearch( params )
+function advancedSearch( params, page )
 {
 	$.ajax({
-		url: 'searchTrackedEntityInstance.action',
-		type:"POST",
-		data: params,
-		success: function( html ){
-				statusSearching = 1;
-				setInnerHTML( 'contentDiv', html );
-				showById('contentDiv');
-				setInnerHTML('searchInforTD', i18n_search_tracked_entity_instances );
-				setFieldValue('listAll',false);
-				jQuery( "#loaderDiv" ).hide();
+		type : "GET",
+		url : "../api/trackedEntityInstances.json",
+		data : params,
+		dataType : "json",
+		success : function(json) {
+			setInnerHTML('listEntityInstanceDiv', displayTEIList(json, page));
+			showById('listEntityInstanceDiv');
+			jQuery('#loaderDiv').hide();
+			setTableStyles();
+		}
+	});
+}
+
+function displayTEIList(json, page) {
+
+	// Header
+	var title = "";
+	
+	if (getFieldValue('programIdAddTrackedEntity') != "") {
+		var status = jQuery('#statusEnrollment option:selected').text();
+		var programName = jQuery('#programIdAddTrackedEntity option:selected')
+				.text();
+		title = i18n_for + " " + status + " " + i18n_enrollments_in + " "
+				+ programName + " " + i18n_program;
+		setInnerHTML('enrollmentInfor', title);
+	}
+	var table = "<p>" + i18n_the_following_tracked_entity_instances_found_in
+			+ " " + getFieldValue('orgunitName') + " " + title + "</p>";
+	if (json.metaData.pager.total > 0) {
+		table += "<p>" + i18n_total_result + " : " + json.metaData.pager.total
+				+ "</p>";
+	} else {
+		table += "<p>" + i18n_no_result_found + "</p>";
+	}
+	
+	// TEI list
+	table += "<table class='listTable' width='100%'>";
+	
+	var idx = 4;
+	if(getFieldValue('ouMode') != 'SELECTED'){
+		var idx = 3;
+	}	
+	else if(getFieldValue('program') != '') {
+		idx = 5;
+	}
+	table += "<col width='30' />";
+	for (var i = idx; i < json.width; i++) {
+		table += "<col />";
+	}
+	table += "<col width='200' />";
+	table += "<thead><tr><th>#</th>";
+	for (var i = idx; i < json.width; i++) {
+		table += "<th>" + json.headers[i].column + "</th>";
+	}
+	table += "<th>" + i18n_operations + "</th>";
+	table += "</tr></thead>";
+	
+	table += "<tbody id='list'>";
+	for ( var i in json.rows) {
+		var cols = json.rows[i];
+		var uid = cols[0];
+		var no = eval(json.metaData.pager.page);
+		no = (no - 1) * 50 + eval(i) + 1;
+		table += "<tr id='tr" + uid + "'>";
+		table += "<td>" + no + "</td>";
+		for (var j = idx; j < json.width; j++) {
+			var colVal = cols[j];
+			if (j == 4) {
+				colVal = json.metaData.names[colVal];
 			}
-		});
+			table += "<td onclick=\"javascript:isDashboard=true;showTrackedEntityInstanceDashboardForm( '"
+				+ uid
+				+ "' )\" title='"
+				+ i18n_dashboard
+				+ "'>" + colVal + "</td>";
+		}
+		
+		// Operations column
+		table += "<td>";
+		table += "<a href=\"javascript:isDashboard=true;showTrackedEntityInstanceDashboardForm( '"
+				+ uid
+				+ "' )\" title='"
+				+ i18n_dashboard
+				+ "'><img src='../images/enroll.png' alt='"
+				+ i18n_dashboard
+				+ "'></a>";
+		table += "<a href=\"javascript:isDashboard=false;showUpdateTrackedEntityInstanceForm( '"
+				+ uid
+				+ "' )\" title='"
+				+ i18n_data_entry
+				+ "'><img src= '../images/edit.png' alt='"
+				+ i18n_data_entry
+				+ "'></a>";
+		table += "<a href=\"javascript:setFieldValue( 'isShowEntityInstanceList', 'false' ); showRelationshipList('"
+				+ uid
+				+ "' )\" title='"
+				+ i18n_manage_relationship
+				+ "'><img src='../images/relationship.png' alt='"
+				+ i18n_manage_relationship + "'></a>";
+		if (canChangeLocation) {
+			table += "<a href=\"javascript:isDashboard=false;getTrackedEntityInstanceLocation( '"
+					+ uid
+					+ "' );\" title='"
+					+ i18n_change_location
+					+ "'><img src='../icons/dataentry.png' alt='"
+					+ i18n_change_location
+					+ "' style='width:25px; height:25px'></a>";
+		}
+		table += "<a href=\"javascript:removeTrackedEntityInstance( '" + uid
+				+ "', '', '" + i18n_confirm_delete_tracked_entity_instance
+				+ "' )\" title='" + i18n_remove
+				+ "'><img src='../images/delete.png' alt='" + i18n_remove
+				+ "'></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>";
+	}
+	table += "</tbody>";
+	table += "</table>";
+	
+	return table + paging(json, page);
+}
+
+// Paging
+
+function paging(json, page) {
+	var searchMethod = "listAllTrackedEntityInstance";
+	if( isAdvancedSearch ){
+		searchMethod = "validateAdvancedSearch";
+	}
+	
+	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.metaData.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:" + searchMethod + "( " + 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;
 }
 
 //--------------------------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js	2014-04-06 15:48:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js	2014-04-21 14:30:25 +0000
@@ -8,31 +8,32 @@
 	showById( "programLoader" );
 	disable('program');
 	hideById('addNewDiv');
-	organisationUnitSelected( orgUnits, orgUnitNames );
+	setFieldValue("orgunitName", orgUnitNames[0]);
+	setFieldValue("orgunitId", orgUnits[0]);
 	clearListById('program');
 	$.postJSON( 'singleEventPrograms.action', {}, function( json )
-		{
-			var count = 0;
-			for ( i in json.programs ) {
-				if( json.programs[i].type==2){
-					jQuery( '#program').append( '<option value="' + json.programs[i].id +'" programStageId="' + json.programs[i].programStageId + '" type="' + json.programs[i].type + '">' + json.programs[i].name + '</option>' );
-					count++;
-				}
-			}
-			
-			if(count==0){
-				jQuery( '#program').prepend( '<option value="" >' + i18n_none_program + '</option>' );
-			}
-			else if(count>1){
-				jQuery( '#program').prepend( '<option value="" selected>' + i18n_please_select + '</option>' );
-				enable('addEntityInstanceBtn');
-			}
-			
-			enableBtn();
-			hideById('programLoader');
-			jQuery('#program').width(width);
-			enable('program');
-		});
+	{
+		var count = 0;
+		for ( i in json.programs ) {
+			if( json.programs[i].type==2){
+				jQuery( '#program').append( '<option value="' + json.programs[i].id +'" programStageId="' + json.programs[i].programStageId + '" type="' + json.programs[i].type + '">' + json.programs[i].name + '</option>' );
+				count++;
+			}
+		}
+		
+		if(count==0){
+			jQuery( '#program').prepend( '<option value="" >' + i18n_none_program + '</option>' );
+		}
+		else{
+			jQuery( '#program').prepend( '<option value="" selected>' + i18n_please_select + '</option>' );
+			enable('addEntityInstanceBtn');
+		}
+		
+		enableBtn();
+		hideById('programLoader');
+		jQuery('#program').width(width);
+		enable('program');
+	});
 }
 selection.setListenerFunction( orgunitSelected );
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonSingleEventPrograms.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonSingleEventPrograms.vm	2014-03-20 10:17:37 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonSingleEventPrograms.vm	2014-04-21 14:30:25 +0000
@@ -3,7 +3,7 @@
 	"programs": [
 		#foreach( $program in $programs )
 		  {
-			"id":  ${program.id} ,
+			"id":  "${program.uid}",
 			"name": "$!encoder.jsonEncode( ${program.displayName} )",
 			"type": "$program.type",
 			#foreach( $programStage in $program.programStages )

=== 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-18 18:17:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchTrackedEntityInstanceCriteria.vm	2014-04-21 14:30:25 +0000
@@ -20,7 +20,7 @@
 		<td>$i18n.getString('program')</td>
 		<td>
 			<select id='program' name='program' onchange='enableBtn();'>
-				<option value="">[$i18n.getString( "view_all" )]</option>
+				<option value="" type=''>[$i18n.getString( "view_all" )]</option>
 				#foreach($program in $programs)
 					<option value="$program.uid" type='$program.type'>$program.displayName</option>
 				#end

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectTrackedEntityInstance.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectTrackedEntityInstance.vm	2014-04-17 16:00:32 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectTrackedEntityInstance.vm	2014-04-21 14:30:25 +0000
@@ -111,7 +111,6 @@
 	var i18n_please_choose_relationshipType_for_this_under_age_tracked_entity_instance = '$encoder.jsEscape( $i18n.getString( "please_choose_relationshipType_for_this_under_age_tracked_entity_instance" ) , "'")';
 	var i18n_color_quick_help = '$encoder.jsEscape( $i18n.getString( "color_quick_help" ) , "'")';
 	
-	
 	var i18n_for = '$encoder.jsEscape( $i18n.getString( "for" ) , "'")';
 	var i18n_enrollments_in = '$encoder.jsEscape( $i18n.getString( "enrollments_in" ) , "'")';
 	var i18n_program = '$encoder.jsEscape( $i18n.getString( "program" ) , "'")';

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm	2014-04-17 16:00:32 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm	2014-04-21 14:30:25 +0000
@@ -6,7 +6,6 @@
                 item.remove();
             }
         });
-		jQuery("#program [value=]").remove();
 	
 		if(jQuery("#program option").length==0)
 		{
@@ -15,12 +14,11 @@
 			disable('addEntityInstanceBtn');
 		}
 		else{
+			jQuery( '#program').prepend( '<option value="" type="" selected>' + i18n_please_select + '</option>' );
 			enable('listEntityInstanceBtn');
 			enable('addEntityInstanceBtn');
 		}
 		
-		showById('advancedSearchBtn');
-		disable('advancedSearchBtn');
 		hideById('removeEventLink');
 		setFieldValue('isSearchByProgram', true);
 		registration = false;
@@ -30,7 +28,7 @@
 	});
 </script>
 
-<h3>$i18n.getString( "single_event_with_registration_management" ) #openHelp('single_event_with_registration')</h3>
+<h3 id='mainLinkLbl'>$i18n.getString( "single_event_with_registration_management" ) #openHelp('single_event_with_registration')</h3>
 <h4 id='singleProgramName' name='singleProgramName'></h4>
 
 <input type='hidden' id='isRegistration' name= 'isRegistration' value='true'>
@@ -52,7 +50,7 @@
 
 #parse( "dhis-web-commons/loader/loader.vm" )
 
-<div id='contentDiv'></div>
+<div id='listEntityInstanceDiv'></div>
 <div id='addNewDiv'></div>
 <div id='dataRecordingSelectDiv'></div>
 <div id='dataEntryFormDiv'></div>
@@ -116,25 +114,21 @@
     var i18n_complete_success = '$encoder.jsEscape( $i18n.getString( "complete_success" ) , "'")';
 	var i18n_program_active_success = '$encoder.jsEscape( $i18n.getString( "program_active_success" ) , "'")';
 	var i18n_program_cancelled_success = '$encoder.jsEscape( $i18n.getString( "program_cancelled_success" ) , "'")';
-
     var i18n_complete_confirm_message = '$encoder.jsEscape( $i18n.getString( "complete_confirm_message" ) , "'")';
     var i18n_quit_confirm_message = '$encoder.jsEscape( $i18n.getString( "quit_confirm_message" ) , "'")';
     var i18n_date_is_greater_then_or_equals_due_date = '$encoder.jsEscape( $i18n.getString( "date_is_greater_then_or_equals_due_date" ) , "'")';
-	
 	var i18n_violate_validation = '$encoder.jsEscape( $i18n.getString( "violate_validation" ) , "'")';
 	var i18n_show_all_items = '$encoder.jsEscape( $i18n.getString( "show_all_items" ) , "'")';
-	
-    var i18n_error_required_field = '$encoder.jsEscape( $i18n.getString( "error_required_field" ) , "'")';
+	var i18n_error_required_field = '$encoder.jsEscape( $i18n.getString( "error_required_field" ) , "'")';
 	var i18n_program_stage = '$encoder.jsEscape( $i18n.getString( "program_stage" ) , "'")';
 	var i18n_create_new_event = '$encoder.jsEscape( $i18n.getString( "create_new_event" ) , "'")';
 	var i18n_events = '$encoder.jsEscape( $i18n.getString( "events" ) , "'")';
 	var i18n_specify_search_criteria = '$encoder.jsEscape( $i18n.getString( "specify_search_criteria" ) , "'")';
-	var i18n_please_select = '$encoder.jsEscape( $i18n.getString( "please_select" ) , "'")';
+	var i18n_please_select = '[' + '$encoder.jsEscape( $i18n.getString( "please_select" ) , "'")' + ']';
 	var i18n_search_result = '$encoder.jsEscape( $i18n.getString( "search_result" ) , "'")';
 	var i18n_show_data_entry = '$encoder.jsEscape( $i18n.getString( "show_data_entry" ) , "'")';
 	var i18n_color_quick_help = '$encoder.jsEscape( $i18n.getString( "color_quick_help" ) , "'")';
 	var i18n_add_person_successfully = '$encoder.jsEscape( $i18n.getString( "add_person_successfully" ) , "'")';
-	
 	var i18n_please_select_relationship_type = '$encoder.jsEscape( $i18n.getString( "please_select_relationship_type" ) , "'")';
 	var i18n_please_select_a_tracked_entity_instance_for_setting_relationship = '$encoder.jsEscape( $i18n.getString( "please_select_a_tracked_entity_instance_for_setting_relationship" ) , "'")';
 	var i18n_update_tracked_entity_instance = '$encoder.jsEscape( $i18n.getString( "update_tracked_entity_instance" ) , "'")';
@@ -149,6 +143,29 @@
 	var i18n_insert_a_report_date = '$encoder.jsEscape( $i18n.getString( "insert_a_report_date" ) , "'")';
 	var i18n_list_all_tracked_entity_instances = '$encoder.jsEscape( $i18n.getString( "list_all_tracked_entity_instances" ), "'")';
     var i18n_complete_program_confirm_message = '$encoder.jsEscape( $i18n.getString( "complete_program_confirm_message" ) , "'")';
+	var i18n_enrollments_in = '$encoder.jsEscape( $i18n.getString( "enrollments_in" ) , "'")';
+	var i18n_program = '$encoder.jsEscape( $i18n.getString( "program" ) , "'")';
+	var i18n_the_following_tracked_entity_instances_found_in = '$encoder.jsEscape( $i18n.getString( "the_following_tracked_entity_instances_found_in" ) , "'")';
+	var i18n_total_result = '$encoder.jsEscape( $i18n.getString( "total_result" ) , "'")';
+	var i18n_no_result_found = '$encoder.jsEscape( $i18n.getString( "no_result_found" ) , "'")';
+	var i18n_operations = '$encoder.jsEscape( $i18n.getString( "operations" ) , "'")';
+	var i18n_dashboard = '$encoder.jsEscape( $i18n.getString( "dashboard" ) , "'")';
+	var i18n_edit_profile = '$encoder.jsEscape( $i18n.getString( "edit_profile" ) , "'")';
+	var i18n_manage_relationship = '$encoder.jsEscape( $i18n.getString( "manage_relationship" ) , "'")';
+	var i18n_change_location = '$encoder.jsEscape( $i18n.getString( "change_location" ) , "'")';
+	var i18n_confirm_delete_tracked_entity_instance = '$encoder.jsEscape( $i18n.getString( "confirm_delete_tracked_entity_instance" ) , "'")';
+	var i18n_remove = '$encoder.jsEscape( $i18n.getString( "remove" ) , "'")';
+	var i18n_tracked_entity_instance_details_and_history = '$encoder.jsEscape( $i18n.getString( "tracked_entity_instance_details_and_history" ) , "'")';
+	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 i18n_complete_program_confirm_message = '$encoder.jsEscape( $i18n.getString( "complete_program_confirm_message" ) , "'")';
+	var i18n_for = '$encoder.jsEscape( $i18n.getString( "for" ) , "'")';
+	var i18n_data_entry = '$encoder.jsEscape( $i18n.getString( "data_entry" ) , "'")';
+
+	var canChangeLocation = $auth.hasAccess( "dhis-web-caseentry", "getTrackedEntityInstanceLocation" );
 	
 	datePickerValid( 'executionDateNewEvent', true );
 </script>