Index: /branches/2.2/contactcenter/inc/class.so_group.inc.php
===================================================================
--- /branches/2.2/contactcenter/inc/class.so_group.inc.php	(revision 3217)
+++ /branches/2.2/contactcenter/inc/class.so_group.inc.php	(revision 3322)
@@ -117,4 +117,12 @@
 						. ' phpgw_cc_contact.names_ordered,'
 						. ' phpgw_cc_contact.alias,'
+						. ' phpgw_cc_contact.birthdate,'
+						. ' phpgw_cc_contact.sex,'
+						. ' phpgw_cc_contact.pgp_key,'
+						. ' phpgw_cc_contact.notes,'
+						. ' phpgw_cc_contact.web_page,'
+						. ' phpgw_cc_contact.corporate_name,'
+						. ' phpgw_cc_contact.job_title,'
+						. ' phpgw_cc_contact.department,'
 						. ' phpgw_cc_connections.connection_name,'
 						. ' phpgw_cc_connections.connection_value,'
@@ -122,4 +130,5 @@
 						. ' phpgw_cc_contact_addrs.id_typeof_contact_address,'
 						. ' phpgw_cc_addresses.address1,'
+						. ' phpgw_cc_addresses.address2,'
 						. ' phpgw_cc_addresses.complement,'
 						. ' phpgw_cc_addresses.postal_code,'
@@ -189,4 +198,12 @@
 						'id_connection' => '',
 						'alias' => '',
+						'birthdate' => '',
+						'sex' => '',
+						'pgp_key' => '',
+						'notes' => '',
+						'web_page' => '',
+						'corporate_name' => '',
+						'job_title' => '',
+						'department' => '',				
 						'main-mail' => '',
 						'aternative-mail' => '',
@@ -198,4 +215,8 @@
 						'business-state_name' => '',
 						'business-id_country' => '',
+						'business-fax' => '',
+						'business-pager' => '',
+						'business-mobile' => '',
+						'business-address-2' => '',
 						'home-phone' => '',
 						'home-address' => '',
@@ -204,5 +225,9 @@
 						'home-city_name' => '',
 						'home-state_name' => '',
-						'home-id_country' => ''
+						'home-fax' => '',
+						'home-pager' => '',
+						'home-address-2' => ''
+						
+						
 					);
 
@@ -233,4 +258,19 @@
 							case 'trabalho' :
 								$all_contacts[ $object[ 'id_contact' ] ][ 'business-phone' ] = $object[ 'connection_value' ];
+								break;								
+							case 'fax' :
+								$all_contacts[ $object[ 'id_contact' ] ][ 'home-fax' ] = $object[ 'connection_value' ];
+								break;
+							case 'pager' :
+								$all_contacts[ $object[ 'id_contact' ] ][ 'home-pager' ] = $object[ 'connection_value' ];
+								break;
+							case 'celular corporativo' :
+								$all_contacts[ $object[ 'id_contact' ] ][ 'business-mobile' ] = $object[ 'connection_value' ];
+								break;								
+							case 'pager corporativo' :
+								$all_contacts[ $object[ 'id_contact' ] ][ 'business-pager' ] = $object[ 'connection_value' ];
+								break;
+							case 'fax corporativo' :
+								$all_contacts[ $object[ 'id_contact' ] ][ 'business-fax' ] = $object[ 'connection_value' ];
 								break;
 						}
@@ -241,5 +281,13 @@
 				$all_contacts[ $object[ 'id_contact' ] ][ 'id_contact' ]    = $object[ 'id_contact' ];
 				$all_contacts[ $object[ 'id_contact' ] ][ 'id_connection' ] = $object[ 'id_connection' ];
-				$all_contacts[ $object[ 'id_contact' ] ][ 'alias' ]         = $object[ 'alias' ];
+				$all_contacts[ $object[ 'id_contact' ] ][ 'alias' ]         = $object[ 'alias' ];				
+				$all_contacts[ $object[ 'id_contact' ] ][ 'birthdate' ] 	= $object[ 'birthdate' ];
+				$all_contacts[ $object[ 'id_contact' ] ][ 'sex' ]    		= $object[ 'sex' ];
+				$all_contacts[ $object[ 'id_contact' ] ][ 'pgp_key' ] 		= $object[ 'pgp_key' ];
+				$all_contacts[ $object[ 'id_contact' ] ][ 'notes' ]         = $object[ 'notes' ];
+				$all_contacts[ $object[ 'id_contact' ] ][ 'web_page' ] 		= $object[ 'web_page' ];
+				$all_contacts[ $object[ 'id_contact' ] ][ 'corporate_name' ]= $object[ 'corporate_name' ];
+				$all_contacts[ $object[ 'id_contact' ] ][ 'job_title' ] 	= $object[ 'job_title' ];
+				$all_contacts[ $object[ 'id_contact' ] ][ 'department' ]    = $object[ 'department' ];
 
 				switch( $object[ 'id_typeof_contact_address' ] )
@@ -247,4 +295,5 @@
 					case 1 :
 						$all_contacts[ $object[ 'id_contact' ] ][ 'business-address' ]     = $object[ 'address1' ];
+						$all_contacts[ $object[ 'id_contact' ] ][ 'business-address-2' ]   = $object[ 'address2' ];
 						$all_contacts[ $object[ 'id_contact' ] ][ 'business-complement' ]  = $object[ 'complement' ];
 						$all_contacts[ $object[ 'id_contact' ] ][ 'business-postal_code' ] = $object[ 'postal_code' ];
@@ -255,4 +304,5 @@
 					case 2 :
 						$all_contacts[ $object[ 'id_contact' ] ][ 'home-address' ]     = $object[ 'address1' ];
+						$all_contacts[ $object[ 'id_contact' ] ][ 'home-address-2' ]   = $object[ 'address2' ];
 						$all_contacts[ $object[ 'id_contact' ] ][ 'home-complement' ]  = $object[ 'complement' ];
 						$all_contacts[ $object[ 'id_contact' ] ][ 'home-postal_code' ] = $object[ 'postal_code' ];
Index: /branches/2.2/contactcenter/inc/class.bo_people_catalog.inc.php
===================================================================
--- /branches/2.2/contactcenter/inc/class.bo_people_catalog.inc.php	(revision 1517)
+++ /branches/2.2/contactcenter/inc/class.bo_people_catalog.inc.php	(revision 3322)
@@ -1080,13 +1080,64 @@
 				$preferences['personCardPhone'] = 2;
 			}
+			if(!$data['is_quick_add']){			
+				$sql = "select * FROM phpgw_cc_state where (upper(state_name) = upper('".$data['addresses']['address_corporative']['id_state']."')) or (upper(state_symbol) = upper('".$data['addresses']['address_corporative']['id_state']."'))";	
+							
+				$this->db->query($sql, __LINE__, __FILE__);
+				
+				$corporative_state = array('id_state'=>2);
+				while($this->db->next_record())
+				{
+					$corporative_state = $this->db->row(); 
+				}
+				
+				$sql = "select * FROM phpgw_cc_city where id_state = ".$corporative_state['id_state']." and upper(city_name) = upper('".$data['addresses']['address_corporative']['id_city']."') ";
+										
+				$this->db->query($sql, __LINE__, __FILE__);
+				
+				$corporative_city = array('id_city'=>null);
+				while($this->db->next_record())
+				{
+					$corporative_city = $this->db->row(); 
+				}
+				
+				//Personal Address
+				
+				$sql = "select * FROM phpgw_cc_state where upper(state_name) = upper('".$data['addresses']['address_personal']['id_state']."')";	
+							
+				$this->db->query($sql, __LINE__, __FILE__);
+				
+				$personal_state = array('id_state'=>2);
+				while($this->db->next_record())
+				{
+					$personal_state = $this->db->row(); 
+				}
+				
+				$sql = "select * FROM phpgw_cc_city where id_state = ".$personal_state['id_state']." and upper(city_name) = upper('".$data['addresses']['address_personal']['id_city']."') ";
+										
+				$this->db->query($sql, __LINE__, __FILE__);
+				
+				$personal_city = array('id_city'=>null);
+				while($this->db->next_record())
+				{
+					$personal_city = $this->db->row(); 
+				}
+			}
 			
 			$new_data = array(
-				'alias'			=> $data['alias'],
-				'id_status'		=> 1,
-				'given_names'		=> $data['given_names'],
-				'family_names'		=> $data['family_names'],
-				'names_ordered'		=> $data['given_names'].' '.$data['family_names'],
-				'birthdate'		=> $data['birthdate'],
-				'notes'			=> $data['notes'],
+				'notes'              => $data['notes'],
+				'alias'              => $data['alias'],
+				'id_status'          => 1,
+				'given_names'        => $data['given_names'],
+				'family_names'       => $data['family_names'],
+				'names_ordered'      => $data['given_names'].' '.$data['family_names'],
+				'family_names'       => $data['family_names'],
+				'alias'       	 	 => $data['alias'],
+				'corporate_name'     => $data['corporate_name'],
+				'job_title'       	 => $data['job_title'],
+				'department'       	 => $data['department'],
+				'web_page'       	 => $data['web_page'],
+				'birthdate'			 => $data['birthdate'],
+				'pgp_key'       	 => $data['pgp_key'],
+				'sex'       	 	 => $data['sex'],
 			);
 
@@ -1102,5 +1153,16 @@
 				$i++;
 			}
-
+			
+			if ($data['connections']['aditional_email']['connection_value'])
+			{
+		 		$new_data['connections']['connection'.$i] = array(
+			 		'id_typeof_connection'  => $preferences['personCardEmail'],
+			 		'connection_name'       => $data['connections']['aditional_email']['connection_name'],
+			 		'connection_value'      => $data['connections']['aditional_email']['connection_value'],
+			 		'connection_is_default' => 0,
+		 		);
+				$i++;
+			}
+							
 			if ($data['connections']['default_phone']['connection_value'])
 			{
@@ -1111,64 +1173,64 @@
 			 		'connection_is_default' => 1,
 		 		);
+				
+				
+				foreach($data['connections']['aditional_phone'] as $connection_name => $connection_fields)
+				{
+					if($connection_fields['connection_value'] != ''){
+						$i++;
+						$new_data['connections']['connection'.$i] = array(
+				 		'id_typeof_connection'  => $preferences['personCardPhone'],
+				 		'connection_name'       => $connection_fields['connection_name'],
+				 		'connection_value'      => $connection_fields['connection_value'],
+				 		'connection_is_default' => 0,
+			 			);
+					}					
+				}
+				
+			}else{
+				$default =1;
+				foreach($data['connections']['aditional_phone'] as $connection_name => $connection_fields)
+				{
+					$i++;
+					$new_data['connections']['connection'.$i] = array(
+			 		'id_typeof_connection'  => $preferences['personCardPhone'],
+			 		'connection_name'       => $connection_fields['connection_name'],
+			 		'connection_value'      => $connection_fields['connection_value'],
+			 		'connection_is_default' => $default,
+		 			);
+					$default = 0;					
+				}
+			}
+			if(!$data['is_quick_add']){			
+		 		$new_data['addresses']['address'.$i] = array(
+			 		'id_typeof_address'  => 2,
+			 		'address1'       => $data['addresses']['address_personal']['address1'],
+					'address2'       => $data['addresses']['address_personal']['address2'],
+					'complement'     => $data['addresses']['address_personal']['complement'],
+			 		'postal_code'    => $data['addresses']['address_personal']['postal_code'],
+					'id_country'	 => $data['addresses']['address_personal']['id_country'],
+					'id_state'		 => $personal_state['id_state'],
+					'id_city'		 => $personal_city['id_city'],
+			 		'address_is_default' => 0,
+		 		);
 				$i++;
-			}
-
-			if($data['connections']['fax']['connection_value'])
-			{
-				$new_data['connections']['connection'.$i] = array(
-					'id_typeof_connection'  => $preferences['personCardPhone'],
-					'connection_name'       => $data['connections']['fax']['connection_name'],
-					'connection_value'      => $data['connections']['fax']['connection_value'],
-					'connection_is_default' => 'false',
-				);
+			
+		 		$new_data['addresses']['address'.$i] = array(
+			 		'id_typeof_address'  => 1,
+			 		'address1'       => $data['addresses']['address_corporative']['address1'],
+					'address2'       => $data['addresses']['address_corporative']['address2'],
+					'complement'     => $data['addresses']['address_corporative']['complement'],
+			 		'postal_code'    => $data['addresses']['address_corporative']['postal_code'],
+					'id_country'	 => $data['addresses']['address_corporative']['id_country'],
+					'id_state'		 => $corporative_state['id_state'],
+					'id_city'		 => $corporative_city['id_city'],
+			 		'address_is_default' => 1,
+		 		);							
 				$i++;
 			}
 
-			if($data['connections']['residencial_phone']['connection_value'])
-			{
-				$new_data['connections']['connection'.$i] = array(
-					'id_typeof_connection'  => $preferences['personCardPhone'],
-					'connection_name'       => $data['connections']['residencial_phone']['connection_name'],
-					'connection_value'      => $data['connections']['residencial_phone']['connection_value'],
-					'connection_is_default' => 'false',
-				);
-				$i++;
-			}
-
-			if($data['connections']['cellular_phone']['connection_value'])
-			{
-				$new_data['connections']['connection'.$i] = array(
-					'id_typeof_connection'  => $preferences['personCardPhone'],
-					'connection_name'       => $data['connections']['cellular_phone']['connection_name'],
-					'connection_value'      => $data['connections']['cellular_phone']['connection_value'],
-					'connection_is_default' => 'false',
-				);
-				$i++;
-			}
-
-			if($data['connections']['pager']['connection_value'])
-			{
-				$new_data['connections']['connection'.$i] = array(
-					'id_typeof_connection'  => $preferences['personCardPhone'],
-					'connection_name'       => $data['connections']['pager']['connection_name'],
-					'connection_value'      => $data['connections']['pager']['connection_value'],
-					'connection_is_default' => 'false',
-				);
-				$i++;
-			}
-
-			if($data['connections']['alternative_email']['connection_value'])
-			{
-				$new_data['connections']['connection'.$i] = array(
-					'id_typeof_connection'  => $preferences['personCardEmail'],
-					'connection_name'       => $data['connections']['alternative_email']['connection_name'],
-					'connection_value'      => $data['connections']['alternative_email']['connection_value'],
-					'connection_is_default' => 'false',
-				);
-				$i++;
-			}
 			$j = 1;
 
-			if($data['addresses']['addr1']['address_value'])
+			/*if($data['addresses']['addr1']['address_value'])
 			{
 				$new_data['addresses']['address'.$j] = array(
@@ -1185,5 +1247,5 @@
 				);
 				$j++;
-			}
+			}*/
 
 
Index: /branches/2.2/contactcenter/inc/class.ui_data.inc.php
===================================================================
--- /branches/2.2/contactcenter/inc/class.ui_data.inc.php	(revision 3313)
+++ /branches/2.2/contactcenter/inc/class.ui_data.inc.php	(revision 3322)
@@ -1710,5 +1710,4 @@
 			/*Corporative*/
 			if($GLOBALS['phpgw_info']['server']['personal_contact_type']=='True'){
-				$data['personal']['cc_name_corporate'] = $entry['corporate_name'];
 				$data['personal']['cc_job_title'] = $entry['job_title'];
 				$data['personal']['cc_department'] = $entry['department'];
@@ -3525,47 +3524,127 @@
 				case 'outlook_en':
 					$streamBuffer = "Name;E-mail Address;Notes;Mobile Phone;Pager;Company;".
-					"Job Title;Home Phone;Home Fax;Business Phone;Business Fax\r\n";							
-
+							"Job Title;Home Phone;Home Fax;Business Phone;Business Fax\r\n";							
 					foreach($contacts as $index => $object){
-						$streamBuffer.= $object['names_ordered'].";".$object['connection_value'].";;;;;;".$object['phone'].";;;\r\n";
+						$streamBuffer.= "\"".$object[ 'names_ordered'] . "\";"
+							. "\"".$object[ 'main-mail' ] . "\";"
+							. "\"".str_replace("\r\n\x0a","\t",$object[ 'notes' ]) . "\";"
+							. "\"".$object[ 'mobile' ] . "\";"
+							. "\"".$object[ 'business-pager' ] . "\";"
+							. "\"".$object[ 'corporate_name' ] . "\";"
+							. "\"".$object[ 'job_title' ] . "\";"
+							. "\"".$object[ 'home-phone' ] . "\";"
+							. "\"".$object[ 'home-fax' ] . "\";"
+							. "\"".$object[ 'business-phone' ] . "\";"
+							. "\"".$object[ 'business-fax' ] . "\"\r\n";
 					}
 					break;
 
 				case 'outlook_pt-BR':
-					$streamBuffer = "Nome;End. de email;Endereï¿œo residencial;".
-					"Cidade do endereï¿œo residencial;CEP do endereï¿œo residencial;".
-					"Estado;Paï¿œs/regiï¿œo do endereï¿œo residencial;Telefone residencial;".
-					"Rua do endereï¿œo comercial;Cidade do endereï¿œo comercial;".
-					"CEP do endereï¿œo comercial;Estado do endereï¿œo comercial;".
-					"Paï¿œs/regiï¿œo do endereï¿œo comercial;Telefone comercial;Empresa;Cargo\r\n";
+					$streamBuffer = "Nome;Sobrenome;Segundo nome;Nome;Apelido;End. de email;Endereço residencial;"
+									."Cidade do endereço residencial;CEP do endereço residencial;Estado;País/região do endereço residencial;"
+									."Telefone residencial;Fax residencial;Telefone celular;Página pessoal da Web;Rua do endereço comercial;"
+									."Cidade do endereço comercial;CEP do endereço comercial;Estado do endereço comercial;"
+									."País/região do endereço comercial;Página comercial da Web;Telefone comercial;Fax comercial;Pager;Empresa;"
+									."Cargo;Departamento;End. comercial;Observações\r\n";
 
 					foreach($contacts as $index => $object){
-						$streamBuffer.= $object['names_ordered'].";".$object['connection_value'].";;;;;;".$object['phone'].";;;;;;;;\r\n";
+						$streamBuffer.= "\"".$object[ 'names_ordered'] . "\";"
+							.";;;"
+							. "\"".$object[ 'alias' ] . "\";"
+							. "\"".$object[ 'main-mail' ] . "\";"
+							. "\"".$object[ 'home-address' ] . "\";"
+							. "\"".$object[ 'home-city_name' ] . "\";"
+							. "\"".$object[ 'home-postal_code' ] . "\";"
+							. "\"".$object[ 'home-state_name' ] . "\";"
+							. "\"".$object[ 'home-id_country' ] . "\";"
+							. "\"".$object[ 'home-phone' ] . "\";"
+							. "\"".$object[ 'home-fax' ] . "\";"
+							. "\"".$object[ 'mobile' ] . "\";"
+							. "\"".$object[ 'web_page' ] . "\";"
+							. "\"".$object[ 'business-address' ] . "\";"
+							. "\"".$object[ 'business-city_name' ] . "\";"
+							. "\"".$object[ 'business-postal_code' ] . "\";"
+							. "\"".$object[ 'business-state_name' ] . "\";"
+							. "\"".$object[ 'business-id_country' ] . "\";"
+							. "\"".$object[ 'web_page' ] . "\";"
+							. "\"".$object[ 'business-phone' ] . "\";"
+							. "\"".$object[ 'business-fax' ] . "\";"
+							. "\"".$object[ 'business-pager' ] . "\";"
+							. "\"".$object[ 'corporate_name' ] . "\";"
+							. "\"".$object[ 'job_title' ] . "\";"
+							. "\"".$object[ 'department' ] . "\";"
+							.";"
+							. "\"".str_replace("\r\n\x0a","\t",$object[ 'notes' ]) . "\"\r\n";
 					}
+
 				break;
 
 				case 'outlook2000_pt-BR':
 					$streamBuffer = "\"Tratamento\",\"Nome\",\"Segundo Nome\",\"Sobrenome\",\"Sufixo\",".
-					"\"Empresa\",\"Departamento\",\"Cargo\",\"Rua do endereï¿œo comercial\",\"Rua do endereï¿œo comercial 2\",".
-					"\"Rua do endereï¿œo comercial 3\",\"Cidade do endereï¿œo comercial\",\"Estado do endereï¿œo comercial\",".
-					"\"CEP do endereï¿œo comercial\",\"Paï¿œs do endereï¿œo comercial\",\"Endereï¿œo residencial\",\"Rua residencial 2\",".
-					"\"Rua residencial 3\",\"Cidade do endereï¿œo residencial\",\"Estado\",\"CEP do endereï¿œo residencial\",\"Paï¿œs do endereï¿œo residencial\",".
-					"\"Outro endereï¿œo\",\"Outro endereï¿œo 2\",\"Outro endereï¿œo 3\",\"Cidade\",\"Estado\",\"CEP\",\"Paï¿œs\",".
+					"\"Empresa\",\"Departamento\",\"Cargo\",\"Rua do endereço comercial\",\"Rua do endereço comercial 2\",".
+					"\"Rua do endereço comercial 3\",\"Cidade do endereço comercial\",\"Estado do endereço comercial\",".
+					"\"CEP do endereço comercial\",\"País do endereço comercial\",\"Endereço residencial\",\"Rua residencial 2\",".
+					"\"Rua residencial 3\",\"Cidade do endereço residencial\",\"Estado\",\"CEP do endereço residencial\",\"País do endereço residencial\",".
+					"\"Outro endereço\",\"Outro endereço 2\",\"Outro endereço 3\",\"Cidade\",\"Estado\",\"CEP\",\"País\",".
 					"\"Telefone do assistente\",\"Fax comercial\",\"Telefone comercial\",\"Telefone comercial 2\",\"Retorno de chamada\",".
 					"\"Telefone do carro\",\"Telefone principal da empresa\",\"Fax residencial\",\"Telefone residencial\",".
 					"\"Telefone residencial 2\",\"ISDN\",\"Telefone celular\",\"Outro fax\",\"Outro telefone\",\"Pager\",\"Telefone principal\",".
-					"\"Radiofone\",\"Telefone TTY/TDD\",\"Telex\",\"Aniversï¿œrio\",\"Anotaï¿œï¿œes\",\"Caixa postal\",\"Categorias\",".
-					"\"Cï¿œdigo da empresa\",\"Cï¿œdigo do governo\",\"Cï¿œnjuge\",\"Conta\",\"Endereï¿œo de correio eletrï¿œnico\",".
-					"\"Nome de exibiï¿œï¿œo do correio eletr.\",\"Endereï¿œo de correio eletrï¿œnico 2\",".
-					"\"Nome de exibiï¿œï¿œo do correio eletr.2\",\"Endereï¿œo de correio eletrï¿œnico 3\",".
-					"\"Nome de exibiï¿œï¿œo do correio eletr.3\",\"Datas especiais\",\"Disponibilidade da Internet\",".
-					"\"Filhos\",\"Hobby\",\"Idioma\",\"Indicaï¿œï¿œo\",\"Informaï¿œï¿œes para cobranï¿œa\",\"Iniciais\",\"Local\",".
-					"\"Nome do assistente\",\"Nome do gerenciador\",\"Pï¿œgina da Web\",\"Palavras-chave\",\"Particular\",\"Personalizado 1\",\"Personalizado 2\",".
-					"\"Personalizado 3\",\"Personalizado 4\",\"Prioridade\",\"Profissï¿œo\",\"Quilometragem\",\"Sala\",\"Sensibilidade\",\"Servidor de diretï¿œrio\",".
+					"\"Radiofone\",\"Telefone TTY/TDD\",\"Telex\",\"Aniversário\",\"Anotações\",\"Caixa postal\",\"Categorias\",".
+					"\"Código da empresa\",\"Código do governo\",\"Cônjuge\",\"Conta\",\"Endereço de correio eletrônico\",".
+					"\"Nome de exibição do correio eletr.\",\"Endereço de correio eletrônico 2\",".
+					"\"Nome de exibição do correio eletr.2\",\"Endereço de correio eletrônico 3\",".
+					"\"Nome de exibição do correio eletr.3\",\"Datas especiais\",\"Disponibilidade da Internet\",".
+					"\"Filhos\",\"Hobby\",\"Idioma\",\"Indicação\",\"Informações para cobrança\",\"Iniciais\",\"Local\",".
+					"\"Nome do assistente\",\"Nome do gerenciador\",\"Página da Web\",\"Palavras-chave\",\"Particular\",\"Personalizado 1\",\"Personalizado 2\",".
+					"\"Personalizado 3\",\"Personalizado 4\",\"Prioridade\",\"Profissão\",\"Quilometragem\",\"Sala\",\"Sensibilidade\",\"Servidor de diretório\",".
 					"\"Sexo\"\r\n";
 
+
+
 					foreach($contacts as $index => $object){
-						$streamBuffer.= ",\"".$object['names_ordered']."\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,".$object['phone'].",,,,,,,,,,,,\"".$object['connection_value']."\",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\r\n";
-					}
+	                        $streamBuffer .= "\"".$object[ 'alias' ] . "\","	                            
+								. "\"".$object[ 'names_ordered' ] . "\","
+								.",,,"
+								. "\"".$object[ 'corporate_name' ] . "\","
+								. "\"".$object[ 'department' ] . "\","
+								. "\"".$object[ 'job_title' ] . "\","
+								. "\"".$object[ 'business-address' ] . "\","
+								. "\"".$object[ 'business-address-2' ] . "\","
+								.","
+								. "\"".$object[ 'business-city_name' ] . "\","
+								. "\"".$object[ 'business-state' ] . "\","
+								. "\"".$object[ 'business-postal_code' ] . "\","
+								. "\"".$object[ 'business-id_country' ] . "\","
+								. "\"".$object[ 'home-address' ] . "\","
+								. "\"".$object[ 'home-address-2' ] . "\","
+								.","
+								. "\"".$object[ 'home-city_name' ] . "\","
+								. "\"".$object[ 'home-state_name' ] . "\","
+								. "\"".$object[ 'home-postal_code' ] . "\","
+								. "\"".$object[ 'home-id_country' ] . "\","
+								.",,,,,,,,"
+								. "\"".$object[ 'business-fax' ] . "\","
+								. "\"".$object[ 'business-phone' ] . "\","
+								. "\"".$object[ 'business-mobile' ] . "\","
+								.",,,"
+								. "\"".$object[ 'home-fax' ] . "\","
+								. "\"".$object[ 'home-phone' ] . "\","
+								.",,"
+								. "\"".$object[ 'mobile' ] . "\","
+								.",,"
+								. "\"".$object[ 'home-pager' ] . "\","
+								. "\"".$object[ 'business-phone' ] . "\","
+								.",,,"
+								. "\"".$object[ 'birthdate' ] . "\","
+								. "\"".str_replace("\r\n\x0a","\t",$object[ 'notes' ]) . "\","
+								.",,,,,,"
+								. "\"".$object[ 'main-mail' ] . "\","
+								.","
+								. "\"".$object[ 'alternative-mail' ] . "\","
+								.",,,,,,,,,,,,,,"
+								. "\"".$object[ 'web_page' ] . "\","
+								.",,,,,,,,,,,,"
+								. "\"".$object[ 'sex' ] . "\"\r\n";								
+	                    }
 				break;
 
@@ -3583,44 +3662,140 @@
 
 					foreach($contacts as $index => $object){
-						$streamBuffer.= ",".$object['names_ordered'].",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,".$object['phone'].",,,,,,,,,,,,".$object['connection_value'].",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\r\n";
+						$streamBuffer.= "\"".$object[ 'alias' ] . "\","
+							. "\"".$object[ 'names_ordered'] . "\","
+							.",,,"
+							. "\"".$object[ 'corporate_name' ] . "\","
+							. "\"".$object[ 'department' ] . "\","
+							. "\"".$object[ 'job_title' ] . "\","
+							. "\"".$object[ 'business-address' ] . "\","
+							. "\"".$object[ 'business-address-2' ] . "\","
+							.","
+							. "\"".$object[ 'business-city_name' ] . "\","
+							. "\"".$object[ 'business-state' ] . "\","
+							. "\"".$object[ 'business-postal_code' ] . "\","
+							. "\"".$object[ 'business-id_country' ] . "\","
+							. "\"".$object[ 'home-address' ] . "\","
+							. "\"".$object[ 'home-address-2' ] . "\","
+							.","
+							. "\"".$object[ 'home-city_name' ] . "\","
+							. "\"".$object[ 'home-state_name' ] . "\","
+							. "\"".$object[ 'home-postal_code' ] . "\","
+							. "\"".$object[ 'home-id_country' ] . "\","
+							.",,,,,,,,"
+							. "\"".$object[ 'business-fax' ] . "\","
+							. "\"".$object[ 'business-phone' ] . "\","
+							. "\"".$object[ 'business-mobile' ] . "\","
+							.",,,"
+							. "\"".$object[ 'home-fax' ] . "\","
+							. "\"".$object[ 'home-phone' ] . "\","
+							.",,"
+							. "\"".$object[ 'mobile' ] . "\","
+							.",,"
+							. "\"".$object[ 'business-pager' ] . "\","
+							. "\"".$object[ 'home-pager' ] . "\","
+							.",,,,,,,,"
+							. "\"".$object[ 'birthdate' ] . "\","
+							.",,,"
+							. "\"".$object[ 'main-mail' ] . "\","
+							.",,"
+							. "\"".$object[ 'alternative-mail' ] . "\","
+							.",,,,,,,,,,,,,,,"
+							. "\"".str_replace("\r\n\x0a","\t",$object[ 'notes' ]) . "\","
+							.",,,,,,,,,,,,,"
+							. "\"".$object[ 'web_page' ] . "\"\r\n";
+
 					}
 				break;
 
 				case 'thunderbird':
-					$streamBuffer = "\n";
+					$streamBuffer = "First Name,Last Name,Display Name,Nickname,Primary Email,Secondary Email,"
+						."Screen Name,Work Phone,Home Phone,Fax Number,Pager Number,Mobile Number,Home Address,"
+						."Home Address 2,Home City,Home State,Home ZipCode,Home Country,Work Address,Work Address 2,"
+						."Work City,Work State,Work ZipCode,Work Country,Job Title,Department,Organization,Web Page 1,"
+						."Web Page 2,Birth Year,Birth Month,Birth Day,Custom 1,Custom 2,Custom 3,Custom 4,Notes,\n";
 
 					foreach($contacts as $index => $object){
-						$streamBuffer.= ",,".$object['names_ordered'].",,".$object['connection_value'].",,".$object['phone'].",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,\r\n";
+						$array_birth = explode("-",$object[ 'birthdate' ]);
+						$streamBuffer.= "\"".$object[ 'names_ordered'] . "\","
+							.",,"
+							. "\"".$object[ 'alias' ] . "\","
+							. "\"".$object[ 'main-mail' ] . "\","
+							. "\"".$object[ 'alternative-mail' ] . "\","
+							.","
+							. "\"".$object[ 'business-phone' ] . "\","
+							. "\"".$object[ 'home-phone' ] . "\","
+							. "\"".$object[ 'business-fax' ] . "\","
+							. "\"".$object[ 'business-pager' ] . "\","
+							. "\"".$object[ 'mobile' ] . "\","
+							. "\"".$object[ 'home-address' ] . "\","
+							. "\"".$object[ 'home-address-2' ] . "\","
+							. "\"".$object[ 'home-city_name' ] . "\","
+							. "\"".$object[ 'home-state_name' ] . "\","
+							. "\"".$object[ 'home-postal_code' ] . "\","
+							. "\"".$object[ 'home-id_country' ] . "\","
+							. "\"".$object[ 'business-address' ] . "\","
+							. "\"".$object[ 'business-address-2' ] . "\","
+							. "\"".$object[ 'business-city_name' ] . "\","
+							. "\"".$object[ 'business-state_name' ] . "\","
+							. "\"".$object[ 'business-postal_code' ] . "\","
+							. "\"".$object[ 'business-id_country' ] . "\","
+							. "\"".$object[ 'job_title' ] . "\","
+							. "\"".$object[ 'department' ] . "\","
+							. "\"".$object[ 'corporate_name' ] . "\","
+							. "\"".$object[ 'web_page' ] . "\","
+							. "\"".$object[ 'web_page' ] . "\","
+							. "\"".$array_birth[0] . "\","
+							. "\"".$array_birth[1] . "\","
+							. "\"".$array_birth[2] . "\","
+							.",,,,"
+							. "\"".str_replace("\r\n\x0a","\t",$object[ 'notes' ]) . "\",\r\n";
+
 					}
 				break;
 
 				case 'expresso':
-					$streamBuffer = 'Nome,Apelido,E-mail Principal,E-mail Alternativo,Celular,'
-						. 'Telefone Comercial,Endereço Comercial,Complemento End. Comercial,CEP Comercial,Cidade End. Comercial,Estado End. Comercial,País End. Comercial,'
-						. 'Telefone Residencial,Endereço Residencial,Complemento End. Residencial,CEP Residencial,Cidade End. Residencial,Estado End. Residencial,País End. Residencial'
-						. "\r\n";
-
-					foreach($contacts as $index => $object){
-						$streamBuffer .= $object[ 'names_ordered'] . ','
-							. $object[ 'alias' ] . ','
-							. $object[ 'main-mail' ] . ','
-							. $object[ 'alternative-mail' ] . ','
-							. $object[ 'mobile' ] . ','
-							. $object[ 'business-phone' ] . ','
-							. $object[ 'business-address' ] . ','
-							. $object[ 'business-complement' ] . ','
-							. $object[ 'business-postal_code' ] . ','
-							. $object[ 'business-city_name' ] . ','
-							. $object[ 'business-state_name' ] . ','
-							. $object[ 'business-id_country' ] . ','
-							. $object[ 'home-phone' ] . ','
-							. $object[ 'home-address' ] . ','
-							. $object[ 'home-complement' ] . ','
-							. $object[ 'home-postal_code' ] . ','
-							. $object[ 'home-city_name' ] . ','
-							. $object[ 'home-state_name' ] . ','
-							. $object[ 'home-id_country' ] . "\r\n";
-					}
-				break;
+	                    $streamBuffer = 'Nome,Apelido,E-mail Principal,E-mail Alternativo,Celular,'
+	                        . 'Telefone Comercial,Endereço Comercial,Complemento End. Comercial,CEP Comercial,Cidade End. Comercial,Estado End. Comercial,País End. Comercial,'
+	                        . 'Telefone Residencial,Endereço Residencial,Complemento End. Residencial,CEP Residencial,Cidade End. Residencial,Estado End. Residencial,País End. Residencial,'
+	                        . 'Aniversário,Sexo,Assinatura GPG,Notas,Página Web,Empresa,Cargo,Departamento,Fax Comercial,Pager Comercial,Celular Comercial,Fax,Pager,Endereço Comercial 2,Endereço Residencial 2'
+							. "\r\n";
+
+	                    foreach($contacts as $index => $object){
+	                        $streamBuffer .= "\"".$object[ 'names_ordered'] . "\","
+	                            . "\"".$object[ 'alias' ] . "\","
+	                            . "\"".$object[ 'main-mail' ] . "\","
+	                            . "\"".$object[ 'alternative-mail' ] . "\","
+	                            . "\"".$object[ 'mobile' ] . "\","
+	                            . "\"".$object[ 'business-phone' ] . "\","
+	                            . "\"".$object[ 'business-address' ] . "\","
+	                            . "\"".$object[ 'business-complement' ] . "\","
+	                            . "\"".$object[ 'business-postal_code' ] . "\","
+	                            . "\"".$object[ 'business-city_name' ] . "\","
+	                            . "\"".$object[ 'business-state_name' ] . "\","
+	                            . "\"".$object[ 'business-id_country' ] . "\","
+	                            . "\"".$object[ 'home-phone' ] . "\","
+	                            . "\"".$object[ 'home-address' ] . "\","
+	                            . "\"".$object[ 'home-complement' ] . "\","
+	                            . "\"".$object[ 'home-postal_code' ] . "\","
+	                            . "\"".$object[ 'home-city_name' ] . "\","
+	                            . "\"".$object[ 'home-state_name' ] . "\","
+	                            . "\"".$object[ 'home-id_country' ] . "\","
+								. "\"".$object[ 'birthdate' ] . "\","
+								. "\"".$object[ 'sex' ] . "\","
+								. "\"".$object[ 'pgp_key' ] . "\","
+								. "\"".str_replace("\r\n\x0a","\t",$object[ 'notes' ]) . "\","
+								. "\"".$object[ 'web_page' ] . "\","
+								. "\"".$object[ 'corporate_name' ] . "\","
+								. "\"".$object[ 'job_title' ] . "\","
+								. "\"".$object[ 'department' ] . "\","
+								. "\"".$object[ 'business-fax' ] . "\","
+								. "\"".$object[ 'business-pager' ] . "\","
+								. "\"".$object[ 'business-mobile' ] . "\","
+								. "\"".$object[ 'home-fax' ] . "\","
+								. "\"".$object[ 'home-pager' ] . "\","
+								. "\"".$object[ 'business-address-2' ] . "\","
+								. "\"".$object[ 'home-address-2' ] . "\"\r\n";
+	                    }
+	                break;
 
 			}
@@ -3707,193 +3882,250 @@
 					$delim = ';';
 
-			$boGroup = CreateObject('contactcenter.bo_group');
-			$boPeople = CreateObject('contactcenter.bo_people_catalog');
-				switch($typeImport){
-					case 'outlook2000':
-						$name_pos=1;
-						$name2_pos=2;
-						$name3_pos=3;
-						$addr1_pos=8;
-						$cep_pos=13;
-						$addr2_pos=22;
-						$fax_pos=30;
-						$phone_pos=31;
-						$resPhone_pos=37;
-						$cellPhone_pos=40;
-						$pager_pos=43;
-						$birth_pos=48;
-						$notes_pos=49;
-						$email_pos=56;
-						$altEmail_pos=59;
-
-						break;
-					case 'outlook':
-						$name_pos=3;
-						$email_pos=4;
-						$phone_pos=7;
-						$resPhone_pos=10;
-						$cellPhone_pos=12;
-						$addr1_pos=13;
-						$cep_pos=15;
-						$phone_pos=18;
-						$fax_pos=19;
-						$pager_pos=20;
-						$notes_pos=25;
-						break;
-					case 'thunderbird':
-						$name_pos=2;
-						$email_pos=4;
-						$phone_pos=7;
-						break;
-					case 'expresso':
-						$name_pos=0;
-						$email_pos=1;
-						$phone_pos=2;
-						break;
+				$boGroup = CreateObject('contactcenter.bo_group');
+				$boPeople = CreateObject('contactcenter.bo_people_catalog');
+					switch($typeImport){
+						case 'outlook2000':
+							$name_pos=1;
+							$name2_pos=2;
+							$name3_pos=3;
+							$corporate_street_pos=8;
+							$cep_pos=13;
+							$corporate_street_2_pos=22;
+							$fax_pos=30;
+							$phone_pos=31;
+							$home_phone_pos=37;
+							$personal_cell_pos=40;
+							$pager_pos=43;
+							$birth_pos=48;
+							$notes_pos=49;
+							$email_pos=56;
+							$aditionalEmail_pos=59;
+
+							break;
+						case 'outlook':
+							$name_pos=3;
+							$email_pos=4;
+							$phone_pos=7;
+							$home_phone_pos=10;
+							$personal_cell_pos=12;
+							$corporate_street_pos=13;
+							$cep_pos=15;
+							$phone_pos=18;
+							$fax_pos=19;
+							$pager_pos=20;
+							$notes_pos=25;
+							break;
+						case 'thunderbird':
+							$name_pos=2;
+							$email_pos=4;
+							$phone_pos=7;
+							break;
+						case 'expresso':
+							$name_pos=0;
+							$alias_pos=1;
+							$email_pos=2;
+							$aditionalEmail_pos=3;
+							$personal_cell_pos=4;
+							$corporate_phone_pos=5;
+							$corporate_street_pos=6;
+							$corporate_comp_pos=7;
+							$corporate_cep_pos=8;
+							$corporate_city_pos=9;
+							$corporate_state_pos=10;
+							$corporate_country_pos=11;
+							$home_phone_pos=12;
+							$street_pos=13;
+							$comp_pos=14;
+							$cep_pos=15;
+							$city_pos=16;
+							$state_pos=17;
+							$country_pos=18;
+							$birth_pos=19;
+							$sex_pos = 20;
+							$pgp_key_pos = 21;
+							$notes_pos=22;
+							$web_page_pos=23;
+							$corporate_name_pos=24;
+							$job_title_pos=25;
+							$department_pos=26;
+							$corporate_fax_pos=27;
+							$corporate_pager_pos=28;
+							$corporate_cell_pos=29;
+							$fax_pos=30;
+							$pager_pos=31;
+							$corporate_street_2_pos = 32;
+							$street_2_pos = 33;						
+							break;
 					default:
-						foreach($csv_header as $index => $fieldName)
-						{
-							switch($fieldName){
-							case 'Name':
-							case 'Nome':
-							case 'First Name':
-								$name_pos = $index;
-								break;
-							case 'Second name':
-							case 'Segundo nome':
-								$name2_pos = $index;
-								break;
-							case 'Sobrenome':
-							case 'Surname':
-								$name3_pos = $index;
-								break;
-							case 'Business Street':
-							case 'Rua do endereÃ§o comercial':
-								$addr1_pos = $index;
-								break;
-							case 'Rua do endereÃ§o comercial 2':
-							case 'Outro endereÃ§o':
-								$addr2_pos = $index;
-								break;
-							case 'Business Postal Code':
-							case 'CEP do endereÃ§o comercial':
-								$cep_pos = $index;
-								break;
-							case 'Business Fax':
-							case 'Fax comercial':
-							case 'Fax':
-								$fax_pos = $index;
-								break;
-							case 'Home Phone':
-							case 'Telefone residencial':
-								$resPhone_pos = $index;
-								break;
-							case 'Mobile phone':
-							case 'Telefone celular':
-								$cellPhone_pos = $index;
-								break;
-							case 'Pager':
-								$pager_pos = $index;
-								break;
-							case 'Phone':
-							case 'Business Phone':
-							case 'Telefone':
-							case 'Telefone principal':
-							case 'Telefone comercial':
-								$phone_pos = $index;
-								break;
-							case 'AniversÃ¡rio':
-							case 'Birthdate':
-								$birth_pos = $index;
-							case 'AnotaÃ§Ãµes':
-							case 'Notes':
-								$notes_pos = $index;
-							case 'E-mail':
-							case 'Email':
-							case 'E-mail Address':
-							case 'Endereï¿œo de correio eletrï¿œnico':
-							case 'End. de email':
-								$email_pos = $index;
-								break;
-							case 'Endereï¿œo de correio eletrï¿œnico 2':
-								$altEmail_pos = $index;
-								break;
+							foreach($csv_header as $index => $fieldName)
+							{
+								switch($fieldName){
+								case 'Name':
+								case 'Nome':
+								case 'First Name':
+									$name_pos = $index;
+									break;
+								case 'Second name':
+								case 'Segundo nome':
+									$name2_pos = $index;
+									break;
+								case 'Sobrenome':
+								case 'Surname':
+									$name3_pos = $index;
+									break;
+								case 'Business Street':
+								case 'Rua do endereço comercial':
+									$corporate_street_pos = $index;
+									break;
+								case 'Rua do endereço comercial 2':
+								case 'Outro endereço':
+									$corporate_street_2_pos = $index;
+									break;
+								case 'Business Postal Code':
+								case 'CEP do endereço comercial':
+									$cep_pos = $index;
+									break;
+								case 'Business Fax':
+								case 'Fax comercial':
+								case 'Fax':
+									$fax_pos = $index;
+									break;
+								case 'Home Phone':
+								case 'Telefone residencial':
+									$home_phone_pos = $index;
+									break;
+								case 'Mobile phone':
+								case 'Telefone celular':
+									$personal_cell_pos = $index;
+									break;
+								case 'Pager':
+									$pager_pos = $index;
+									break;
+								case 'Phone':
+								case 'Business Phone':
+								case 'Telefone':
+								case 'Telefone principal':
+								case 'Telefone comercial':
+									$phone_pos = $index;
+									break;
+								case 'Aniversário':
+								case 'Birthdate':
+									$birth_pos = $index;
+								case 'Anotações':
+								case 'Notes':
+									$notes_pos = $index;
+								case 'E-mail':
+								case 'Email':
+								case 'E-mail Address':
+								case 'Endereço de correio eletrônico':
+								case 'End. de email':
+									$email_pos = $index;
+									break;
+								case 'Endereço de correio eletrônico 2':
+									$aditionalEmail_pos = $index;
+									break;
+								}
 							}
-						}
-						break;
+							break;
 				}
 
 				while (($data = fgetcsv($handle, $len, $delim))) {
-       				foreach ($header as $key=>$heading)
+					foreach ($header as $key=>$heading)
                			$row[$heading]=(isset($data[$key])) ? $data[$key] : '';
 
-					$sdata = array();
-					$full_name 	= trim($row[$header[$name_pos]]);
-					$email		= trim($row[$header[$email_pos]]);
-					$phone		= trim($row[$header[$phone_pos]]);
-					$name2		= trim($row[$header[$name2_pos]]);
-					$name3		= trim($row[$header[$name3_pos]]);
-
-					$addr1		= trim($row[$header[$addr1_pos]]);
-					$addr2		= trim($row[$header[$addr2_pos]]);
-					$cep		= trim($row[$header[$cep_pos]]);
-					$fax		= trim($row[$header[$fax_pos]]);
-					$resPhone	= trim($row[$header[$resPhone_pos]]);
-					$cellPhone	= trim($row[$header[$cellPhone_pos]]);
-					$pager		= trim($row[$header[$pager_pos]]);
-					$birth		= trim($row[$header[$birth_pos]]);
-					$notes		= trim($row[$header[$notes_pos]]);
-					$altEmail	= trim($row[$header[$altEmail_pos]]);
-
-					$full_name = escapeshellcmd($full_name);
+						$sdata = array();
+						$full_name  = trim($row[$header[$name_pos]]);
+						$email		= trim($row[$header[$email_pos]]);
+						$phone		= trim($row[$header[$phone_pos]]);
+						$name2		= trim($row[$header[$name2_pos]]);
+						$name3		= trim($row[$header[$name3_pos]]);
+
+						$birth		= trim($row[$header[$birth_pos]]);
+						$notes 		= trim($row[$header[$notes_pos]]);
+						$altEmail	= trim($row[$header[$altEmail_pos]]);
+						$sdata['alias']         		= trim($row[$header[$alias_pos]]);
+						$sdata['corporate_name']      = trim($row[$header[$corporate_name_pos]]);
+						$sdata['job_title']         	= trim($row[$header[$job_title_pos]]);
+						$sdata['department']       	= trim($row[$header[$department_pos]]);
+						$sdata['web_page']			= trim($row[$header[$web_page_pos]]);
+						
+						$sdata['sex']         		= trim($row[$header[$sex_pos]]);
+						$sdata['pgp_key']      = trim($row[$header[$pgp_key_pos]]);
+
+
+					$full_name = $full_name;
 					$array_name = explode(' ', str_replace('"','',(str_replace('\'','',$full_name))));
-					$sdata['given_names'] = escapeshellcmd($array_name[0]);
+					$sdata['given_names'] = $array_name[0];
 					$array_name[0] = null;
 					$sdata['family_names'] = trim(implode(' ',$array_name));
 					if($sdata['family_names'] == '')
 					{
-						$sdata['family_names'] = escapeshellcmd($name2) . " " . escapeshellcmd($name3);
+						$sdata['family_names'] = $name2 . " " . $name3;
 					}
-
-					$sdata['connections']['default_email']['connection_name'] = lang('Main');
-					$sdata['connections']['default_email']['connection_value'] = escapeshellcmd($email);
-
-					$sdata['connections']['default_phone']['connection_name'] = lang('Main');
-					$sdata['connections']['default_phone']['connection_value'] = escapeshellcmd($phone);
-
-					$sdata['connections']['fax']['connection_name'] = lang('Fax');
-					$sdata['connections']['fax']['connection_value'] = escapeshellcmd($fax);
-
-					$sdata['connections']['residencial_phone']['connection_name'] = lang('Residencial');
-					$sdata['connections']['residencial_phone']['connection_value'] = escapeshellcmd($resPhone);
-
-					$sdata['connections']['cellular_phone']['connection_name'] = lang('Cellphone');
-					$sdata['connections']['cellular_phone']['connection_value'] = escapeshellcmd($cellPhone);
-
-					$sdata['connections']['pager']['connection_name'] = lang('Pager');
-					$sdata['connections']['pager']['connection_value'] = escapeshellcmd($pager);
-
-					$sdata['connections']['alternative_email']['connection_name'] = lang('Alternative');
-					$sdata['connections']['alternative_email']['connection_value'] = escapeshellcmd($altEmail);
-
-					$sdata['addresses']['addr1']['address_value'] = escapeshellcmd($addr1);
-					$sdata['addresses']['addr2']['address_value'] = escapeshellcmd($addr2);
-					$sdata['addresses']['cep']['address_value'] = escapeshellcmd($cep);
+						$sdata['connections']['default_email']['connection_name'] = lang('Main');
+						$sdata['connections']['default_email']['connection_value'] = $email;
+						$sdata['connections']['aditional_email']['connection_name'] = "Alternativo";
+						$sdata['connections']['aditional_email']['connection_value'] = trim($row[$header[$aditionalEmail_pos]]);
+
+						$sdata['connections']['default_phone']['connection_name'] = lang('Main');
+						$sdata['connections']['default_phone']['connection_value'] = $phone;
+
+						$sdata['connections']['aditional_phone']['cellphone']['connection_name'] = 'Celular';
+						$sdata['connections']['aditional_phone']['cellphone']['connection_value'] = trim($row[$header[$personal_cell_pos]]);
+						
+						$sdata['connections']['aditional_phone']['corporate_phone']['connection_name'] = 'Trabalho';
+						$sdata['connections']['aditional_phone']['corporate_phone']['connection_value'] = trim($row[$header[$corporate_phone_pos]]);
+						
+						$sdata['connections']['aditional_phone']['fax']['connection_name'] = 'Fax';
+						$sdata['connections']['aditional_phone']['fax']['connection_value'] = trim($row[$header[$fax_pos]]);
+						
+						$sdata['connections']['aditional_phone']['corporate_fax']['connection_name'] = 'Fax Corporativo';
+						$sdata['connections']['aditional_phone']['corporate_fax']['connection_value'] = trim($row[$header[$corporate_fax_pos]]);
+												
+						$sdata['connections']['aditional_phone']['corporate_cell']['connection_name'] = 'Celular Corporativo';
+						$sdata['connections']['aditional_phone']['corporate_cell']['connection_value'] = trim($row[$header[$corporate_cell_pos]]);
+						
+						$sdata['connections']['aditional_phone']['corporate_pager']['connection_name'] = 'Pager Corporativo';
+						$sdata['connections']['aditional_phone']['corporate_pager']['connection_value'] = trim($row[$header[$corporate_pager_pos]]);
+																
+						
+						$sdata['connections']['aditional_phone']['home_phone']['connection_name'] = 'Casa';
+						$sdata['connections']['aditional_phone']['home_phone']['connection_value'] = trim($row[$header[$home_phone_pos]]);
+						
+						$sdata['connections']['aditional_phone']['pager']['connection_name'] = 'Pager';
+						$sdata['connections']['aditional_phone']['pager']['connection_value'] = trim($row[$header[$pager_pos]]);
+
+						$sdata['addresses']['address_corporative']['address1'] = trim($row[$header[$corporate_street_pos]]);
+						$sdata['addresses']['address_corporative']['address2'] = trim($row[$header[$corporate_street_2_pos]]);
+						$sdata['addresses']['address_corporative']['complement'] = trim($row[$header[$corporate_comp_pos]]);
+						$sdata['addresses']['address_corporative']['postal_code'] = trim($row[$header[$corporate_cep_pos]]);						
+						$sdata['addresses']['address_corporative']['id_country'] = "BR";
+						$sdata['addresses']['address_corporative']['id_state'] = trim($row[$header[$corporate_state_pos]]);	
+						$sdata['addresses']['address_corporative']['id_city'] = trim($row[$header[$corporate_city_pos]]);
+						
+													
+						$sdata['addresses']['address_personal']['address1'] = trim($row[$header[$street_pos]]);
+						$sdata['addresses']['address_personal']['address2'] = trim($row[$header[$street_2_pos]]);
+						$sdata['addresses']['address_personal']['complement'] = trim($row[$header[$comp_pos]]);
+						$sdata['addresses']['address_personal']['postal_code'] = trim($row[$header[$cep_pos]]);
+						$sdata['addresses']['address_personal']['id_country'] = "BR";							
+						$sdata['addresses']['address_personal']['id_state'] = trim($row[$header[$state_pos]]);	
+						$sdata['addresses']['address_personal']['id_city'] =  trim($row[$header[$city_pos]]);
 
 					$array_birth = explode("/",$birth);
 
-					$sdata['birthdate'] = escapeshellcmd(date('Y-m-d', mktime(0,0,0,$array_birth[1],$array_birth[0],$array_birth[2])));
-
-					$sdata['notes'] = escapeshellcmd($notes);
-					$sdata['is_quick_add'] = true;
+					$sdata['birthdate'] = date('Y-m-d', mktime(0,0,0,$array_birth[1],$array_birth[0],$array_birth[2]));
+
+					$sdata['notes'] = $notes;
+					//$sdata['is_quick_add'] = true;
 					$sdata['connections']['default_phone']['connection_value'] = $phone;
 
 					// 	verifica se email já existe!
-					$email = escapeshellcmd($email);
+					$email = $email;
 					$contact = $boGroup->verify_contact($email);
 
 					if(!$sdata['given_names'] && $email){
 							$a_email = explode("@",$email);
-							$sdata['given_names'] = escapeshellcmd($a_email[0]);
+							$sdata['given_names'] = $a_email[0];
 					}
 
