Index: trunk/expressoAdmin1_2/js/jscode/users.js
===================================================================
--- trunk/expressoAdmin1_2/js/jscode/users.js	(revision 2604)
+++ trunk/expressoAdmin1_2/js/jscode/users.js	(revision 2712)
@@ -8,9 +8,9 @@
 		
 		if (document.forms[0].uid.value == ''){
-			alert(get_lang('LOGIN field is empty') + '.');
+			alert( ExpressoLivre.translate( 'LOGIN field is empty' )  + '.');
 			return;
 		}
 		else if (document.forms[0].uid.value.length < document.forms[0].minimumSizeLogin.value){
-			alert(get_lang('LOGIN field must be bigger than') + ' ' + document.forms[0].minimumSizeLogin.value + ' ' + get_lang('characters') + '.');
+			alert( ExpressoLivre.translate( 'LOGIN field must be bigger than' )  + ' ' + document.forms[0].minimumSizeLogin.value + ' ' +  ExpressoLivre.translate( 'characters' )  + '.');
 			return;
 		}
@@ -22,5 +22,5 @@
 			var reUid = /^([a-zA-Z0-9_\-])+$/;
 		if(!reUid.test(document.forms[0].uid.value)){
-			alert(get_lang('LOGIN field contains characters not allowed') + '.');
+			alert( ExpressoLivre.translate( 'LOGIN field contains characters not allowed' )  + '.');
 			return;
 		}
@@ -28,9 +28,9 @@
 		//PASSWORD's
 		if (document.forms[0].password1.value == ''){
-			alert(get_lang('Password field is empty') + '.');
+			alert( ExpressoLivre.translate( 'Password field is empty' )  + '.');
 			return;
 		}
 		if (document.forms[0].password2.value == ''){
-			alert(get_lang('repassword field is empty') + '.');
+			alert( ExpressoLivre.translate( 'repassword field is empty' )  + '.');
 			return;
 		}
@@ -38,5 +38,5 @@
 
 	if (document.forms[0].password1.value != document.forms[0].password2.value){
-		alert(get_lang('password and repassword are different') + '.');
+		alert( ExpressoLivre.translate( 'password and repassword are different' )  + '.');
 		return;
 	}
@@ -49,5 +49,5 @@
 		if(!re_employeenumber.test(document.forms[0].corporative_information_employeenumber.value))
 		{
-			alert(get_lang('EmployeeNumber contains characters not allowed') + '. ' + get_lang('Only numbers are allowed') + '.');
+			alert( ExpressoLivre.translate( 'EmployeeNumber contains characters not allowed' )  + '. ' +  ExpressoLivre.translate( 'Only numbers are allowed' )  + '.');
 			document.forms[0].corporative_information_employeenumber.focus();
 			return;
@@ -58,10 +58,10 @@
 	document.forms[0].mail.value = document.forms[0].mail.value.toLowerCase();
 	if (document.forms[0].mail.value == ''){
-		alert(get_lang('Email field is empty') + '.');
+		alert( ExpressoLivre.translate( 'Email field is empty' )  + '.');
 		return;
 	}
 	var reEmail = /^([a-zA-Z0-9_\-])+(\.[a-zA-Z0-9_\-]+)*\@([a-zA-Z0-9_\-])+(\.[a-zA-Z0-9_\-]+)*$/;
 	if(!reEmail.test(document.forms[0].mail.value)){
-		alert(get_lang('Email field is not valid') + '.');
+		alert( ExpressoLivre.translate( 'Email field is not valid' )  + '.');
 		return false;
 	}
@@ -70,9 +70,9 @@
 	var reGivenname = /^[a-zA-Z0-9 \-\.]+$/;
 	if(!reGivenname.test(document.forms[0].givenname.value)){
-		alert(get_lang('First name field contains characters not allowed') + '.');
+		alert( ExpressoLivre.translate( 'First name field contains characters not allowed' )  + '.');
 		return false;
 	}
 	else if (document.forms[0].givenname.value == ''){
-		alert(get_lang('First name field is empty') + '.');
+		alert( ExpressoLivre.translate( 'First name field is empty' )  + '.');
 		return;
 	}
@@ -81,9 +81,9 @@
 	var reSn = /^[a-zA-Z0-9 \-\.]+$/;
 	if(!reSn.test(document.forms[0].sn.value)){
-		alert(get_lang('Last name field contains characters not allowed') + '.');
+		alert( ExpressoLivre.translate( 'Last name field contains characters not allowed' )  + '.');
 		return false;
 	}
 	else if (document.forms[0].sn.value == ''){
-		alert(get_lang('Last name field is empty') + '.');
+		alert( ExpressoLivre.translate( 'Last name field is empty' )  + '.');
 		return;
 	}
@@ -95,5 +95,5 @@
 		if (!reg_tel.exec(document.forms[0].telephonenumber.value))
 		{
-			alert(get_lang('Phone field is incorrect') + '.');
+			alert( ExpressoLivre.translate( 'Phone field is incorrect' )  + '.');
 			return;
 		}
@@ -102,5 +102,5 @@
 	//FORWAR ONLY
 	if ((document.forms[0].deliverymode.checked) && (document.forms[0].mailforwardingaddress.value == '')){
-		alert(get_lang('Forward email is empty') + '.');
+		alert( ExpressoLivre.translate( 'Forward email is empty' )  + '.');
 		return;
 	}
@@ -108,5 +108,5 @@
 	// Email Quota
 	if (document.forms[0].mailquota.value == ''){
-		alert(get_lang('User without email quota') + '.');
+		alert( ExpressoLivre.translate( 'User without email quota' )  + '.');
 		return;
 	}
@@ -114,5 +114,5 @@
 	//GROUPS
 	if (document.getElementById('ea_select_user_groups').length < 1){
-		alert(get_lang('User is not in any group') + '.');
+		alert( ExpressoLivre.translate( 'User is not in any group' )  + '.');
 		return;
 	}
@@ -121,9 +121,9 @@
 	if (document.getElementById('tabcontent6').style.display != 'none'){
 		if ((document.forms[0].sambalogonscript.value == '') && (!document.forms[0].sambalogonscript.disabled)){
-			alert(get_lang('Logon script is empty') + '.');
+			alert( ExpressoLivre.translate( 'Logon script is empty' )  + '.');
 			return;
 		}
 		if ((document.forms[0].sambahomedirectory.value == '') && (!document.forms[0].sambahomedirectory.disabled)){
-			alert(get_lang('Users home directory is empty') + '.');
+			alert( ExpressoLivre.translate( 'Users home directory is empty' )  + '.');
 			return;
 		}
@@ -197,5 +197,5 @@
 function generate_login(first_name,second_name) {
 	if ((first_name=='') || (second_name=='')) {
-		alert(get_lang("You must type the first and the second name before generate the login"));
+		alert( ExpressoLivre.translate( "You must type the first and the second name before generate the login" ) );
 		return;
 	}
@@ -229,5 +229,5 @@
 		alert(data.msg);
 	else
-		alert(get_lang('User successful created') + '.');
+		alert( ExpressoLivre.translate( 'User successful created' )  + '.');
 
 	location.href="./index.php?menuaction=expressoAdmin1_2.uiaccounts.list_users";
@@ -248,5 +248,5 @@
 	}
 	else{
-		alert(get_lang('User successful saved') + '.');
+		alert( ExpressoLivre.translate( 'User successful saved' )  + '.');
 	}
 	location.href="./index.php?menuaction=expressoAdmin1_2.uiaccounts.list_users";
@@ -258,4 +258,5 @@
 	var handler_get_available_groups = function(data)
 	{
+		data = data.trim( );
 		select_available_groups = document.getElementById('ea_select_available_groups');
 
@@ -274,12 +275,9 @@
 			select_available_groups.outerHTML = select_available_groups.outerHTML;
 		}
-	}	
-		
-	_controller.go( {
-		"access" : "$this.ldap_functions.get_available_groups&context="+context,
-		"handler" : function( data )
-		{
-			handler_get_available_groups( expresso.connector.unserialize( data ) );
-		}
+	}
+
+	ExpressoLivre.go( {
+		"access" : "expressoAdmin1_2.ldap_functions.get_available_groups&context="+escape(context),
+		"handler" : handler_get_available_groups
 	} );
 }
@@ -377,10 +375,7 @@
 		}
 	}
-	_controller.go( {
-		"access" : "$this.ldap_functions.get_available_maillists&context=" + context,
-		"handler" : function( data )
-		{
-			handler_get_available_maillists( expresso.connector.unserialize( data ) );
-		}
+	ExpressoLivre.go( {
+		"access" : "expressoAdmin1_2.ldap_functions.get_available_maillists&context=" + context,
+		"handler" : handler_get_available_maillists
 	} );
 }
@@ -483,5 +478,5 @@
 			alert(data.msg);
 		else
-			alert(get_lang('Default password successful saved') + '.');
+			alert( ExpressoLivre.translate( 'Default password successful saved' )  + '.');
 		return;
 	}
@@ -496,5 +491,5 @@
 			alert(data.msg);
 		else
-			alert(get_lang('Users password successful returned') + '.');
+			alert( ExpressoLivre.translate( 'Users password successful returned' )  + '.');
 		return;
 	}
@@ -504,5 +499,5 @@
 function delete_user(uid, uidnumber)
 {
-	if (confirm(get_lang("Do you really want delete the user") + " " + uid + "?"))
+	if (confirm( ExpressoLivre.translate( "Do you really want delete the user" )  + " " + uid + "?"))
 	{
 		var handler_delete_user = function(data)
@@ -511,5 +506,5 @@
 				alert(data.msg);
 			else
-				alert(get_lang('User successful deleted') + '.');
+				alert( ExpressoLivre.translate( 'User successful deleted' )  + '.');
 			
 			location.href="./index.php?menuaction=expressoAdmin1_2.uiaccounts.list_users";
@@ -527,8 +522,8 @@
 		var reUid = /^([a-zA-Z0-9_\-])+$/;
 
-	new_uid = prompt(get_lang('Rename users login from') + ': ' + uid + " " + get_lang("to") + ': ', uid);
+	new_uid = prompt( ExpressoLivre.translate( 'Rename users login from' )  + ': ' + uid + " " +  ExpressoLivre.translate( "to" )  + ': ', uid);
 
 	if(!reUid.test(new_uid)){
-		alert(get_lang('LOGIN field contains characters not allowed') + '.');
+		alert( ExpressoLivre.translate( 'LOGIN field contains characters not allowed' )  + '.');
 		document.forms[0].account_lid.focus();
 		return;
@@ -563,5 +558,5 @@
 		alert(data.msg);
 	else{
-		alert(get_lang('User login successful renamed') + "\n" + data.exec_return);
+		alert( ExpressoLivre.translate( 'User login successful renamed' )  + "\n" + data.exec_return);
 		location.href="./index.php?menuaction=expressoAdmin1_2.uiaccounts.list_users";
 	}
@@ -579,5 +574,5 @@
 	clearTimeout(finderTimeout_maillist);
 	var oWait = document.getElementById("ea_span_searching_maillist");
-	oWait.innerHTML = get_lang('Searching') + '...';
+	oWait.innerHTML =  ExpressoLivre.translate( 'Searching' )  + '...';
 	finderTimeout_maillist = setTimeout("optionFinder_maillist('"+obj.id+"')",500);
 }
@@ -613,5 +608,5 @@
 	clearTimeout(finderTimeout_group);
 	var oWait = document.getElementById("ea_span_searching_group");
-	oWait.innerHTML = get_lang('Searching') + '...';
+	oWait.innerHTML =  ExpressoLivre.translate( 'Searching' )  + '...';
 	finderTimeout_group = setTimeout("optionFinder_group('"+obj.id+"')",500);
 }
@@ -671,5 +666,5 @@
 function empty_inbox(uid)
 {
-	var action = get_lang('Cleanned user mailbox');
+	var action =  ExpressoLivre.translate( 'Cleanned user mailbox' ) ;
 	var handler_write_log = function(){}
 	var handler_empty_inbox = function(data)
@@ -679,5 +674,5 @@
 		else{
 			cExecute ('$this.user.write_log_from_ajax&_action='+action+'&userinfo='+uid, handler_write_log);
-			alert(get_lang('Emptied')+' '+ data.inbox_size + ' ' + get_lang('MB from user inbox'));
+			alert( ExpressoLivre.translate( 'Emptied' ) +' '+ data.inbox_size + ' ' +  ExpressoLivre.translate( 'MB from user inbox' ) );
 			document.getElementById('mailquota_used').value = data.mailquota_used;
 		}
@@ -765,4 +760,2 @@
 		}
 }
-
-
