← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3197: finished validation in dhis-web-maintenance-dataadmin

 

------------------------------------------------------------
revno: 3197
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-03-29 09:05:29 +0200
message:
  finished validation in dhis-web-maintenance-dataadmin
added:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/addSqlViewForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/collectiveDataLockingForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataBrowserForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/minMaxValidationForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/updateSqlViewForm.js
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addSqlViewForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/collectiveDataLockingForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/minMaxValidation.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateSqlViewForm.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-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml	2011-03-14 05:00:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/struts.xml	2011-03-29 07:05:29 +0000
@@ -30,7 +30,7 @@
 			<param name="page">
 				/dhis-web-maintenance-dataadmin/collectiveDataLockingForm.vm</param>
 			<param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
-			<param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/datasetLockReport.js</param>
+			<param name="javascripts">../dhis-web-commons/oust/oust.js,javascript/datasetLockReport.js, javascript/collectiveDataLockingForm.js</param>
 		</action>
 		
 		<action name="getDataSetsForPeriodType"
@@ -187,7 +187,7 @@
 				/dhis-web-maintenance-dataadmin/dataBrowserForm.vm</param>
 			<param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
 			<param name="javascripts"> ../dhis-web-commons/ouwt/ouwt.js,
-				javascript/dataBrowser.js</param>
+				javascript/dataBrowser.js, javascript/dataBrowserForm.js</param>
 			<interceptor-ref name="organisationUnitTreeStack"/>
 		</action>
 
@@ -333,7 +333,7 @@
 			<result name="success" type="velocity">/main.vm</result>
 			<param name="page">/dhis-web-maintenance-dataadmin/minMaxValidation.vm</param>
 			<param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
-			<param name="javascripts">javascript/minMaxValidation.js </param>
+			<param name="javascripts">javascript/minMaxValidation.js, javascript/minMaxValidationForm.js </param>
 		</action>
 			
 		<!-- Sql View -->
@@ -360,7 +360,7 @@
 			<param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
 			<param name="page">/dhis-web-maintenance-dataadmin/addSqlViewForm.vm</param>
 			<param name="stylesheets">style/jquery.autocomplete.css</param>
-			<param name="javascripts">javascript/sqlView.js</param>
+			<param name="javascripts">javascript/sqlView.js, javascript/addSqlViewForm.js</param>
 			<param name="requiredAuthorities">F_SQLVIEW_ADD</param>
 		</action>
 		
@@ -386,7 +386,7 @@
 			<param name="menu">/dhis-web-maintenance-dataadmin/menu.vm</param>
 			<param name="page">/dhis-web-maintenance-dataadmin/updateSqlViewForm.vm</param>
 			<param name="stylesheets">style/jquery.autocomplete.css</param>
-			<param name="javascripts">javascript/sqlView.js</param>
+			<param name="javascripts">javascript/sqlView.js, javascript/updateSqlViewForm.js</param>
 			<param name="requiredAuthorities">F_SQLVIEW_UPDATE</param>
 		</action>
 		

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addSqlViewForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addSqlViewForm.vm	2011-03-28 17:46:09 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/addSqlViewForm.vm	2011-03-29 07:05:29 +0000
@@ -1,30 +1,3 @@
-<script type="text/javascript">
-	jQuery(document).ready(function() {
-		var r = getValidationRules();
-
-		var rules = {
-			name: {
-				required: true,
-				rangelength: r.sqlView.name.rangelength
-			},
-			description: {
-				required: true,
-				rangelength: r.sqlView.description.rangelength
-			},
-			sqlquery: {
-				required: true,
-				rangelength: r.sqlView.sqlquery.rangelength
-			}
-		};
-
-		validation2( 'addSqlViewForm', function() {
-			validateAddUpdateSqlView( 'add' );
-		}, {
-			'rules': rules
-		});
-	});
-</script>
-
 <input type="hidden" id="curLocaleCode" value="$locale.getLanguage()_$locale.getCountry()"/>
 
 <h3>$encoder.htmlEncode( $i18n.getString( "add_new_sql_view" ) )</h3>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/collectiveDataLockingForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/collectiveDataLockingForm.vm	2011-03-28 17:46:09 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/collectiveDataLockingForm.vm	2011-03-29 07:05:29 +0000
@@ -1,24 +1,4 @@
 <script type="text/javascript">
-	jQuery(document).ready( function() {
-		var r = getValidationRules();
-		
-		var rules = {
-			selectedPeriods: {
-				required: true
-			},
-			selectedDataSets: {
-				required: true
-			}
-		};
-	
-		validation2( 'lockingForm', function( form )
-		{
-			validateCollectiveDataLockingForm( form );
-		}, {
-			'rules': rules
-		});
-	});
-
 	var i18n_organisation_unit_not_selected = '$encoder.jsEscape( $i18n.getString( "organisation_unit_not_selected" ) , "'")';
 	var i18n_period_not_selected = '$encoder.jsEscape( $i18n.getString( "period_not_selected" ) , "'")';
 	var i18n_dataset_not_selected = '$encoder.jsEscape( $i18n.getString( "dataset_not_selected" ) , "'")';

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserForm.vm	2011-03-28 17:46:09 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/dataBrowserForm.vm	2011-03-29 07:05:29 +0000
@@ -1,28 +1,4 @@
 <script type="text/javascript">
-	jQuery(document).ready(function() {
-		datePickerInRange( 'fromDate' , 'toDate' );
-
-		var r = getValidationRules();
-		
-		var rules = {
-			periodTypeId: {
-				required: true
-			},
-			mode: {
-				required: true
-			}
-		};
-
-		validation2( 'databrowser', function( form ){ 			
-			form.submit();
-		}, {
-			'rules': rules
-		});		
-	});
-
-	var flag;
-	window.onload = modeHandler;
-	
 	var i18n_drilldown_earliest_selected = '$encoder.jsEscape( $i18n.getString("earliest_date_used_if_no_date_selected"), "'" )';
 	var i18n_drilldown_latest_selected = '$encoder.jsEscape( $i18n.getString("latest_date_used_if_no_date_selected"), "'" )';
 	var i18n_drilldown_choose_period_type = '$encoder.jsEscape( $i18n.getString("drilldown_choose_period_type"), "'" )';

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/addSqlViewForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/addSqlViewForm.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/addSqlViewForm.js	2011-03-29 07:05:29 +0000
@@ -0,0 +1,28 @@
+jQuery(document).ready(function() {
+	var r = getValidationRules();
+
+	var rules = {
+		name: {
+			required: true,
+			rangelength: r.sqlView.name.rangelength
+		},
+		description: {
+			required: true,
+			rangelength: r.sqlView.description.rangelength
+		},
+		sqlquery: {
+			required: true,
+			rangelength: r.sqlView.sqlquery.rangelength
+		}
+	};
+
+	validation2( 'addSqlViewForm', function() {
+		validateAddUpdateSqlView( 'add' );
+	}, {
+		'rules': rules
+	});
+
+	jQuery("#name").attr("maxlength", r.sqlView.name.rangelength[1]); 
+	jQuery("#description").attr("maxlength", r.sqlView.description.rangelength[1]); 
+	jQuery("#sqlquery").attr("maxlength", r.sqlView.sqlquery.rangelength[1]); 
+});

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/collectiveDataLockingForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/collectiveDataLockingForm.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/collectiveDataLockingForm.js	2011-03-29 07:05:29 +0000
@@ -0,0 +1,19 @@
+jQuery(document).ready( function() {
+	var r = getValidationRules();
+	
+	var rules = {
+		selectedPeriods: {
+			required: true
+		},
+		selectedDataSets: {
+			required: true
+		}
+	};
+
+	validation2( 'lockingForm', function( form )
+	{
+		validateCollectiveDataLockingForm( form );
+	}, {
+		'rules': rules
+	});
+});

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataBrowserForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataBrowserForm.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/dataBrowserForm.js	2011-03-29 07:05:29 +0000
@@ -0,0 +1,23 @@
+jQuery(document).ready(function() {
+	datePickerInRange( 'fromDate' , 'toDate' );
+
+	var r = getValidationRules();
+	
+	var rules = {
+		periodTypeId: {
+			required: true
+		},
+		mode: {
+			required: true
+		}
+	};
+
+	validation2( 'databrowser', function( form ){ 			
+		form.submit();
+	}, {
+		'rules': rules
+	});		
+});
+
+var flag;
+window.onload = modeHandler;

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/minMaxValidationForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/minMaxValidationForm.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/minMaxValidationForm.js	2011-03-29 07:05:29 +0000
@@ -0,0 +1,22 @@
+jQuery(document).ready(function() {
+	var r = getValidationRules();
+	
+	var rules = {
+		dataSetIds: {
+			required: true
+		}
+	};
+	
+	validation2( "minMaxGeneratingForm", function() {
+		if(isGenerate) {
+			generateMinMaxValue();
+		} else {
+			removeMinMaxValue();
+		}
+	}, {
+		'rules': rules
+	});
+});
+
+var isGenerate = true;
+var numberOfSelects = 0;

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/updateSqlViewForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/updateSqlViewForm.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/updateSqlViewForm.js	2011-03-29 07:05:29 +0000
@@ -0,0 +1,28 @@
+jQuery(document).ready(function() {
+	var r = getValidationRules();
+	
+	var rules = {
+		name: {
+			required: true,
+			rangelength: r.sqlView.name.rangelength
+		},
+		description: {
+			required: true,
+			rangelength: r.sqlView.description.rangelength
+		},
+		sqlquery: {
+			required: true,
+			rangelength: r.sqlView.sqlquery.rangelength
+		}
+	};
+
+	validation2( 'updateSqlViewForm', function() {
+		validateAddUpdateSqlView( 'update' );
+	}, {
+		'rules': rules
+	});
+
+	jQuery("#name").attr("maxlength", r.sqlView.name.rangelength[1]); 
+	jQuery("#description").attr("maxlength", r.sqlView.description.rangelength[1]); 
+	jQuery("#sqlquery").attr("maxlength", r.sqlView.sqlquery.rangelength[1]);
+});

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/minMaxValidation.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/minMaxValidation.vm	2011-03-28 17:46:09 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/minMaxValidation.vm	2011-03-29 07:05:29 +0000
@@ -1,27 +1,5 @@
+<script type="text/javascript" src="javascript/minMaxValidationForm.js"></script>
 <script type="text/javascript">
-	jQuery(document).ready(function() {
-		var r = getValidationRules();
-		
-		var rules = {
-			dataSetIds: {
-				required: true
-			}
-		};
-		
-		validation2( "minMaxGeneratingForm", function() {
-			if(isGenerate) {
-				generateMinMaxValue();
-			} else {
-				removeMinMaxValue();
-			}
-		}, {
-			'rules': rules
-		});
-	});
-
-	var isGenerate = true;
-	var numberOfSelects = 0;
-
 	var i18n_loading = '$encoder.jsEncode( $i18n.getString( "loading" ) )';
 	var levelMustBeInt = '$encoder.jsEncode( $i18n.getString( "level_must_be_int" ) )';
 	var i18n_not_choose_dataset = '$encoder.jsEncode( $i18n.getString( "not_choose_dataset" ) )';

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateSqlViewForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateSqlViewForm.vm	2011-03-28 17:46:09 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/updateSqlViewForm.vm	2011-03-29 07:05:29 +0000
@@ -1,30 +1,3 @@
-<script type="text/javascript">
-	jQuery(document).ready(function() {
-		var r = getValidationRules();
-		
-		var rules = {
-			name: {
-				required: true,
-				rangelength: r.sqlView.name.rangelength
-			},
-			description: {
-				required: true,
-				rangelength: r.sqlView.description.rangelength
-			},
-			sqlquery: {
-				required: true,
-				rangelength: r.sqlView.sqlquery.rangelength
-			}
-		};
-
-		validation2( 'updateSqlViewForm', function() {
-			validateAddUpdateSqlView( 'update' );
-		}, {
-			'rules': rules
-		});
-	});
-</script>
-
 <input type="hidden" id="curLocaleCode" value="$locale.getLanguage()_$locale.getCountry()"/>
 
 <h3>$encoder.htmlEncode( $i18n.getString( "update_sql_view" ) )</h3>