← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15153: Remove the timestamp of data attribute values in TEI list of Find/Add TEI, Visit schedule, Lost t...

 

------------------------------------------------------------
revno: 15153
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-05-05 23:31:54 +0800
message:
  Remove the timestamp of data attribute values in TEI list of Find/Add TEI, Visit schedule, Lost to follow up
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.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/javascript/trackedEntityInstance.js


--
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/activityPlan.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js	2014-04-24 16:30:48 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js	2014-05-05 15:31:54 +0000
@@ -87,6 +87,7 @@
 	// Yes/No and Yes Only attributes in result
 	
 	var attList = new Array();
+	var attDate = new Array();
 	$('#attributeIds option').each(function(i, item) {
 		var valueType = $(item).attr('valueType');
 		var value = $(item).val();
@@ -97,6 +98,13 @@
 				}
 			}
 		}
+		else if ( valueType == 'date' ) {
+			for (var i = idx; i < json.width; i++) {
+				if( value==json.headers[i].name ){
+					attDate.push(i);
+				}
+			}
+		}
 	});
 	
 	// TEI list
@@ -107,7 +115,6 @@
 		table += "<col />";
 	}	
 	
-	
 	table += "<col width='200' />";
 	table += "<thead><tr><th>#</th>";
 	for (var i = idx; i < json.width; i++) {
@@ -129,9 +136,14 @@
 			if (j == 4) {
 				colVal = json.metaData.names[colVal];
 			}
+			
 			if( jQuery.inArray( j, attList )>=0 && colVal!="" ){
 				colVal = (colVal=='true')? i18n_yes : i18n_no;
 			}
+			else if( jQuery.inArray( j, attDate )>=0 && colVal!="" ){
+				colVal = colVal.split(' ')[0];
+			}
+			
 			table += "<td onclick=\"javascript:isDashboard=true;showTrackedEntityInstanceDashboardForm( '"
 				+ uid
 				+ "' )\" title='"

=== 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-30 12:57:22 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.js	2014-05-05 15:31:54 +0000
@@ -193,7 +193,8 @@
 	if (json.metaData.pager.total > 0) {
 		table += "<p>" + i18n_total_result + " : " + json.metaData.pager.total
 				+ "</p>";
-	} else {
+	}
+	else {
 		table += "<p>" + i18n_no_result_found + "</p>";
 	}
 	
@@ -211,13 +212,21 @@
 	// Yes/No and Yes Only attributes in result
 	
 	var attList = new Array();
+	var attDate = new Array();
 	$('#attributeIds option').each(function(i, item) {
 		var valueType = $(item).attr('valueType');
 		var value = $(item).val();
 		if ( valueType == 'bool' || valueType == 'trueOnly' ) {
+			for ( var i = idx; i < json.width; i++ ) {
+				if( value==json.headers[i].name ){
+					attList.push(i);
+				}
+			}
+		}
+		else if ( valueType == 'date' ) {
 			for (var i = idx; i < json.width; i++) {
 				if( value==json.headers[i].name ){
-					attList.push(i);
+					attDate.push(i);
 				}
 			}
 		}
@@ -254,6 +263,9 @@
 			if( jQuery.inArray( j, attList )>=0 && colVal!="" ){
 				colVal = (colVal=='true')? i18n_yes : i18n_no;
 			}
+			else if( jQuery.inArray( j, attDate )>=0 && colVal!="" ){
+				colVal = colVal.split(' ')[0];
+			}
 			
 			table += "<td onclick=\"javascript:isDashboard=true;showUpdateEventForm( '"
 				+ uid

=== 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-24 16:30:48 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js	2014-05-05 15:31:54 +0000
@@ -108,7 +108,6 @@
 		table += "<p>" + i18n_no_result_found + "</p>";
 	}
 	
-	
 	table += "<table class='listTable' width='100%'>";
 	
 	var idx = 4;
@@ -122,6 +121,7 @@
 	// Yes/No and Yes Only attributes in result
 	
 	var attList = new Array();
+	var attDate = new Array();
 	$('#attributeIds option').each(function(i, item) {
 		var valueType = $(item).attr('valueType');
 		var value = $(item).val();
@@ -132,6 +132,13 @@
 				}
 			}
 		}
+		else if ( valueType == 'date' ) {
+			for (var i = idx; i < json.width; i++) {
+				if( value==json.headers[i].name ){
+					attDate.push(i);
+				}
+			}
+		}
 	});
 	
 	// TEI list
@@ -165,6 +172,9 @@
 			if( jQuery.inArray( j, attList )>=0 && colVal!="" ){
 				colVal = (colVal=='true')? i18n_yes : i18n_no;
 			}
+			else if( jQuery.inArray( j, attDate )>=0 && colVal!="" ){
+				colVal = colVal.split(' ')[0];
+			}
 			
 			table += "<td onclick=\"javascript:isDashboard=true;showTrackedEntityInstanceDashboardForm( '"
 				+ uid

=== 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-04-24 16:30:48 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/trackedEntityInstance.js	2014-05-05 15:31:54 +0000
@@ -254,9 +254,6 @@
 
 function displayTEIList(json, page) {
 
-	
-	
-	
 	// Header
 	var title = "";
 	
@@ -291,6 +288,7 @@
 	// Yes/No and Yes Only attributes in result
 	
 	var attList = new Array();
+	var attDate = new Array();
 	$('#attributeIds option').each(function(i, item) {
 		var valueType = $(item).attr('valueType');
 		var value = $(item).val();
@@ -299,10 +297,20 @@
 				if( value==json.headers[i].name ){
 					attList.push(i);
 				}
+				else if( valueType=='date'){
+					attDate.push(i);
+				}
+			}
+		}
+		else if ( valueType == 'date' ) {
+			for (var i = idx; i < json.width; i++) {
+				if( value==json.headers[i].name ){
+					attDate.push(i);
+				}
 			}
 		}
 	});
-	
+
 	// TEI List
 	
 	table += "<col width='30' />";
@@ -330,9 +338,13 @@
 			if (j == 4) {
 				colVal = json.metaData.names[colVal];
 			}
+			
 			if( jQuery.inArray( j, attList )>=0 && colVal!="" ){
 				colVal = (colVal=='true')? i18n_yes : i18n_no;
 			}
+			else if( jQuery.inArray( j, attDate )>=0 && colVal!="" ){
+				colVal = colVal.split(' ')[0];
+			}
 			
 			table += "<td onclick=\"javascript:isDashboard=true;showTrackedEntityInstanceDashboardForm( '"
 				+ uid