dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21649
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10300: [mobile] load area code in the phone number input field
------------------------------------------------------------
revno: 10300
committer: Long <Long@Long-Laptop>
branch nick: dhis2
timestamp: Tue 2013-03-19 11:35:21 +0700
message:
[mobile] load area code in the phone number input field
modified:
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/resources/META-INF/dhis/beans.xml
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/RegisterBeneficiaryAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/RegisterBeneficiaryAction.java 2012-09-21 10:18:47 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/RegisterBeneficiaryAction.java 2013-03-19 04:35:21 +0000
@@ -35,6 +35,7 @@
import org.hisp.dhis.patient.PatientIdentifierTypeService;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramService;
+import org.hisp.dhis.setting.SystemSettingManager;
import com.opensymphony.xwork2.Action;
@@ -58,7 +59,7 @@
{
this.patientAttributeService = patientAttributeService;
}
-
+
private ProgramService programService;
public ProgramService getProgramService()
@@ -71,6 +72,18 @@
this.programService = programService;
}
+ private SystemSettingManager systemSettingManager;
+
+ public SystemSettingManager getSystemSettingManager()
+ {
+ return systemSettingManager;
+ }
+
+ public void setSystemSettingManager( SystemSettingManager systemSettingManager )
+ {
+ this.systemSettingManager = systemSettingManager;
+ }
+
// -------------------------------------------------------------------------
// Input & Output
// -------------------------------------------------------------------------
@@ -110,11 +123,11 @@
{
this.patientAttributes = patientAttributes;
}
-
- //Register person on-the-fly
-
+
+ // Register person on-the-fly
+
private Integer originalPatientId;
-
+
public Integer getOriginalPatientId()
{
return originalPatientId;
@@ -126,7 +139,7 @@
}
private Integer relationshipTypeId;
-
+
public Integer getRelationshipTypeId()
{
return relationshipTypeId;
@@ -137,6 +150,18 @@
this.relationshipTypeId = relationshipTypeId;
}
+ private String phoneNumberAreaCode;
+
+ public String getPhoneNumberAreaCode()
+ {
+ return phoneNumberAreaCode;
+ }
+
+ public void setPhoneNumberAreaCode( String phoneNumberAreaCode )
+ {
+ this.phoneNumberAreaCode = phoneNumberAreaCode;
+ }
+
// -------------------------------------------------------------------------
// Action Implementation
// -------------------------------------------------------------------------
@@ -147,6 +172,10 @@
{
patientIdentifierTypes = patientIdentifierTypeService.getAllPatientIdentifierTypes();
patientAttributes = patientAttributeService.getAllPatientAttributes();
+ phoneNumberAreaCode = (String) systemSettingManager
+ .getSystemSetting( SystemSettingManager.KEY_PHONE_NUMBER_AREA_CODE );
+ if ( phoneNumberAreaCode == null )
+ phoneNumberAreaCode = "";
Collection<Program> programs = programService.getAllPrograms();
for ( Program program : programs )
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2013-03-18 08:17:23 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2013-03-19 04:35:21 +0000
@@ -318,6 +318,7 @@
<property name="patientAttributeService"
ref="org.hisp.dhis.patient.PatientAttributeService" />
<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
+ <property name="systemSettingManager" ref="org.hisp.dhis.setting.SystemSettingManager" />
</bean>
<bean
=== 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-27 06:54:00 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/registration/beneficiaryRegistrationForm.vm 2013-03-19 04:35:21 +0000
@@ -84,7 +84,15 @@
#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")" />
+
+
+ #if ($previousValues.get("phoneNumber"))
+ #set($phoneValue = $previousValues.get("phoneNumber"))
+ #else
+ #set($phoneValue = $phoneNumberAreaCode)
+ #end
+
+ <input type="text" name="phoneNumber" value="$phoneValue" />
#foreach($patientIdentifierType in $patientIdentifierTypes)