← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3034: more separation of vm/js

 

------------------------------------------------------------
revno: 3034
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-03-14 22:10:15 +0100
message:
  more separation of vm/js
added:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/addRoleForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/addUserForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/addUserGroupForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/allRole.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/allUser.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/updateRoleForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/updateUserForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/updateUserGroupForm.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/userGroupList.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/user_tmpl.js
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addRoleForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addUserForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addUserGroupForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allRole.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allUser.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/deleteCurrentUser.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/menu.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/orgunitMenu.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/responseRole.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/responseUserGroup.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateRoleForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserGroupForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/user.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/userGroupList.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-user/src/main/webapp/dhis-web-maintenance-user/addRoleForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addRoleForm.vm	2011-03-11 13:35:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addRoleForm.vm	2011-03-14 21:10:15 +0000
@@ -1,25 +1,6 @@
-<script>
- 	jQuery(document).ready(	function() {
-		jQuery("#name").focus();
-
-		var rules = {
-			name: {required:true,minlength:2},
-			description: {required:true}
-		}
-
-		validation2( 'addRoleForm', function( form ) {
-			selectAllById( 'selectedList' );
-			selectAllById( 'selectedListAuthority' );
-			form.submit();	
-		}, {
-			'rules': rules
-		});
-
-		jQuery("#name").attr("maxlength", "140");
-
-		/* remote validation */
-		checkValueIsExist( "name", "validateRole.action");
-	});		
+<script type="text/javascript" src="javascript/addRoleForm.js"></script>
+<script type="text/javascript">
+	var i18n_adding_role_failed = '$encoder.jsEscape( $i18n.getString( "adding_role_failed" ) , "'")';
 </script>
 
 <h3>$i18n.getString( "create_new_user_role" )</h3>
@@ -93,8 +74,3 @@
 	</tr>
   </table>
 </form>
-
-<script type="text/javascript">
-	var i18n_adding_role_failed = '$encoder.jsEscape( $i18n.getString( "adding_role_failed" ) , "'")';
-	sortList('availableListAuthority','ASC');
-</script>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addUserForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addUserForm.vm	2011-03-11 13:35:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addUserForm.vm	2011-03-14 21:10:15 +0000
@@ -1,34 +1,4 @@
-<script>
-	jQuery(document).ready(	function() {
-		var rules = {
-			username: {required:true, firstletteralphabet:true, minlength:2, alphanumeric:true},
-			rawPassword: {required:false, password:true, rangelength: [8, 35], notequalto:'#username'},
-			retypePassword: {required:true, equalTo:'#rawPassword'},
-			surname: {required:true, minlength:2},
-			firstName: {required:true, minlength:2},
-			email: {email:true},
-			phoneNumber: {}
-		};
-
-		validation2('addUserForm', function( form ) { form.submit() }, {
-			'beforeValidateHandler': function() {
-				listValidator( 'roleValidator','selectedList');
-			},
-			'rules' : rules 
-		});
-
-		jQuery("#username").attr("maxlength", "140");
-		jQuery("#rawPassword").attr("maxlength", "35");
-		jQuery("#retypePassword").attr("maxlength", jQuery("#rawPassword").attr("maxlength"));
-		jQuery("#surname").attr("maxlength", "140");
-		jQuery("#firstName").attr("maxlength", "140");
-		jQuery("#email").attr("maxlength", "160");
-		jQuery("#phoneNumber").attr("maxlength", "80");
-
-		/* remote validation */
-		checkValueIsExist( "username", "validateUser.action");	
-	});
-</script>
+<script type="text/javascript" src="javascript/addUserForm.js"></script>
 
 <h3>$i18n.getString( "create_new_user" )</h3>
 <form id="addUserForm" action="addUser.action" method="post" >
@@ -73,7 +43,7 @@
 		<th>$i18n.getString( "available_roles" )</th>
 		<td></td>
 		<th>$i18n.getString( "selected_roles" )
-			<select id="roleValidator" class="{validate:{required:true}}" style="display:none"/>
+			<select id="roleValidator" style="display:none"/>
 		</th>
 	</tr>
 	<tr>
@@ -115,4 +85,4 @@
 	</tr>
 </table>
 
-</form>
\ No newline at end of file
+</form>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addUserGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addUserGroupForm.vm	2011-03-11 13:35:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/addUserGroupForm.vm	2011-03-14 21:10:15 +0000
@@ -1,23 +1,4 @@
-<script>
-	jQuery(document).ready(	function() {
-		var rules = {
-			name: {required:true, minlength:2, alphanumericwithbasicpuncspaces:true, firstletteralphabet:true},
-			memberValidator: {required:true},			
-		};
-
-		validation2( 'addUserGroupForm', function( form ) { form.submit() }, {
-			'beforeValidateHandler': function() {
-				listValidator( 'memberValidator','groupMembers');
-			},
-			'rules': rules
-		});
-
-		 jQuery("#name").attr("maxlength", "210");
-
-		/* remote validation */
-		checkValueIsExist( "name", "validateUserGroup.action");	
-	});		
-</script>
+<script type="text/javascript" src="javascript/addUserGroupForm.js"></script>
 
 <h3>$i18n.getString( "add_user_group" )</h3>
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allRole.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allRole.vm	2011-01-20 22:08:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allRole.vm	2011-03-14 21:10:15 +0000
@@ -1,3 +1,8 @@
+<script type="text/javascript" src="javascript/allRole.js"></script>
+<script type="text/javascript">
+	var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_role" ) , "'")';
+	var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ) , "'")';
+</script>
 
 <h3>$i18n.getString( "user_role_management" ) #openHelp( "user_roles" )</h3>
 
@@ -59,11 +64,3 @@
         </td>
 	</tr>
 </table>
-
-<script type="text/javascript">
-	var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_role" ) , "'")';
-	var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ) , "'")';
-	jQuery(document).ready(function(){	
-		tableSorter( 'listTable' );	
-	});
-</script>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allUser.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allUser.vm	2011-01-19 07:52:16 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/allUser.vm	2011-03-14 21:10:15 +0000
@@ -1,3 +1,16 @@
+<script type="text/javascript" src="javascripts/allUser.js"></script>
+<script type="text/javascript">
+	var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_user" ) , "'")';
+	var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ) , "'")';
+	var i18n_edit = '$encoder.jsEscape( $i18n.getString( "edit" ) , "'")';
+	var i18n_remove = '$encoder.jsEscape( $i18n.getString( "remove" ) , "'")';
+	var i18n_show_details = '$encoder.jsEscape( $i18n.getString( "show_details" ) , "'")';
+	var i18n_username = '$encoder.jsEscape( $i18n.getString( "username" ) , "'")';
+	var i18n_name = '$encoder.jsEscape( $i18n.getString( "name" ) , "'")';
+	var i18n_operations = '$encoder.jsEscape( $i18n.getString( "operations" ) , "'")';
+	var currentUserName = '$currentUserName';
+</script>
+
 <h3>$i18n.getString( "user_management" ) #openHelp( "users" )</h3>
 
 <table style="width:100%">
@@ -72,23 +85,3 @@
 		</td>
 	</tr>
 </table>
-
-
-<script>
-	jQuery(document).ready(function(){	
-		tableSorter( 'userList' );
-	});
-</script>
-
-<script type="text/javascript">
-	var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_user" ) , "'")';
-	var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ) , "'")';
-
-	var i18n_edit = '$encoder.jsEscape( $i18n.getString( "edit" ) , "'")';
-	var i18n_remove = '$encoder.jsEscape( $i18n.getString( "remove" ) , "'")';
-	var i18n_show_details = '$encoder.jsEscape( $i18n.getString( "show_details" ) , "'")';
-	var i18n_username = '$encoder.jsEscape( $i18n.getString( "username" ) , "'")';
-	var i18n_name = '$encoder.jsEscape( $i18n.getString( "name" ) , "'")';
-	var i18n_operations = '$encoder.jsEscape( $i18n.getString( "operations" ) , "'")';
-	var currentUserName = '$currentUserName';
-</script>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/deleteCurrentUser.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/deleteCurrentUser.vm	2011-01-20 22:08:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/deleteCurrentUser.vm	2011-03-14 21:10:15 +0000
@@ -23,4 +23,4 @@
 
 </form>
 
-<span id="message" style="display:#if($message.trim().equals(""))none #else block #end">$message</span>
\ No newline at end of file
+<span id="message" style="display:#if($message.trim().equals(""))none #else block #end">$message</span>

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/addRoleForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/addRoleForm.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/addRoleForm.js	2011-03-14 21:10:15 +0000
@@ -0,0 +1,30 @@
+jQuery( document ).ready( function()
+{
+	jQuery( "#name" ).focus();
+
+	var rules = {
+		name : {
+			required : true,
+			minlength : 2
+		},
+		description : {
+			required : true
+		}
+	}
+
+	validation2( 'addRoleForm', function( form )
+	{
+		selectAllById( 'selectedList' );
+		selectAllById( 'selectedListAuthority' );
+		form.submit();
+	}, {
+		'rules' : rules
+	} );
+
+	jQuery( "#name" ).attr( "maxlength", "140" );
+
+	/* remote validation */
+	checkValueIsExist( "name", "validateRole.action" );
+
+	sortList('availableListAuthority','ASC');
+} );

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/addUserForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/addUserForm.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/addUserForm.js	2011-03-14 21:10:15 +0000
@@ -0,0 +1,58 @@
+jQuery( document ).ready( function()
+{
+	var rules = {
+		username : {
+			required : true,
+			firstletteralphabet : true,
+			minlength : 2,
+			alphanumeric : true
+		},
+		rawPassword : {
+			required : false,
+			password : true,
+			rangelength : [ 8, 35 ],
+			notequalto : '#username'
+		},
+		retypePassword : {
+			required : true,
+			equalTo : '#rawPassword'
+		},
+		surname : {
+			required : true,
+			minlength : 2
+		},
+		firstName : {
+			required : true,
+			minlength : 2
+		},
+		email : {
+			email : true
+		},
+		phoneNumber : {},
+		roleValidator : {
+			required : true
+		}
+	};
+
+	validation2( 'addUserForm', function( form )
+	{
+		form.submit()
+	}, {
+		'beforeValidateHandler' : function()
+		{
+			listValidator( 'roleValidator', 'selectedList' );
+		},
+		'rules' : rules
+	} );
+
+	jQuery( "#username" ).attr( "maxlength", "140" );
+	jQuery( "#rawPassword" ).attr( "maxlength", "35" );
+	jQuery( "#retypePassword" ).attr( "maxlength", jQuery( "#rawPassword" ).attr( "maxlength" ) );
+	jQuery( "#surname" ).attr( "maxlength", "140" );
+	jQuery( "#firstName" ).attr( "maxlength", "140" );
+	jQuery( "#email" ).attr( "maxlength", "160" );
+	jQuery( "#phoneNumber" ).attr( "maxlength", "80" );
+
+	/* remote validation */
+	checkValueIsExist( "username", "validateUser.action" );
+} );

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/addUserGroupForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/addUserGroupForm.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/addUserGroupForm.js	2011-03-14 21:10:15 +0000
@@ -0,0 +1,30 @@
+jQuery( document ).ready( function()
+{
+	var rules = {
+		name : {
+			required : true,
+			minlength : 2,
+			alphanumericwithbasicpuncspaces : true,
+			firstletteralphabet : true
+		},
+		memberValidator : {
+			required : true
+		}
+	};
+
+	validation2( 'addUserGroupForm', function( form )
+	{
+		form.submit()
+	}, {
+		'beforeValidateHandler' : function()
+		{
+			listValidator( 'memberValidator', 'groupMembers' );
+		},
+		'rules' : rules
+	} );
+
+	jQuery( "#name" ).attr( "maxlength", "210" );
+
+	/* remote validation */
+	checkValueIsExist( "name", "validateUserGroup.action" );
+} );

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/allRole.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/allRole.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/allRole.js	2011-03-14 21:10:15 +0000
@@ -0,0 +1,4 @@
+jQuery( document ).ready( function()
+{
+	tableSorter( 'listTable' );
+} );

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/allUser.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/allUser.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/allUser.js	2011-03-14 21:10:15 +0000
@@ -0,0 +1,4 @@
+jQuery( document ).ready( function()
+{
+	tableSorter( 'userList' );
+} );

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/updateRoleForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/updateRoleForm.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/updateRoleForm.js	2011-03-14 21:10:15 +0000
@@ -0,0 +1,33 @@
+jQuery( document ).ready( function()
+{
+	jQuery( "#name" ).focus();
+
+	var rules = {
+		name : {
+			required : true,
+			minlength : 2
+		},
+		description : {
+			required : true
+		}
+	};
+
+	validation2( 'updateRoleForm', function( form )
+	{
+		selectAllById( 'selectedList' );
+		selectAllById( 'selectedListAuthority' );
+		form.submit();
+	}, {
+		'rules' : rules
+	} );
+
+	jQuery( "#name" ).attr( "maxlength", "140" );
+
+	/* remote validation */
+	checkValueIsExist( "name", "validateRole.action", {
+		id : getFieldValue( 'id' )
+	} );
+
+	sortList( 'availableListAuthority', 'ASC' );
+	sortList( 'selectedListAuthority', 'ASC' );
+} );

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/updateUserForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/updateUserForm.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/updateUserForm.js	2011-03-14 21:10:15 +0000
@@ -0,0 +1,46 @@
+jQuery( document ).ready( function()
+{
+	var rules = {
+		rawPassword : {
+			rangelength : [ 8, 35 ],
+			password : true,
+			notequalto : '#username'
+		},
+		retypePassword : {
+			rangelength : [ 8, 35 ],
+			equalTo : '#rawPassword'
+		},
+		surname : {
+			required : true,
+			minlength : 2
+		},
+		firstName : {
+			required : true,
+			minlength : 2
+		},
+		email : {
+			email : true
+		},
+		phoneNumber : {},
+		roleValidator : {
+			required : true
+		}
+	};
+
+	validation2( 'updateUserForm', function( form )
+	{
+		form.submit()
+	}, {
+		'beforeValidateHandler' : function()
+		{
+			listValidator( 'roleValidator', 'selectedList' );
+		},
+		'rules' : rules
+	} );
+
+	jQuery( "#rawPassword" ).attr( "maxlength", "35" );
+	jQuery( "#retypePassword" ).attr( "maxlength", "35" );
+	jQuery( "#surname" ).attr( "maxlength", "140" );
+	jQuery( "#firstName" ).attr( "maxlength", "140" );
+	jQuery( "#email" ).attr( "maxlength", "160" );
+} );

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/updateUserGroupForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/updateUserGroupForm.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/updateUserGroupForm.js	2011-03-14 21:10:15 +0000
@@ -0,0 +1,27 @@
+jQuery( document ).ready( function()
+{
+	var rules = {
+		'name' : {
+			required : true,
+			minlength : 2,
+			alphanumericwithbasicpuncspaces : true,
+			firstletteralphabet : true
+		},
+		'memberValidator' : {
+			required : true
+		}
+	};
+
+	validation2( 'editUserGroupForm', function( form )
+	{
+		form.submit()
+	}, {
+		'beforeValidateHandler' : function()
+		{
+			listValidator( 'memberValidator', 'groupMembers' );
+		},
+		'rules' : rules
+	} );
+
+	jQuery( "#name" ).attr( "maxlength", "210" );
+} );

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/userGroupList.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/userGroupList.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/userGroupList.js	2011-03-14 21:10:15 +0000
@@ -0,0 +1,9 @@
+jQuery( document ).ready( function()
+{
+	tableSorter( 'listTable' );
+} );
+
+function removeUserGroup( userGroupId, userGroupName )
+{
+	removeItem( userGroupId, userGroupName, i18n_confirm_delete, "removeUserGroup.action" );
+}

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/user_tmpl.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/user_tmpl.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/javascript/user_tmpl.js	2011-03-14 21:10:15 +0000
@@ -0,0 +1,12 @@
+/* user.js already exists. This file is for user.vm */
+
+jQuery( document ).ready( function()
+{
+	tableSorter( 'userList' );
+	selection.setListenerFunction( orgUnitSelected );
+} );
+
+function orgUnitSelected( orgUnitIds )
+{
+	window.location.href = "user.action";
+}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/menu.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/menu.vm	2010-12-29 20:53:30 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/menu.vm	2011-03-14 21:10:15 +0000
@@ -5,5 +5,4 @@
 	<li><a href="allRole.action" title="$i18n.getString( "user_role" )">$i18n.getString( "user_role" )&nbsp;</a></li>
     <li><a href="deleteCurrentUser.action" title="$i18n.getString( "delete_current_user" )">$i18n.getString( "delete_current_user" )</a></li>
 	<li><a href="getAllUserGroups.action" title="$i18n.getString( "user_group" )" >$i18n.getString( "user_group" )</a></li>
-
-</ul>
\ No newline at end of file
+</ul>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/orgunitMenu.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/orgunitMenu.vm	2011-01-25 09:06:55 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/orgunitMenu.vm	2011-03-14 21:10:15 +0000
@@ -12,7 +12,3 @@
 ##parse( "/dhis-web-commons/ouwt/orgunittree.vm" )
 
 #parse( "/dhis-web-commons/ouwt/orgunittreesearch.vm" ) 
-
-<script type="text/javascript">
-
-</script>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/responseRole.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/responseRole.vm	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/responseRole.vm	2011-03-14 21:10:15 +0000
@@ -4,4 +4,4 @@
 	<members>$userAuthorityGroup.members.size()</members>
 	<dataSets>$userAuthorityGroup.dataSets.size()</dataSets>
 	<reports>$userAuthorityGroup.reports.size()</reports>
-</role>
\ No newline at end of file
+</role>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/responseUserGroup.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/responseUserGroup.vm	2010-12-23 12:27:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/responseUserGroup.vm	2011-03-14 21:10:15 +0000
@@ -3,4 +3,4 @@
   <name>$group.name</name>
   <id>$group.id</id>
   <noOfUsers>$memberCount</noOfUsers>
-</userGroup>
\ No newline at end of file
+</userGroup>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateRoleForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateRoleForm.vm	2011-03-11 13:35:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateRoleForm.vm	2011-03-14 21:10:15 +0000
@@ -1,26 +1,4 @@
-<script>
-	jQuery(document).ready(	function() {
-		jQuery("#name").focus();
-
-		var rules = {
-			name: {required:true, minlength:2},
-			description: {required:true}
-		};
-
-		validation2( 'updateRoleForm', function( form ) {
-			selectAllById( 'selectedList' );
-			selectAllById( 'selectedListAuthority' );
-			form.submit();			
-		}, {
-			'rules': rules
-		});
-
-		jQuery("#name").attr("maxlength", "140");
-
-		/* remote validation */
-		checkValueIsExist( "name", "validateRole.action", {id:getFieldValue('id')});				
-	});		
-</script>
+<script type="text/javascript" src="javascript/updateRoleForm.js"></script>
 
 <h3>$i18n.getString( "edit_user_role" )</h3>
 
@@ -105,8 +83,3 @@
 		</tr>
 	</table>
 </form>
-
-<script>
-	sortList('availableListAuthority','ASC');
-	sortList('selectedListAuthority','ASC');
-</script>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm	2011-03-11 13:35:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserForm.vm	2011-03-14 21:10:15 +0000
@@ -1,28 +1,4 @@
-<script>
-	jQuery(document).ready(	function() {
-		var rules = {
-			rawPassword: {rangelength: [8,35], password:true, notequalto:'#username'},
-			retypePassword: {rangelength: [8,35], equalTo:'#rawPassword'},
-			surname: {required:true,minlength:2},
-			firstName: {required:true,minlength:2},
-			email: {email:true},
-			phoneNumber: {}			
-		};
-
-		validation2( 'updateUserForm', function( form ) { form.submit() }, {
-			'beforeValidateHandler': function() {
-				listValidator( 'roleValidator','selectedList');
-			},
-			'rules': rules
-		});
-
-		jQuery("#rawPassword").attr("maxlength", "35");
-		jQuery("#retypePassword").attr("maxlength", "35");
-		jQuery("#surname").attr("maxlength", "140");
-		jQuery("#firstName").attr("maxlength", "140");
-		jQuery("#email").attr("maxlength", "160");
-	});
-</script>
+<script type="text/javascript" src="javascript/updateUserForm.js"></script>
 
 <h3>$i18n.getString( "edit_user" )</h3>
 
@@ -72,7 +48,7 @@
 		<th>$i18n.getString( "available" )</th>
 		<td></td>
 		<th>$i18n.getString( "selected" )
-			<select id="roleValidator" class="{validate:{required:true}}" style="display:none"/>
+			<select id="roleValidator" style="display:none"/>
 		</th>
 	</tr>
 	<tr>
@@ -111,5 +87,4 @@
 		<td valign="top"><input type="submit" value="$i18n.getString( 'save' )" style="width:10em"/><input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='user.action'" style="width:10em"/></td>
 	</tr>
 </table>
-
-</form>
\ No newline at end of file
+</form>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserGroupForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserGroupForm.vm	2011-03-11 13:35:36 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/updateUserGroupForm.vm	2011-03-14 21:10:15 +0000
@@ -1,23 +1,13 @@
-<script>
-	jQuery(document).ready(	function() {
-		var rules = {
-			'name': {required:true, minlength:2, alphanumericwithbasicpuncspaces:true, firstletteralphabet:true},
-			'memberValidator': {required:true}		
-		};
-
-		validation2( 'editUserGroupForm', function( form ) { form.submit() }, {
-			'beforeValidateHandler': function() {
-				listValidator( 'memberValidator','groupMembers');
-			},
-			'rules': rules
-		});
-
-		jQuery("#name").attr("maxlength", "210");
-
-		/* remote validation */
-		checkValueIsExist( "name", "validateUserGroup.action", {id:$group.id});	
-	});		
+<script type="text/javascript" src="javascript/updateUserGroupForm.js"></script>
+<script type="text/javascript">
+jQuery(document).ready(function() {
+	/* remote validation */
+	checkValueIsExist( "name", "validateUserGroup.action", {
+		id : $group.id
+	} );
+});
 </script>
+
 <h3>$i18n.getString( "edit_user_group" )</h3>
 
 <form id="editUserGroupForm" name="editUserGroupForm" action="updateUserGroup.action" method="post">
@@ -85,4 +75,4 @@
 
 <p><input type="submit" value="$i18n.getString( 'save' )" style="width:10em"/><input type="button" value="$i18n.getString( 'cancel' )" onclick="window.location.href='getAllUserGroups.action'" style="width:10em"/></p>
 
-</form>
\ No newline at end of file
+</form>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/user.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/user.vm	2010-12-28 17:49:37 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/user.vm	2011-03-14 21:10:15 +0000
@@ -1,3 +1,9 @@
+<script type="text/javascript" src="javascript/user_tmpl.js"></script>
+<script type="text/javascript">
+	var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_user" ) , "'")';
+	var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ) , "'")';
+</script>
+
 <h3>$i18n.getString( "user_management" ) #openHelp( "users" )</h3>
 
 <form id="userForm" method="POST">
@@ -62,7 +68,7 @@
                 <p><label>$i18n.getString( "phone_number" ):</label><br/><span id="phoneNumberField"></span></p>
 				<p><label>$i18n.getString( "number_of_orgunit" ):</label><br/><span id="numberOrgunitField"></span></p>					
 			</div>
-			
+
 			<div id="warningArea" style="position:fixed;right:10px;top:200px;display:none">
 				<div style="float:right">
 					<a href="javascript:hideWarning()" title="$i18n.getString( 'hide_warning' )"><img src="../images/close.png" alt="$i18n.getString( 'hide_warning' )"/></a>
@@ -73,24 +79,4 @@
 		</td>
 	</tr>
 </table>
-
-
-<script>
-	jQuery(document).ready(function(){	
-		tableSorter( 'userList' );
-	});
-</script>
 </form>
-
-<script type="text/javascript">
-	var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete_user" ) , "'")';
-	var i18n_none = '$encoder.jsEscape( $i18n.getString( "none" ) , "'")';
-
-	function orgUnitSelected( orgUnitIds )
-	{
-		window.location.href = "user.action";
-	}
-
-	selection.setListenerFunction( orgUnitSelected );
-
-</script>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/userGroupList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/userGroupList.vm	2011-01-04 15:43:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/webapp/dhis-web-maintenance-user/userGroupList.vm	2011-03-14 21:10:15 +0000
@@ -1,3 +1,8 @@
+<script type="text/javascript" src="javascript/userGroupList.js"></script>
+<script type="text/javascript">
+    var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete" ) , "'" )';
+</script>
+
 <h3>$i18n.getString( "user_group_management" )</h3>
 
 <table class="mainPageTable">
@@ -54,18 +59,3 @@
         </td>
   </tr>
 </table>
-
-<script type="text/javascript">
-
-    var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete" ) , "'" )';
-
-    jQuery(document).ready(function(){  
-        tableSorter( 'listTable' ); 
-    });
-
-
-function removeUserGroup( userGroupId, userGroupName )
-{
-    removeItem( userGroupId, userGroupName, i18n_confirm_delete, "removeUserGroup.action" );
-}
-</script>