Index: trunk/contactcenter/inc/class.bo_ldap_manager.inc.php
===================================================================
--- trunk/contactcenter/inc/class.bo_ldap_manager.inc.php	(revision 588)
+++ trunk/contactcenter/inc/class.bo_ldap_manager.inc.php	(revision 880)
@@ -45,5 +45,5 @@
 						'acc'    => $data['cc_ldap_browse_dn0'],
 						'pw'     => $data['cc_ldap_pw0'],
-						'obj'    => 'inetOrgPerson',
+						'obj'    => 'phpgwAccount',
 						'branch' => strtolower('ou'),
 						'visible' => $data['cc_ldap_query_automatic']
Index: trunk/contactcenter/inc/class.bo_global_ldap_catalog.inc.php
===================================================================
--- trunk/contactcenter/inc/class.bo_global_ldap_catalog.inc.php	(revision 400)
+++ trunk/contactcenter/inc/class.bo_global_ldap_catalog.inc.php	(revision 880)
@@ -132,7 +132,8 @@
 			
 			$filter = $this->process_restrictions($rules, $trans_f);
-
+			// Find objects where 'mail' attribute is not null.
+			$filter = "(&".$filter."(mail=*))";
 			if("ou" === strtolower(substr($this->src_info['context'], 0, 2)) ||
-				(trim($rules[4]['value']) != "inetOrgPerson"))	
+				(trim($rules[0]['value']) == "phpgwAccount"))	
 			{			
 				$ldap = $GLOBALS['phpgw']->common->ldapConnect($this->src_info['host'], $this->src_info['acc'], $this->src_info['pw'], true);
Index: trunk/contactcenter/inc/class.ui_data.inc.php
===================================================================
--- trunk/contactcenter/inc/class.ui_data.inc.php	(revision 752)
+++ trunk/contactcenter/inc/class.ui_data.inc.php	(revision 880)
@@ -296,4 +296,8 @@
 				case 'get_catalog_participants_list':
 					echo serialize($this->get_catalog_participants_list($_POST['id']));
+					return;
+				
+				case 'get_catalog_participants_group':
+					echo serialize($this->get_catalog_participants_group($_POST['id']));
 					return;
 
@@ -701,5 +705,5 @@
 								 * Restrict the returned contacts in a "first letter" search
 								 * to objectClass = phpgwAccount, must have attibute phpgwAccountStatus,
-								 * phpgwAccountVisible != -1 and objectClass = inetOrgPerson
+								 * phpgwAccountVisible != -1
 								 */
 								1 => array(
@@ -717,10 +721,5 @@
 									'type'  => '!=',
 									'value' => '-1'
-								),
-								4 => array(
-									'field' => 'contact.object_class',
-									'type'  => '=',
-									'value' => 'inetOrgPerson'
-								),
+								)
 							);
 							// If not external catalog get only phpgwAccountType = u ou l
@@ -745,4 +744,9 @@
 											'type'  => '=',
 											'value' => 'l'
+											),
+											3 => array(
+											'field' => 'contact.account_type',
+											'type'  => '=',
+											'value' => 'g'
 											)
 										)
@@ -756,5 +760,5 @@
 								 * Restrict the returned contacts in a "first number" search
 								 * to objectClass = phpgwAccount, must have attibute phpgwAccountStatus,
-								 * phpgwAccountVisible != -1 and objectClass = inetOrgPerson
+								 * phpgwAccountVisible != -1
 								 */
 								0 => array(
@@ -774,9 +778,4 @@
 								),
 								3 => array(
-									'field' => 'contact.object_class',
-									'type'  => '=',
-									'value' => 'inetOrgPerson'
-								),
-								4 => array(
 									'type'  => 'branch',
 									'value' => 'OR',
@@ -852,14 +851,15 @@
 										'value' => 'i'
 										),
-										/*1 => array(
-										'field' => 'contact.account_type',
-										'type'  => '=',
-										'value' => 'g'
-										),*/
 										2 => array(
 										'field' => 'contact.account_type',
 										'type'  => '=',
 										'value' => 'l'
+										),
+										3 => array(
+										'field' => 'contact.account_type',
+										'type'  => '=',
+										'value' => 'g'
 										)
+										
 									)
 								);
@@ -1257,7 +1257,7 @@
 						$final[3][$i][6] = $ids[$i];
 
-					//	If contact is a public list, then load the forwarding addresses.
-						if($contact['account_type'][0] == 'l')
-							$final[3][$i][7] = array();
+					//	If contact is a public list or a group, then load the forwarding addresses.
+						if($contact['account_type'][0] == 'l' || $contact['account_type'][0] == 'g')
+							$final[3][$i][7] = ($contact['account_type'][0] == 'l' ? 'list' : 'group');
 							
 						if($this->page_info['actual_catalog']['class']=='bo_shared_people_manager') {
@@ -2317,6 +2317,5 @@
 					/*
 					 * Restrict the returned contacts search to objectClass = phpgwAccount,
-					 * must have attibute phpgwAccountStatus, phpgwAccountVisible != -1 and
-					 * objectClass = inetOrgPerson
+					 * must have attibute phpgwAccountStatus, phpgwAccountVisible != -1
 					 */
 					$rules = array(
@@ -2336,9 +2335,4 @@
 							'value' => '-1'
 						),
-						3 => array(
-							'field' => 'contact.object_class',
-							'type'  => '=',
-							'value' => 'inetOrgPerson'
-						)
 					);
 				}
@@ -2762,4 +2756,44 @@
 		}	
 		
+		function get_catalog_participants_group($id) 
+		{
+			if(!$this->bo->catalog->src_info) {
+				$ldap = CreateObject('contactcenter.bo_ldap_manager');
+				$this->bo->catalog->src_info = $ldap->srcs[1];
+			}			
+			$ds = $GLOBALS['phpgw']->common->ldapConnect($this->bo->catalog->src_info['host'], $this->bo->catalog->src_info['acc'], $this->bo->catalog->src_info['pw'], true);			
+			$justThese = array("description","memberuid");			
+			$sr = ldap_read($ds,$id, "objectClass=*",$justThese);							
+			$info = ldap_get_entries($ds, $sr);
+			$member_uids = $info[0]['memberuid'];
+			$contact['names_ordered'] = $info[0]['description'];
+			$filter = "";			
+			for($z = 0; $z < count($member_uids); $z++) {
+				if($member_uids[$z])
+					$filter.="(uid=".$member_uids[$z].")";	
+			}
+			$array_participants = array();
+			if($filter) {
+				$filter = "(|".$filter.")";
+				$dn=$this->bo->catalog->src_info['dn'];
+				$justThese = array("cn","mail");
+				$sr = ldap_search($ds,$dn, $filter,$justThese);								
+				$info = ldap_get_entries($ds, $sr);							
+				for($z = 0; $z < $info['count']; $z++) {
+					$participant =  '<font color=\'DARKBLUE\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;'.$info[$z]['cn'][0].'&quot; &lt;'.$info[$z]['mail'][0].'&gt;</font><br>';
+					$array_emails[$info[$z]['mail'][0]] = null; 								
+					array_push($array_participants, $participant);					
+				}
+				ldap_close($ds);
+			}			
+			sort($array_participants);
+			$innerHTML = '';			
+			foreach($array_participants as $index => $participant){
+				$innerHTML .= $participant;
+			}
+			$return = array('size' => count($array_participants), 'names_ordered'=> $contact['names_ordered'], 'inner_html' => $innerHTML);			 
+			echo serialize($return);
+		}
+
 		function get_catalog_participants_list($id) 
 		{
@@ -2772,5 +2806,5 @@
 			$array_participants = array();
 			$array_emails = array();
-			
+
 			$filter = null;
 			for($z = 0; $z < $contact['mail_forwarding_address']['count']; $z++) {			
@@ -2789,5 +2823,6 @@
 					$this->bo->catalog->src_info = $ldap->srcs[1];
 				}
-				$ds = $GLOBALS['phpgw']->common->ldapConnect($this->bo->catalog->src_info['host'], $this->bo->catalog->src_info['acc'], $this->bo->catalog->src_info['pw'], true);				
+				$ds = $GLOBALS['phpgw']->common->ldapConnect($this->bo->catalog->src_info['host'], $this->bo->catalog->src_info['acc'], $this->bo->catalog->src_info['pw'], true);
+				
 				$dn=$this->bo->catalog->src_info['dn'];
 				$justThese = array("cn","mail");
Index: trunk/contactcenter/js/cc.js
===================================================================
--- trunk/contactcenter/js/cc.js	(revision 752)
+++ trunk/contactcenter/js/cc.js	(revision 880)
@@ -1958,10 +1958,10 @@
 
 							case 'cc_forwarding_address':
-								var contacts = data[3][pos][k];
-																
-								if( !contacts)
+								var account_type = data[3][pos][k];
+															
+								if( !account_type)
 									break;
-																																								
-								Element(id+':cc_icon_group').innerHTML =  '<span title="'+Element('cc_participants').value+'"  onmouseout="window.status=\'\';" onclick="ccListParticipants.showList(\''+ Element(id+':cc_id').value + '\');return true;" style="cursor: pointer; cursor: hand; z-index: 1"><img src="templates/default/images/people-mini.png" align="center">&nbsp;&nbsp;</span>';
+																																																					
+								Element(id+':cc_icon_group').innerHTML =  '<span title="'+Element('cc_participants').value+'"  onmouseout="window.status=\'\';" onclick="ccListParticipants.showList(\''+ Element(id+':cc_id').value + '\',null,null,null,\''+account_type+'\');return true;" style="cursor: pointer; cursor: hand; z-index: 1"><img src="templates/default/images/people-mini.png" align="center">&nbsp;&nbsp;</span>';
 								break;
 
Index: trunk/contactcenter/js/ccListParticipants.js
===================================================================
--- trunk/contactcenter/js/ccListParticipants.js	(revision 24)
+++ trunk/contactcenter/js/ccListParticipants.js	(revision 880)
@@ -19,9 +19,9 @@
 
 	
-cListParticipants.prototype.showList = function(id, contact, email, title){
+cListParticipants.prototype.showList = function(id, contact, email, title, account_type){
 	_this = this;
 	
 	id = id;
-	
+
 	div = document.getElementById(id+':cc_rectParticipants');
 	var el = document.createElement("DIV");									
@@ -93,9 +93,9 @@
 				_this.showWindow(el);
 			}		
-				
+
 			if(div)
 				this.showWindow(div);
 			else
-				Connector.newRequest('get_catalog_participants_list', '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_catalog_participants_list', 'POST', handler, 'id='+id);
+				Connector.newRequest('get_catalog_participants_'+account_type , '../index.php?menuaction=contactcenter.ui_data.data_manager&method=get_catalog_participants_'+account_type, 'POST', handler, 'id='+id);
 		}
 	}
