=== 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 += ""; } - table += ""; table += "#"; 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 += " 0) { table += "

" + i18n_total_result + " : " + json.metaData.pager.total + "

"; - } else { + } + else { table += "

" + i18n_no_result_found + "

"; } @@ -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 += ""; } - table += ""; 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 += "
=0 && colVal!="" ){ colVal = (colVal=='true')? i18n_yes : i18n_no; } + else if( jQuery.inArray( j, attDate )>=0 && colVal!="" ){ + colVal = colVal.split(' ')[0]; + } table += "