← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2650: Fix bug: Not be allowed to enter special characters for program code.

 

------------------------------------------------------------
revno: 2650
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-01-20 09:57:30 +0700
message:
  Fix bug: Not be allowed to enter special characters for program code.
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/resources/org/hisp/dhis/patient/i18n_module.properties
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.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-12-21 02:55:33 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/i18n/i18n.vm	2011-01-20 02:57:30 +0000
@@ -105,6 +105,7 @@
 		,dateISO: '$encoder.jsEscape($i18n.getString( 'please_enter_a_valid_date_iso' ) , "'")'
 		,number: '$encoder.jsEscape($i18n.getString( 'please_enter_a_valid_number' ) , "'")'
 		,digits: '$encoder.jsEscape($i18n.getString( 'please_enter_a_valid_digits' ) , "'")'
+		,lettersdigitsonly: '$encoder.jsEscape($i18n.getString( 'please_enter_a_letters_or_digits' ) , "'")'
 		,equalTo: '$encoder.jsEscape($i18n.getString( 'please_enter_the_equal_values_again' ) , "'")'
 		,accept: '$encoder.jsEscape($i18n.getString( 'please_enter_a_value_with_a_valid_expression' ) , "'")'
 		,firstletteralphabet: '$encoder.jsEscape($i18n.getString( 'first_character_must_be_alphabetical' ) , "'")'

=== 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-11-09 07:42:19 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.validate.ext.js	2011-01-20 02:57:30 +0000
@@ -170,6 +170,10 @@
     return this.optional(element) || /^[\w\s]+$/i.test(value);
 }, "Letters, numbers, spaces or underscores only please");
 
+jQuery.validator.addMethod("lettersdigitsonly", function(value, element) {
+    return this.optional(element) || /^[a-z\d]+$/i.test(value);
+}, "Letters and digits only please");
+
 jQuery.validator.addMethod("lettersonly", function(value, element) {
     return this.optional(element) || /^[a-z]+$/i.test(value);
 }, "Letters only please");

=== 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	2011-01-19 11:38:59 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/i18n_global.properties	2011-01-20 02:57:30 +0000
@@ -351,6 +351,7 @@
 closedDate_should_be_greater_than_openDate = ClosedDate should be greater than OpenDate
 please_unicode_chars_only = Please unicode chars only.
 unrecognized_coordinate_string = Unrecognized coordinate string
+please_enter_a_letters_or_digits = Please enter letters or digits
 
 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/resources/org/hisp/dhis/patient/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2011-01-20 02:12:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties	2011-01-20 02:57:30 +0000
@@ -465,3 +465,5 @@
 death_date = Death date
 is_dead = isDead
 search_result = Search result
+no_max_days_alowed_input_data = Maximum number of days allowed to input data
+no_min_days_alowed_input_data = Minimum number of days allowed to input data

=== 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	2011-01-20 02:12:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm	2011-01-20 02:57:30 +0000
@@ -164,7 +164,7 @@
 				<table>
 					<tr valign="top">
 						<td><input type="text" id="orgunitcode" name="orgunitcode" disabled="disabled" value="$organisationUnit.code" maxlength="9" size="10"/> <br/> <div class='stateformat'>$i18n.getString('registering_unit')<br>$i18n.getString('code')</div></td>
-						<td> - <input type="text" id="progcode" name="progcode" maxlength="1" size="6" class='idfield  #validate( "default"  $identifierType.mandatory ) ' /> <br/> <div class='stateformat'>$i18n.getString('program')<br>$i18n.getString('code')</div></td>
+						<td> - <input type="text" id="progcode" name="progcode" maxlength="1" size="6" class='idfield  {validate:{required:$identifierType.mandatory,minlength:1,lettersdigitsonly:true}}' /> <br/> <div class='stateformat'>$i18n.getString('program')<br>$i18n.getString('code')</div></td>
 						<td> - <input type="text" id="yearcode" name="yearcode" maxlength="2" size="6" value="$year" class="{validate:{required:true,minlength:2}}"/> <br/> <div class='stateformat'>$i18n.getString('year')</div></td>
 						<td> - <input type="text" id="benicode" name="benicode" maxlength="4" size="9" class="{validate:{required:true,number:true,minlength:4}}"/> <br/> <div class='stateformat'>$i18n.getString('patient')<br>$i18n.getString('code')</div></td>