← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2017: Fix bug: Cannot input unicode character when adding a patient.

 

------------------------------------------------------------
revno: 2017
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2010-11-09 14:42:19 +0700
message:
  Fix bug: Cannot input unicode character when adding a patient.
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/i18n/i18n.vm
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.validate.ext.js
  dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientForm.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-commons-resources/src/main/webapp/dhis-web-commons/i18n/i18n.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/i18n/i18n.vm	2010-10-21 11:06:26 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/i18n/i18n.vm	2010-11-09 07:42:19 +0000
@@ -140,6 +140,7 @@
         ,notOnlyDigits: '$encoder.jsEscape($i18n.getString('only_digits_are_not_allowed' ) , "'")'
 		,custome_regex: validatorFormat("{1}")
 		,greaterDate: '$encoder.jsEscape($i18n.getString('closedDate_should_be_greater_than_openDate' ) , "'")'
+		,unicodechars: '$encoder.jsEscape($i18n.getString('please_unicode_chars_only' ) , "'")'
 };
 var i18n_process = '$encoder.jsEscape( $i18n.getString( "process" ) , "'" )';
 var i18n_delete_success = '$encoder.jsEscape( $i18n.getString( "delete_success" ) , "'" )';

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.validate.ext.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.validate.ext.js	2010-10-04 10:59:24 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.validate.ext.js	2010-11-09 07:42:19 +0000
@@ -140,6 +140,20 @@
         || /^[\w-.,()\/%'\"\s]+$/i.test(value);
     },
     "Please Letters, numbers, spaces or some special chars like .,-,%,(,) only ");
+	
+	jQuery.validator
+    .addMethod("letterswithbasicspecialchars", function(value, element) {
+        return this.optional(element)
+        || /^[\w-.,()\/%'\"\s]+$/i.test(value);
+    },
+    "Please Letters, numbers, spaces or some special chars like .,-,%,(,) only ");
+
+jQuery.validator
+    .addMethod("unicodechars", function(value, element) {
+        return this.optional(element)
+        || /^([a-zA-Z_\u00A1-\uFFFF ])*$/i.test(value);
+    },
+    "Please unicode chars like .,-,%,(,) only ");
 
  jQuery.validator.addMethod("greaterDate",function(value, element, params) {
         

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties	2010-11-09 02:09:53 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties	2010-11-09 07:42:19 +0000
@@ -342,6 +342,7 @@
 password_must_contain_at_least_one_capital_letter_and_one_digit	=	Password must contain at least one capital letter and one digit
 only_digits_are_not_allowed = Only digits are not allowed
 closedDate_should_be_greater_than_openDate = ClosedDate should be greater than OpenDate
+please_unicode_chars_only = Please unicode chars only.
 
 please_enter_name	        = Please enter name!
 please_select_period        = Please select period!

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm	2010-10-28 09:17:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm	2010-11-09 07:42:19 +0000
@@ -59,16 +59,16 @@
 		<th colspan="2" class="heading-column">$i18n.getString( "name" )<em title="$i18n.getString( "required" )" class="required">*</em></th>
 	</tr>
 	<tr>
-		<td><label for="firstName">$i18n.getString( "first_name" )<em title="$i18n.getString( "required" )" class="required">*</em></label></td>
-		<td class="input-column" ><input type="text" id="firstName" name="firstName"  maxlength="30" class="required_group {validate:{required_group:true,rangelength:[2,30], letterswithbasicpunc: true}}" ></td>
+		<td><label for="firstName">$i18n.getString( "first_name" )</label></td>
+		<td class="input-column" ><input type="text" id="firstName" name="firstName"  maxlength="30" class="required_group {validate:{required_group:true, unicodechars:true, rangelength:[2,30]}}" ></td>
 	</tr>
 	<tr>
 		<td><label for="middleName">$i18n.getString( "middle_name" ) </label></td>
-		<td class="input-column"> <input type="text" id="middleName" name="middleName" maxlength="30" class="{validate:{required:false, letterswithbasicpunc: true}}"></td>
+		<td class="input-column"> <input type="text" id="middleName" name="middleName" maxlength="30" class="required_group {validate:{required_group:true, unicodechars:true, rangelength:[2,30]}}"></td>
 	</tr>
 	<tr>
 		<td><label for="lastName">$i18n.getString( "last_name" )</label></td>
-		<td class="input-column"><input type="text" id="lastName" name="lastName" maxlength="30" class="{validate:{required:false, letterswithbasicpunc: true}}"></td>
+		<td class="input-column"><input type="text" id="lastName" name="lastName" maxlength="30" class="required_group {validate:{required_group:true, unicodechars:true, rangelength:[2,30]}}"></td>
 	</tr>	
 	<tr><td>&nbsp;</td></tr>	
 	<tr>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientForm.vm	2010-11-08 07:55:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientForm.vm	2010-11-09 07:42:19 +0000
@@ -35,16 +35,16 @@
 		<th colspan="2">$i18n.getString( "name" ) <em title="$i18n.getString( "required" )" class="required">*</em></th>
 	</tr>
 	<tr>
-		<td><label for="firstName">$i18n.getString( "first_name" )<em title="$i18n.getString( "required" )" class="required">*</em></label></td>
-		<td><input type="text" id="firstName" name="firstName" value="$encoder.htmlEncode( $patient.firstName )" style="width:30em" class="required_group {validate:{required_group:true,rangelength:[2,30], letterswithbasicpunc: true}}"></td>
+		<td><label for="firstName">$i18n.getString( "first_name" )</label></td>
+		<td><input type="text" id="firstName" name="firstName" value="$encoder.htmlEncode( $patient.firstName )" style="width:30em" class="required_group {validate:{required_group:true, unicodechars:true, rangelength:[2,30]}}"></td>
 	</tr>
 	<tr>
 		<td><label for="middleName">$i18n.getString( "middle_name" )</label></td>
-		<td><input type="text" id="middleName" name="middleName" value="$encoder.htmlEncode( $patient.middleName )" style="width:30em" class="{validate:{required:false, letterswithbasicpunc: true}}"></td>
+		<td><input type="text" id="middleName" name="middleName" value="$encoder.htmlEncode( $patient.middleName )" style="width:30em" class="required_group {validate:{required_group:true, unicodechars:true, rangelength:[2,30]}}"></td>
 	</tr>
 	<tr>
 		<td><label for="lastName">$i18n.getString( "last_name" )</label></td>
-		<td><input type="text" id="lastName" name="lastName" value="$encoder.htmlEncode( $patient.lastName )" style="width:30em" class="{validate:{required:false, letterswithbasicpunc: true}}"></td>
+		<td><input type="text" id="lastName" name="lastName" value="$encoder.htmlEncode( $patient.lastName )" style="width:30em" class="required_group {validate:{required_group:true, unicodechars:true, rangelength:[2,30]}}"></td>
 	</tr>
 	<tr><td>&nbsp;</td></tr>	
 	<tr>