dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19081
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8185: [mobile] remove logo hyperlink, add phone number field
------------------------------------------------------------
revno: 8185
committer: Long <Long@Long-Laptop>
branch nick: dhis2
timestamp: Fri 2012-09-21 21:54:46 +0700
message:
[mobile] remove logo hyperlink, add phone number field
modified:
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/resources/org/hisp/dhis/light/i18n_module.properties
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/registration/beneficiaryRegistrationForm.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== 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<String, String> 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 @@
<div id="wrap">
<div id="header">
- <a href="index.action" tabindex="-1"><img src="../dhis-web-commons/security/logo_mobile.jpg" alt="DHIS2" width="47" height="20"></a>
+ <img src="../dhis-web-commons/security/logo_mobile.jpg" alt="DHIS2" width="47" height="20">
</div>
<div id="content" align="center" style="text-align: left;">
=== 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 @@
<span style="color: #990000;"> $i18n.getString($validationMap.get( "dob" ))</span>
#end
<input type="text" name="dateOfBirth" value="$!previousValues.get("dob")" />
-
+
+ <label>$i18n.getString( "phone_number" )</label>
+
+ #if( $validationMap.get( "phoneNumber" ) )
+ <br /><span style="color: #990000;"> $i18n.getString($validationMap.get( "phoneNumber" ))</span>
+ #end
+ <input type="text" name="phoneNumber" value="$!previousValues.get("phoneNumber")" />
+
+
#foreach($patientIdentifierType in $patientIdentifierTypes)
#if(! $patientIdentifierType.program)
#set($key = "IDT${patientIdentifierType.id}")