← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9878: Add prefix of phonenumber into custom registration form.

 

------------------------------------------------------------
revno: 9878
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-02-22 20:10:44 +0700
message:
  Add prefix of phonenumber into custom registration form.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.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-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2013-02-18 08:23:36 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm	2013-02-22 13:10:44 +0000
@@ -63,7 +63,7 @@
 	<tr>
 		<td class='text-column'><label for="phoneNumber">$i18n.getString( "phone_number" )</label></td>
 		<td class="input-column">
-			<input type="text" id="phoneNumber" name="phoneNumber" #if( $!patient.phoneNumber ) value="$!patient.phoneNumber" #else value="$!phoneNumberAreaCode" #end class="{validate:{phone:true}}"/>
+			<input type="text" id="phoneNumber" name="phoneNumber" class="{validate:{phone:true}}"/>
 		</td>
 	</tr>
 
@@ -251,4 +251,10 @@
 		hideById('age');
 		showById('birthDate');
 	#end
+	
+	#if( $!patient.phoneNumber ) 
+		setFieldValue('phoneNumber',"$!patient.phoneNumber")
+	#else 
+		setFieldValue('phoneNumber',"$!phoneNumberAreaCode")
+	#end
 </script>
\ No newline at end of file