=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityFormService.java' --- dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityFormService.java 2014-06-17 12:21:26 +0000 +++ dhis-2/dhis-services/dhis-service-tracker/src/main/java/org/hisp/dhis/trackedentity/DefaultTrackedEntityFormService.java 2014-06-19 13:44:22 +0000 @@ -294,9 +294,18 @@ { inputHtml += ",number:true"; } + else if ( TrackedEntityAttribute.TYPE_PHONE_NUMBER.equals( attribute.getValueType() ) ) + { + inputHtml += ",phone:true"; + } inputHtml += "}}\" "; - if ( attribute.getValueType().equals( TrackedEntityAttribute.TYPE_TRUE_ONLY ) ) + + if ( attribute.getValueType().equals( TrackedEntityAttribute.TYPE_PHONE_NUMBER ) ) + { + inputHtml += " phoneNumber "; + } + else if ( attribute.getValueType().equals( TrackedEntityAttribute.TYPE_TRUE_ONLY ) ) { inputHtml += " type='checkbox' value='true' "; if ( value.equals( "true" ) ) === 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-06-18 13:30:41 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2014-06-19 13:44:22 +0000 @@ -224,20 +224,25 @@ // Get Params form Div // ---------------------------------------------------------------- +var phoneNumberAreaCode = ""; function getParamsForDiv(entityInstanceDiv) { var params = ''; var dateOperator = ''; $("#" + entityInstanceDiv + " :input").each(function() { - var elementId = $(this).attr('id'); - if ($(this).attr('type') == 'checkbox') { - var checked = jQuery(this).attr('checked') ? true : false; + var item = jQuery(this); + var elementId = item.attr('id'); + if (item.attr('type') == 'checkbox') { + var checked = item.attr('checked') ? true : false; params += elementId + "=" + checked + "&"; } else if (elementId == 'dateOperator') { - dateOperator = jQuery(this).val(); + dateOperator = item.val(); } else if ($(this).attr('type') != 'button') { var value = ""; - if (jQuery(this).val() != null && jQuery(this).val() != '') { - value = htmlEncode(jQuery(this).val()); + if (item.val() != null && item.val() != '') { + if( (item.attr('phoneNumber')==undefined) + || ( item.attr('phoneNumber')!=undefined && item.val()!= phoneNumberAreaCode) ){ + value = htmlEncode(item.val()); + } } if (dateOperator != '') { value = dateOperator + "'" + value + "'"; === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceForm.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceForm.vm 2014-06-17 12:21:26 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/trackedEntityInstanceForm.vm 2014-06-19 13:44:22 +0000 @@ -41,66 +41,66 @@ #if( $attributesByGroup && $attributesByGroup.size() > 0 )   $attributeGroup.displayName - #foreach($attribute in $attributesByGroup ) - #if( $attribute ) - #set($value = "") - #set($value = $attributeValueMap.get($attribute.id)) - #set($mandatory = $mandatoryMap.get($attribute.id)) - #set($allowDateInFuture = $allowDateInFutureMap.get($attribute.id)) - #if( $mandatory ) #else #set($mandatory=false) #end - - - - #if( $attribute.valueType == "bool" ) - - #elseif( $attribute.valueType == "trueOnly" ) - - #elseif( $attribute.valueType == "date" ) - - - #elseif( $attribute.valueType == "optionSet" ) - - #elseif( $attribute.valueType == "users" ) - - #elseif( $attribute.valueType == "phoneNumber" ) - #if($value=='') - #set($value=$!phoneNumberAreaCode) - #end - - #elseif( $attribute.valueType == "trackerAssociate" ) - - #elseif( $attribute.valueType == "age" || $attribute.valueType == "number" ) - - #elseif( $attribute.valueType == "age" || $attribute.valueType == "number" ) - - #else - - #end - - - #end + #foreach($attribute in $attributesByGroup ) + #if( $attribute ) + #set($value = "") + #set($value = $attributeValueMap.get($attribute.id)) + #set($mandatory = $mandatoryMap.get($attribute.id)) + #set($allowDateInFuture = $allowDateInFutureMap.get($attribute.id)) + #if( $mandatory ) #else #set($mandatory=false) #end + + + + #if( $attribute.valueType == "bool" ) + + #elseif( $attribute.valueType == "trueOnly" ) + + #elseif( $attribute.valueType == "date" ) + + + #elseif( $attribute.valueType == "optionSet" ) + + #elseif( $attribute.valueType == "users" ) + + #elseif( $attribute.valueType == "phoneNumber" ) + #if($value=='') + #set($value=$!phoneNumberAreaCode) + #end + + #elseif( $attribute.valueType == "trackerAssociate" ) + + #elseif( $attribute.valueType == "age" || $attribute.valueType == "number" ) + + #elseif( $attribute.valueType == "age" || $attribute.valueType == "number" ) + + #else + + #end + + + #end #end #end #end @@ -153,7 +153,7 @@ #if($attributeValue=='') #set($attributeValue=$!phoneNumberAreaCode) #end - + #elseif( $attribute.valueType == "trackerAssociate" )