=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/RegisterBeneficiaryAction.java' --- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/RegisterBeneficiaryAction.java 2014-03-18 08:10:10 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/RegisterBeneficiaryAction.java 2014-03-26 07:41:18 +0000 @@ -33,6 +33,7 @@ import org.hisp.dhis.program.Program; import org.hisp.dhis.program.ProgramService; import org.hisp.dhis.setting.SystemSettingManager; +import org.hisp.dhis.trackedentity.TrackedEntity; import org.hisp.dhis.trackedentity.TrackedEntityAttribute; import org.hisp.dhis.trackedentity.TrackedEntityAttributeService; @@ -142,15 +143,28 @@ this.phoneNumberAreaCode = phoneNumberAreaCode; } + private Collection trackedEntities; + // ------------------------------------------------------------------------- // Action Implementation // ------------------------------------------------------------------------- + public Collection getTrackedEntities() + { + return trackedEntities; + } + + public void setTrackedEntities( Collection trackedEntities ) + { + this.trackedEntities = trackedEntities; + } + @Override public String execute() throws Exception { patientAttributes = patientAttributeService.getAllTrackedEntityAttributes(); + phoneNumberAreaCode = (String) systemSettingManager .getSystemSetting( SystemSettingManager.KEY_PHONE_NUMBER_AREA_CODE ); if ( phoneNumberAreaCode == null ) === modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java' --- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java 2014-03-20 07:14:38 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java 2014-03-26 07:41:18 +0000 @@ -287,15 +287,6 @@ patient.setOrganisationUnit( organisationUnitService.getOrganisationUnit( orgUnitId ) ); - if ( this.patientFullName.trim().length() < 7 ) - { - validationMap.put( "fullName", "is_invalid_name_length" ); - } - else - { - patient.setName( patientFullName.trim() ); - } - HttpServletRequest request = (HttpServletRequest) ActionContext.getContext().get( StrutsStatics.HTTP_REQUEST ); Map parameterMap = ContextUtils.getParameterMap( request ); @@ -312,16 +303,17 @@ patientAttributeSet.add( patientAttribute ); String key = "AT" + patientAttribute.getId(); + String value = parameterMap.get( key ).trim(); if ( value != null ) { - /* if ( patientAttribute.isMandatory() && value.trim().equals( "" ) ) - { - this.validationMap.put( key, "is_mandatory" ); - } - else */ - if ( value.trim().length() > 0 + /* + * if ( patientAttribute.isMandatory() && value.trim().equals( + * "" ) ) { this.validationMap.put( key, "is_mandatory" ); } + * else + */ + if ( value.trim().length() > 0 && patientAttribute.getValueType().equals( TrackedEntityAttribute.TYPE_INT ) && !MathUtils.isInteger( value ) ) { === modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties 2014-01-22 04:25:46 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties 2014-03-26 07:41:18 +0000 @@ -133,4 +133,5 @@ last_recipients=Last recipients search_orgunit=Search Organisation Unit date_of_birth_hint=*Approximated: enter age. Declared or Verified: enter date in format [yyyy-mm-dd] -select_attribute=Select attribute \ No newline at end of file +select_attribute=Select attribute +tracked_entity=Tracked entity \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/registration/beneficiaryRegistrationForm.vm' --- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/registration/beneficiaryRegistrationForm.vm 2014-01-23 14:18:27 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/registration/beneficiaryRegistrationForm.vm 2014-03-26 07:41:18 +0000 @@ -21,14 +21,7 @@

- - - #if( $validationMap.get( "fullName" ) ) -
$i18n.getString($validationMap.get( "fullName" )) - #end - - - + #foreach($patientAttribute in $patientAttributes) #if(! $patientAttribute.program) #set($key = "AT${patientAttribute.id}") @@ -37,15 +30,11 @@
$i18n.getString($validationMap.get( $key )) #end #if($patientAttribute.getValueType() == "combo") - + #elseif( $patientAttribute.getValueType() == "bool" )