Index: branches/2.2/contactcenter/inc/class.ui_data.inc.php
===================================================================
--- branches/2.2/contactcenter/inc/class.ui_data.inc.php	(revision 3688)
+++ branches/2.2/contactcenter/inc/class.ui_data.inc.php	(revision 3795)
@@ -24,4 +24,5 @@
 		var $so_group;
 		var $typeContact;
+		var $preferences;
 
 		var $page_info = array(
@@ -80,4 +81,5 @@
 			else
 				$this -> typeContact = 'contacts';
+			$this->preferences = $_SESSION['phpgw_info']['user']['preferences']['contactcenter'];
 		}
 
@@ -330,6 +332,6 @@
 					return $this->get_photo($_GET['id']);
 
-				case 'get_visible_all_ldap':
-					echo $this->get_visible_all_ldap();
+				case 'get_init_values':
+					echo serialize(array("visible_all_ldap" => $this->get_visible_all_ldap(), "preferences"	=> $this->preferences));
 					return;
 
@@ -1463,4 +1465,9 @@
 
 				$i = 0;
+				if (!is_array($this->preferences))
+				{
+					$this->preferences['personCardEmail'] = 1;
+					$this->preferences['personCardPhone'] = 2;
+				}
 				foreach($contacts as $index => $contact)
 				{
@@ -1495,15 +1502,7 @@
 
 						//Para exibir o celular empresarial do empregado
-						if ($_SESSION['phpgw_info']['user']['preferences']['contactcenter']['voip_enabled'] && !$external && $final[3][$i][10] != 'none')
+						if ($this->preferences['voip_enabled'] && !$external && $final[3][$i][10] != 'none')
                                                             $final[3][$i][10] = "<a title=\"".lang("Call Mobile")."\" href=\"#\" onclick=\"connectVoip('".$final[3][$i][10]."', 'mob')\">".$final[3][$i][10]."</a>";
 
-						/* Select the correct Email and Telephone to be shown */
-						$preferences = ExecMethod('contactcenter.ui_preferences.get_preferences');
-
-						if (!is_array($preferences))
-						{
-							$preferences['personCardEmail'] = 1;
-							$preferences['personCardPhone'] = 2;
-						}
 						if ($contact['connections'])
 						{
@@ -1512,5 +1511,5 @@
 							foreach($contact['connections'] as $conn_info)
 							{
-								if ($conn_info['id_type'] == $preferences['personCardEmail'] and !$default_email_found)
+								if ($conn_info['id_type'] == $this->preferences['personCardEmail'] and !$default_email_found)
 								{
 									if ($conn_info['connection_is_default'])
@@ -1520,5 +1519,5 @@
 									$final[3][$i][4] = $conn_info['connection_value'] ? $conn_info['connection_value'] : 'none';
 								}
-								else if ($conn_info['id_type'] == $preferences['personCardPhone'] and !$default_phone_found)
+								else if ($conn_info['id_type'] == $this->preferences['personCardPhone'] and !$default_phone_found)
 								{
 									if ($conn_info['connection_is_default'])
@@ -1531,5 +1530,5 @@
 									//	$conn_info['connection_value'] = "<a title=\"".lang("Call Extension")."\" href=\"#\" onclick=\"connectVoip('".$conn_info['connection_value']."', 'ramal')\">".$conn_info['connection_value']."</a>";
 
-									if (!($_SESSION['phpgw_info']['user']['preferences']['contactcenter']['telephone_number'] == $conn_info['connection_value']) && $_SESSION['phpgw_info']['user']['preferences']['contactcenter']['voip_enabled'] && $conn_info['connection_value'] && preg_match('/^\([0-9]{2}\)[0-9]{4}\-[0-9]{4}$/',$conn_info['connection_value'])==1 && !$external){
+									if (!($this->preferences['telephone_number'] == $conn_info['connection_value']) && $this->preferences['contactcenter']['voip_enabled'] && $conn_info['connection_value'] && preg_match('/^\([0-9]{2}\)[0-9]{4}\-[0-9]{4}$/',$conn_info['connection_value'])==1 && !$external){
 										$conn_info['connection_value'] = "<a title=\"".lang("Call Extension")."\" href=\"#\" onclick=\"connectVoip('".$conn_info['connection_value']."', 'com')\">".$conn_info['connection_value']."</a>";
  									
@@ -3317,6 +3316,4 @@
 			}
 
-			$prefs = ExecMethod('contactcenter.ui_preferences.get_preferences');
-
 			$jsCode = array();
 			$count = 0;
@@ -3354,5 +3351,5 @@
 
 							foreach ($value as $connection)		{
-								if ($connection['id_type'] == $prefs['personCardEmail'])	{
+								if ($connection['id_type'] == $this->preferences['personCardEmail'])	{
 									$jsCode[] = '_this.entries.options[_this.entries.options.length] = new Option("'.$name.' <'.$connection['connection_value'].'>", "'.$count.'");';
 									$count++;
Index: branches/2.2/contactcenter/js/ccMain.js
===================================================================
--- branches/2.2/contactcenter/js/ccMain.js	(revision 3644)
+++ branches/2.2/contactcenter/js/ccMain.js	(revision 3795)
@@ -1,4 +1,4 @@
 var last_id = 0;	
-
+var preferences = null;
 function openwindow(url){ 	
 	var window_features = 	"scrollbars=yes,resizable=yes,location=no,menubar=no," + 
@@ -43,7 +43,9 @@
 		try
 		{
-			function ViewLdap(data)
+			function handlerInitValues(sdata)
 			{
-				if( boolData = eval(data) )
+				var data = unserialize(sdata);
+				preferences = data.preferences;
+				if( boolData = eval(data.visible_all_ldap) )
 				{
 					ccTree = new ccCatalogTree({name: 'ccTree', id_destination: 'cc_tree', afterSetCatalog: 'ccSearchHidePanel(); updateCards()'});
@@ -62,5 +64,5 @@
 			}
 
-			Connector.newRequest('ViewLdap', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_visible_all_ldap', 'GET', ViewLdap);		
+			Connector.newRequest('handlerInitValues', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_init_values', 'GET', handlerInitValues);		
 			
 			ccTree.Connector = Connector;						
