=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentAction.java 2014-04-06 15:48:31 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/ProgramEnrollmentAction.java 2014-04-06 15:57:21 +0000 @@ -45,6 +45,7 @@ import org.hisp.dhis.program.ProgramInstance; import org.hisp.dhis.program.ProgramInstanceService; import org.hisp.dhis.program.ProgramStageInstance; +import org.hisp.dhis.program.ProgramTrackedEntityAttribute; import org.hisp.dhis.program.comparator.ProgramStageInstanceVisitDateComparator; import org.hisp.dhis.trackedentity.TrackedEntityAttribute; import org.hisp.dhis.trackedentity.TrackedEntityAttributeGroup; @@ -86,7 +87,7 @@ private Boolean hasDataEntry; - private List attributes; + private List attributes; private ProgramInstance programInstance; @@ -144,7 +145,7 @@ return hasDataEntry; } - public List getAttributes() + public List getAttributes() { return attributes; } @@ -190,7 +191,7 @@ // Load attributes of the selected program // --------------------------------------------------------------------- - attributes = new ArrayList( programInstance.getProgram().getTrackedEntityAttributes() ); + attributes = new ArrayList( programInstance.getProgram().getAttributes() ); if ( attributes != null ) { @@ -199,8 +200,7 @@ for ( TrackedEntityAttributeValue attributeValue : attributeValues ) { - if ( attributes.contains( attributeValue.getAttribute() ) ) - { + String value = attributeValue.getValue(); if ( attributeValue.getAttribute().getValueType().equals( TrackedEntityAttribute.TYPE_AGE ) ) { @@ -209,7 +209,6 @@ } attributeValueMap.put( attributeValue.getAttribute().getId(), value ); - } } } } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm 2014-03-19 06:44:30 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm 2014-04-06 15:57:21 +0000 @@ -58,11 +58,12 @@ #set( $mark = false ) - #foreach($attribute in $attributes ) + #foreach($programAttribute in $attributes ) #set( $attributeValue = '') + #set($attribute = $programAttribute.attribute) #set( $attributeValue = $!attributeValueMap.get( $attribute.id ) ) - #set($mandatory = $attribute.mandatory ) + #set($mandatory = $programAttribute.mandatory )
#if( $attribute.valueType == "bool" )