Index: sandbox/2.2.0.2/contactcenter/setup/phpgw_es-es.lang
===================================================================
--- sandbox/2.2.0.2/contactcenter/setup/phpgw_es-es.lang	(revision 3665)
+++ sandbox/2.2.0.2/contactcenter/setup/phpgw_es-es.lang	(revision 4477)
@@ -77,4 +77,5 @@
 Empty	contactcenter	es-es	Vacío
 Entry added with success!	contactcenter	es-es	¡Contacto añadido con suceso!
+Entry added with success. But some contacts will not receive or send messages.  contactcenter   es-es   Entrada añadido con éxito. Pero algunos contactos no recibir ni enviar mensajes.
 Export as Expresso (default) CSV.	contactcenter	es-es	Exportar como Expresso (standar) CSV
 Export as Mozilla Thunderbird CSV.	contactcenter	es-es	Exportar como Mozilla Thunderbird CSV.
Index: sandbox/2.2.0.2/contactcenter/inc/class.so_group.inc.php
===================================================================
--- sandbox/2.2.0.2/contactcenter/inc/class.so_group.inc.php	(revision 4470)
+++ sandbox/2.2.0.2/contactcenter/inc/class.so_group.inc.php	(revision 4477)
@@ -376,5 +376,5 @@
 			'phpgw_cc_contact_conns B, phpgw_cc_connections C,phpgw_cc_contact_grps D where '.
 			'A.id_contact = B.id_contact and B.id_connection = C.id_connection '.
-			'and B.id_typeof_contact_connection = 1 and '.
+			'and '.
 			//'A.id_owner ='.$this->owner.' and'.
 			' D.id_connection = C.id_connection and D.id_group = '.$idGroup.
Index: sandbox/2.2.0.2/contactcenter/inc/class.bo_people_catalog.inc.php
===================================================================
--- sandbox/2.2.0.2/contactcenter/inc/class.bo_people_catalog.inc.php	(revision 3826)
+++ sandbox/2.2.0.2/contactcenter/inc/class.bo_people_catalog.inc.php	(revision 4477)
@@ -524,26 +524,28 @@
 			{
 				$connection = CreateObject('contactcenter.so_connection', $id);
-
-				if ($extra === 'default' and $connection->is_default())
-				{
-					$connection_type = CreateObject('contactcenter.so_contact_connection_type', $type);
-					$return['connection'.$count]['id_connection'] = $id;
-					$return['connection'.$count]['id_type'] = $type;
-					$return['connection'.$count]['type'] = $connection_type->get_type_name(); 
-					$return['connection'.$count]['connection_name'] = $connection->get_name();
-					$return['connection'.$count]['connection_value'] = $connection->get_value();
-					$return['connection'.$count]['connection_is_default'] = $connection->is_default();
-					$count++;
-				}
-				else if ($extra !== 'default')
-				{
-					$connection_type = CreateObject('contactcenter.so_contact_connection_type', $type);
-					$return['connection'.$count]['id_connection'] = $id;
-					$return['connection'.$count]['id_type'] = $type;
-					$return['connection'.$count]['type'] = $connection_type->get_type_name(); 
-					$return['connection'.$count]['connection_name'] = $connection->get_name();
-					$return['connection'.$count]['connection_value'] = $connection->get_value();
-					$return['connection'.$count]['connection_is_default'] = $connection->is_default();
-					$count++;
+				if ($getDummy || $connection->get_name() !== 'no_conns')
+				{
+					if ($extra === 'default' and $connection->is_default())
+					{
+						$connection_type = CreateObject('contactcenter.so_contact_connection_type', $type);
+						$return['connection'.$count]['id_connection'] = $id;
+						$return['connection'.$count]['id_type'] = $type;
+						$return['connection'.$count]['type'] = $connection_type->get_type_name();
+						$return['connection'.$count]['connection_name'] = $connection->get_name();
+						$return['connection'.$count]['connection_value'] = $connection->get_value();
+						$return['connection'.$count]['connection_is_default'] = $connection->is_default();
+						$count++;
+					}
+					else if ($extra !== 'default')
+					{
+						$connection_type = CreateObject('contactcenter.so_contact_connection_type', $type);
+						$return['connection'.$count]['id_connection'] = $id;
+						$return['connection'.$count]['id_type'] = $type;
+						$return['connection'.$count]['type'] = $connection_type->get_type_name();
+						$return['connection'.$count]['connection_name'] = $connection->get_name();
+						$return['connection'.$count]['connection_value'] = $connection->get_value();
+						$return['connection'.$count]['connection_is_default'] = $connection->is_default();
+						$count++;
+					}
 				}
 			}
@@ -902,4 +904,6 @@
 			$permissions = $this->security->get_permissions();
 			
+			$exist_connections = false;
+			
 			if (!$permissions['create'])
 			{
@@ -913,5 +917,5 @@
 			foreach($data as $field => $value)
 			{
-				if ($value === false)
+				if ($value === false && $field != 'connections')
 				{
 					continue;
@@ -1001,4 +1005,5 @@
 						foreach($value as $connection_name => $connection_fields)
 						{
+							$exist_connections = true;
 							$connection = CreateObject('contactcenter.so_connection');
 							$connection->reset_values();
@@ -1026,4 +1031,9 @@
 			{
 				$contact->set_field('id_owner',$GLOBALS['phpgw_info']['user']['account_id']);
+				//insert a dummy connection if the contact dont have an email and telephone
+				if (!$exist_connections) 
+				{
+					$this->add_dummy($contact);
+				}
 				return $contact->commit();
 			}
@@ -1519,4 +1529,7 @@
 					
 					case 'connections':
+						//alteracao para permitir a exibicao de contatos sem email ou telefone
+						$all_removed = true;
+						$added_connection = false;
 						foreach($value as $connection_name => $connection_fields)
 						{
@@ -1537,4 +1550,11 @@
 							}
 							
+							$all_removed = false;
+							// removes the dummy if there is at least one connection
+							if (!$added_connection)
+							{
+								$this->remove_dummy($contact); //remove the dummy
+							}
+							$added_connection = true;
 							$id_connection = $connection_fields['id_connection'];
 							if ($id_connection === '_NEW_' or
@@ -1564,4 +1584,7 @@
 							$contact->set_connection($id_connection, $connection_fields['id_typeof_connection']);
 						}
+						// add the dummy if there is no other connection
+						if ($all_removed)
+							$this->add_dummy($contact);
 			 			break;
 			 			
@@ -1583,4 +1606,55 @@
 	
 		/*!
+			@function remove_dummy
+			@abstract Remove the dummy connection entry.
+			@author Luiz Carlos Viana Melo - Prognus
+		 */
+		function remove_dummy($so_contact)
+		{
+			//$so_contact = CreateObject('contactcenter.so_contact', $id_contact);
+			$connections = $so_contact->get_connections();
+			foreach ($connections as $id_connection => $type_connection)
+			{
+				$so_connection = CreateObject('contactcenter.so_connection', $id_connection);
+				if ($so_connection->get_field('connection_name') === 'no_conns') //if connection is the dummy one
+				{
+					if (!$so_connection->remove())
+					{
+						return false;
+					}
+					$so_contact->remove_connection($id_connection);
+					//$so_connection->commit();
+					break;
+				}
+			}
+		
+		}
+		
+		/*!
+			@function add_dummy
+			@abstract Add a dummy connection entry on a contact. This is necessary for
+				possibility on adding a contact that dont have an email or telephone.
+			@return The dummy's connection ID.
+			@author Luiz Carlos Viana Melo - Prognus
+		 */
+		function add_dummy($so_contact)
+		{
+			$so_connection = CreateObject('contactcenter.so_connection');
+			$so_connection->reset_values();
+			
+			$so_connection->set_field('connection_name', 'no_conns'); //defined code for the dummy connection
+			$so_connection->set_field('connection_value', '');
+			$so_connection->set_field('connection_is_default', true);
+			
+			if (!$so_connection->commit())
+			{
+				return false;
+			}
+			$id_connection = $so_connection->get_id();
+			$so_contact->set_connection($id_connection, 2);
+			return $id_connection;
+		}
+					
+		/*!
 		
 			@function update_prefix
Index: sandbox/2.2.0.2/contactcenter/inc/class.ui_data.inc.php
===================================================================
--- sandbox/2.2.0.2/contactcenter/inc/class.ui_data.inc.php	(revision 4289)
+++ sandbox/2.2.0.2/contactcenter/inc/class.ui_data.inc.php	(revision 4477)
@@ -1682,11 +1682,16 @@
 			
 			$boGroup = CreateObject('contactcenter.bo_group');
-
-			$all_contacts = $boGroup->get_all_contacts('only_email',$shared_from);
+			
+			$all_contacts = $boGroup->get_all_contacts(false,$shared_from);
+			
 			
 			$contact_options = "";
 			if(count($all_contacts)) {					
 				foreach($all_contacts as $idx => $contact) {				
-					$contact_options .= "<OPTION value='".$contact['id_connection']."'>".$contact['names_ordered']." (".$contact['connection_value'].")</OPTION>";
+					$contact_options .= "<OPTION value='".$contact['id_connection']."'>".$contact['names_ordered'];
+					if (isset($contact['connection_value']))
+						$contact_options .= " (".$contact['connection_value'].")</OPTION>";
+					else
+						$contact_options .= " (". $contact['phone'].")</OPTION>";
 				}
 			}
@@ -1987,4 +1992,19 @@
 			$data['contact_in_list'] = $new_tdata[1];
 			$data['id_group'] = $new_tdata[2];
+			
+			$contactWOemail = false; 
+	                         
+			foreach ($data['contact_in_list'] as $id_connection) 
+ 			{ 
+ 				$boConn = CreateObject('contactcenter.bo_connection'); 
+ 				$type = $boConn->get_connection_type_by_conn_id($id_connection); 
+ 				if ($type != 1) 
+ 				{ 
+ 					$contactWOemail = true; 
+					break; 
+ 				} 
+ 			}
+
+
                         $acumulatedErrors = '';
 
@@ -2038,15 +2058,20 @@
 			{
 				$this->page_info['changed'] = true;
-
+				
+				if (!$contactWOemail)
+					echo serialize(array(
+						'msg'    => lang('Entry added with success!'),
+						'status' => 'ok'
+						));
+				else
+					echo serialize(array(
+						'msg'    => lang('Entry added with success. But some contacts will not receive or send messages.'),
+						'status' => 'warning'
+						));
+			}
+			else
+			{
 				echo serialize(array(
-					'msg'    => lang('Entry added with success!'),
-					'status' => 'ok'
-				));
-			}
-			else
-			{
-				echo serialize(array(
-					'msg'    => lang('Problems on adding your Contact. No Contact added!').
-                                            "\n".$acumulatedErrors,
+					'msg'    => lang('Problems on adding your Contact. No Contact added!'),
 					'status' => 'error'
 				));
Index: sandbox/2.2.0.2/contactcenter/js/ccAddGroup.js
===================================================================
--- sandbox/2.2.0.2/contactcenter/js/ccAddGroup.js	(revision 4470)
+++ sandbox/2.2.0.2/contactcenter/js/ccAddGroup.js	(revision 4477)
@@ -124,9 +124,11 @@
 			//showMessage(data['msg']);
 
-			if (data['status'] != 'ok')
+			if (data['status'] != 'ok' && data['status'] != 'warning')
 			{
-				showMessage(data['msg']);
 				return;
 			}
+			
+			if(data['status'] == 'warning')
+				showMessage(data['msg']);
 
 			_this.clear();
