← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3347: finished validation rules update.

 

------------------------------------------------------------
revno: 3347
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-04-11 16:03:01 +0200
message:
  finished validation rules update.
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addConceptForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryComboForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateConceptForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryComboForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryForm.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/javascripts/validationRules.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js	2011-04-11 13:46:07 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js	2011-04-11 14:03:01 +0000
@@ -194,6 +194,7 @@
 	/* dhis-web-maintenance-datadictionary */
 	"concept" : {
 		"name" : {
+			"required" : true,
 			"rangelength" : [ 3, 10 ]
 		}
 	},
@@ -232,12 +233,23 @@
 	},
 	"dateElementCategoryCombo" : {
 		"name" : {
+			"required" : true,
 			"rangelength" : [ 2, 160 ]
+		},
+		"selectedList" : {
+			"required" : true
 		}
 	},
 	"dateElementCategory" : {
 		"name" : {
+			"required" : true,
 			"rangelength" : [ 2, 160 ]
+		},
+		"conceptId" : {
+			"required" : true
+		},
+		"memberValidator" : {
+			"required" : true
 		}
 	},
 	"dataElementGroup" : {

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addConceptForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addConceptForm.vm	2011-03-29 10:07:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addConceptForm.vm	2011-04-11 14:03:01 +0000
@@ -1,21 +1,12 @@
 <script type="text/javascript">
 	jQuery(document).ready(	function(){
-		var r = getValidationRules();
-		
-		var rules = {
-			name: {
-				required: true,
-				rangelength: r.concept.name.rangelength,
-				custome_regex:[/^[a-zA-Z][a-zA-Z0-9_]{0,9}$/,'$i18n.getString( 'regex_add_edit_concept' )']
-			}
-		};
+		var rules = getValidationRules("concept");
+		rules["name"].custome_regex = [/^[a-zA-Z][a-zA-Z0-9_]{0,9}$/,'$i18n.getString( 'regex_add_edit_concept' )']; 
 
 		validation2( 'addConceptForm', function( form ) { form.submit() }, {
 			'rules': rules
 		} );
 
-		jQuery("#name").attr("maxlength", r.concept.name.rangelength[1]);
-
 		checkValueIsExist( "name", "validateAddUpdateConcept.action" );				
 	});
 </script>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryComboForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryComboForm.vm	2011-04-09 18:42:50 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryComboForm.vm	2011-04-11 14:03:01 +0000
@@ -1,26 +1,12 @@
 <script type="text/javascript">
 	jQuery(document).ready(	function(){
-		var r = getValidationRules();
-
-		var rules = {
-			name: {
-				required: true,
-				rangelength: r.dateElementCategoryCombo.name.rangelength
-			},
-			selectedList: {
-				required: true
-			}
-		};
-
 		validation2( 'addDataElementCategoryComboForm', function( form ){ 
 			validateSelectedCategories( form );
 		}, {
 			'beforeValidationHandler': function() { listValidator( 'selectedCategories', 'selectedList' ); },
-			'rules': rules 
+			'rules': getValidationRules("dateElementCategoryCombo")
 		});
 
-		jQuery("#name").attr("maxlength", r.dateElementCategoryCombo.name.rangelength[1]);
-
 		checkValueIsExist( "name", "validateDataElementCategoryCombo.action");				
 	});
 </script>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryForm.vm	2011-03-29 10:07:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryForm.vm	2011-04-11 14:03:01 +0000
@@ -1,27 +1,10 @@
 <script type="text/javascript">
 	jQuery(document).ready(	function() {
-		var r = getValidationRules();
-
-		var rules = {
-			name: {
-				required: true,
-				rangelength: r.dateElementCategory.name.rangelength
-			},
-			conceptId: {
-				required: true
-			},
-			memberValidator: {
-				required: true
-			}
-		};
-
 		validation2( 'addDataElementCategoryForm', function( form ){ form.submit() }, {
 			'beforeValidationHandler': function() { listValidator( 'memberValidator', 'categoryOptionNames' ); },
-			'rules': rules
+			'rules': getValidationRules("dateElementCategory")
 		});
 
-		jQuery("#name").attr("maxlength", r.dateElementCategory.name.rangelength[1]);
-
 		checkValueIsExist( "name", "validateDataElementCategory.action");	
 	});
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateConceptForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateConceptForm.vm	2011-03-29 10:07:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateConceptForm.vm	2011-04-11 14:03:01 +0000
@@ -1,21 +1,12 @@
 <script type="text/javascript">
 	jQuery(document).ready(	function(){
-		var r = getValidationRules();
-		
-		var rules = {
-			name: {
-				required: true,
-				rangelength: r.concept.name.rangelength,
-				custome_regex:[/^[a-zA-Z][a-zA-Z0-9_]{0,9}$/,'$i18n.getString( 'regex_add_edit_concept' )']
-			}
-		};
+		var rules = getValidationRules("concept");
+		rules["name"].custome_regex = [/^[a-zA-Z][a-zA-Z0-9_]{0,9}$/,'$i18n.getString( 'regex_add_edit_concept' )']; 
 
 		validation2( 'updateConceptForm', function( form ) { form.submit() }, {
 			'rules': rules
 		} );		
 
-		jQuery("#name").attr("maxlength", r.concept.name.rangelength[1]);
-
 		checkValueIsExist( "name", "validateAddUpdateConcept.action", {id: $concept.id});				
 	});
 </script>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryComboForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryComboForm.vm	2011-04-09 18:42:50 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryComboForm.vm	2011-04-11 14:03:01 +0000
@@ -1,26 +1,12 @@
 <script type="text/javascript">
 	jQuery(document).ready(	function(){
-		var r = getValidationRules();
-
-		var rules = {
-			name: {
-				required: true,
-				rangelength: r.dateElementCategoryCombo.name.rangelength
-			},
-			selectedList: {
-				required: true
-			}
-		};
-
 		validation2( 'editDataElementCategoryComboForm', function( form ) { 
 			validateSelectedCategories( form );
 		}, {
 			'beforeValidationHandler': function() { listValidator( 'selectedCategories', 'selectedList' ); },
-			'rules': rules 
+			'rules': getValidationRules("dateElementCategoryCombo")
 		});
 
-		jQuery("#name").attr("maxlength", r.dateElementCategoryCombo.name.rangelength[1]);
-
 		checkValueIsExist( "name", "validateDataElementCategoryCombo.action", {id: $dataElementCategoryCombo.id});				
 	});
 </script>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryForm.vm	2011-03-29 10:07:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryForm.vm	2011-04-11 14:03:01 +0000
@@ -1,27 +1,10 @@
 <script type="text/javascript">
 	jQuery(document).ready(	function() {
-		var r = getValidationRules();
-
-		var rules = {
-			name: {
-				required: true,
-				rangelength: r.dateElementCategory.name.rangelength
-			},
-			conceptId: {
-				required: true
-			},
-			memberValidator: {
-				required: true
-			}
-		};
-	
 		validation2( 'editDataElementCategoryForm', function( form ){ form.submit()}, {
 			'beforeValidationHandler': function() { listValidator( 'memberValidator', 'categoryOptions' ); },
-			'rules': rules 
+			'rules': getValidationRules("dateElementCategory")
 		}); 
 
-		jQuery("#name").attr("maxlength", r.dateElementCategory.name.rangelength[1]);
-
 		checkValueIsExist( "name", "validateDataElementCategory.action", {id: $dataElementCategory.id});		
 	});