← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3172: (local vn) Excel reporting - Added regex validation for configuration path.

 

------------------------------------------------------------
revno: 3172
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-03-28 10:59:21 +0700
message:
  (local vn) Excel reporting - Added regex validation for configuration path.
modified:
  local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties
  local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_en_GB.properties
  local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_vi_VN.properties
  local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/configuration.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 'local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties'
--- local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties	2011-03-25 09:11:30 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module.properties	2011-03-28 03:59:21 +0000
@@ -271,4 +271,5 @@
 import_excel_items_cannot_be_empty = Excel items for importing cannot be empty
 access_denied_to_folder     = Access denied to folder on server
 access_denied_to_file       = Access denied to file on server
-template_folder_is_not_empty= Warning! The old template directory of system is not empty.\nWould you like to move its children to the new one before it deleted ?
\ No newline at end of file
+template_folder_is_not_empty= Warning\! The old template directory of system is not empty.\nWould you like to move its children to the new one before it deleted ?
+config_path_invalid			= Invalid configuration\! Only Alphabetic, Numbers, Undercore, Middlecore and Space alow.
\ No newline at end of file

=== modified file 'local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_en_GB.properties'
--- local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_en_GB.properties	2011-03-25 09:11:30 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_en_GB.properties	2011-03-28 03:59:21 +0000
@@ -198,4 +198,5 @@
 completed=Completed
 ready_in_use=File is ready in use. Can not delete \!
 available_periods=Available periods
-sheetNo=Sheet
\ No newline at end of file
+sheetNo=Sheet
+config_path_invalid=Invalid configuration\! Only Alphabetic, Numbers, Undercore, Middlecore and Space alow.
\ No newline at end of file

=== modified file 'local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_vi_VN.properties'
--- local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_vi_VN.properties	2011-03-25 09:11:30 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/resources/org/hisp/dhis/reportexcel/i18n_module_vi_VN.properties	2011-03-28 03:59:21 +0000
@@ -263,4 +263,5 @@
 import_excel_items_cannot_be_empty = Vui l\u00f2ng t\u1ea1o ph\u1ea7n t\u1eed excel cho import d\u1eef li\u1ec7u
 access_denied_to_folder     = Ba\u0323n kh\u00f4ng \u0111u\u0309 quy\u00ea\u0300n truy c\u00e2\u0323p va\u0300o th\u01b0 mu\u0323c tr\u00ean ma\u0301y chu\u0309
 access_denied_to_file       = Truy c\u1eadp b\u1ecb t\u1eeb ch\u1ed1i \u0111\u00ea\u0301n t\u1eadp tin tr\u00ean m\u00e1y ch\u1ee7
-template_folder_is_not_empty= C\u1ea3nh b\u00e1o! Th\u01b0 m\u1ee5c c\u0169 c\u1ee7a h\u1ec7 th\u1ed1ng hi\u1ec7n \u0111ang ch\u1ee9a c\u00e1c t\u1eadp tin excel m\u1eabu.\nB\u1ea1n c\u00f3 mu\u1ed1n di chuy\u1ec3n ch\u00fang qua th\u01b0 m\u1ee5c m\u1edbi tr\u01b0\u1edbc khi n\u00f3 b\u1ecb x\u00f3a ?
\ No newline at end of file
+template_folder_is_not_empty= C\u1ea3nh b\u00e1o! Th\u01b0 m\u1ee5c c\u0169 c\u1ee7a h\u1ec7 th\u1ed1ng hi\u1ec7n \u0111ang ch\u1ee9a c\u00e1c t\u1eadp tin excel m\u1eabu.\nB\u1ea1n c\u00f3 mu\u1ed1n di chuy\u1ec3n ch\u00fang qua th\u01b0 m\u1ee5c m\u1edbi tr\u01b0\u1edbc khi n\u00f3 b\u1ecb x\u00f3a \?
+config_path_invalid			= C\u1ea5u h\u00ecnh kh\u00f4ng h\u1ee3p l\u1ec7\! Ch\u1ec9 cho ph\u00e9p nh\u1eadp ch\u1eef c\u00e1i, ch\u1eef s\u1ed1, k\u00fd t\u1ef1 g\u1ea1ch d\u01b0\u1edbi, g\u1ea1ch ngang v\u00e0 kho\u1ea3ng tr\u1eafng.
\ No newline at end of file

=== modified file 'local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/configuration.vm'
--- local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/configuration.vm	2011-03-25 09:11:30 +0000
+++ local/vn/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/configuration.vm	2011-03-28 03:59:21 +0000
@@ -17,7 +17,8 @@
 		<td>$i18n.getString('excel_file_directory')</td>		
 	</tr>
 	<tr>
-		<td><input type="text" id="templateDirectory" name="templateDirectory" style="width:400px" value="$!templateDirectory" class="{validate:{required:true}}"/></td>
+		<td><input type="text" id="templateDirectory" name="templateDirectory" style="width:400px" value="$!templateDirectory" 
+		class="{validate:{required:true,custome_regex:[/^[\w-\s\/\\]*$/, '$i18n.getString( 'config_path_invalid' )']}}" onblur="replaceFlash( this )"/></td>
 	</tr>
 	<tr>		
 		<td><input type="submit" value="$i18n.getString('ok')" style="width:150px"/>
@@ -57,4 +58,9 @@
 			}, function( json ) { form.submit(); } );
 	}
 	
+	function replaceFlash( element )
+	{
+		element.value = element.value.replace(/[\\]+/g, '\\').replace(/[/]+/g, '/');
+	}
+	
 </script>
\ No newline at end of file