=== 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 2012-09-21 10:18:47 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java 2012-09-21 14:54:46 +0000 @@ -271,11 +271,23 @@ { this.patientAttributes = patientAttributes; } - - //Register patient on-the-fly - + + private String phoneNumber; + + public String getPhoneNumber() + { + return phoneNumber; + } + + public void setPhoneNumber( String phoneNumber ) + { + this.phoneNumber = phoneNumber; + } + + // Register patient on-the-fly + private Integer originalPatientId; - + public Integer getOriginalPatientId() { return originalPatientId; @@ -287,7 +299,7 @@ } private Integer relationshipTypeId; - + public Integer getRelationshipTypeId() { return relationshipTypeId; @@ -375,6 +387,15 @@ } } + if ( phoneNumber.matches( "^(\\+)?\\d+$" ) ) + { + patient.setPhoneNumber( phoneNumber ); + } + else + { + validationMap.put( "phoneNumber", "invalid_phone_number" ); + } + HttpServletRequest request = (HttpServletRequest) ActionContext.getContext().get( ServletActionContext.HTTP_REQUEST ); Map parameterMap = ContextUtils.getParameterMap( request ); @@ -490,6 +511,7 @@ this.previousValues.put( "gender", this.gender ); this.previousValues.put( "dob", this.dateOfBirth ); this.previousValues.put( "dobType", this.dobType ); + this.previousValues.put( "phoneNumber", this.phoneNumber ); return ERROR; } @@ -497,8 +519,9 @@ patient.setAttributes( patientAttributeSet ); patientId = patientService.createPatient( patient, null, null, patientAttributeValues ); validated = true; - - if (this.originalPatientId != null) { + + if ( this.originalPatientId != null ) + { return "redirect"; } return SUCCESS; === 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 2012-09-21 10:18:47 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties 2012-09-21 14:54:46 +0000 @@ -117,4 +117,5 @@ status=Status visit_schedule=Visit Schedule visit_schedule_type=Visit Schedule Type -or_register_new_person=or register new person \ No newline at end of file +or_register_new_person=or register new person +invalid_phone_number=invalid phone number \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/main.vm' --- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/main.vm 2011-12-06 22:23:13 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/main.vm 2012-09-21 14:54:46 +0000 @@ -11,7 +11,7 @@
=== 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 2012-09-21 10:18:47 +0000 +++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/registration/beneficiaryRegistrationForm.vm 2012-09-21 14:54:46 +0000 @@ -78,7 +78,15 @@ $i18n.getString($validationMap.get( "dob" )) #end - + + + + #if( $validationMap.get( "phoneNumber" ) ) +
$i18n.getString($validationMap.get( "phoneNumber" )) + #end + + + #foreach($patientIdentifierType in $patientIdentifierTypes) #if(! $patientIdentifierType.program) #set($key = "IDT${patientIdentifierType.id}")