From 5687471b1c25d295d6ca5547daeb67d80b4bceca Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 23 Mar 2015 22:18:38 +0000 Subject: [PATCH] Include group emails in email search results --- mail/inc/class.mail_compose.inc.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index 7f468b4d38..d4c2cdec72 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -3302,6 +3302,22 @@ class mail_compose } } + // Add groups + $group_options = array('account_type' => 'groups'); + $groups = $GLOBALS['egw']->accounts->link_query($_searchString, $group_options); + foreach($groups as $g_id => $name) + { + $group = $GLOBALS['egw']->accounts->read($g_id); + if(!$group['account_email']) continue; + $completeMailString = trim($name) .' <'. trim($group['account_email']) .'>'; + $results[] = array( + 'id' => $completeMailString, + 'label' => $completeMailString, + 'name' => $name, + 'title' => $group['account_email'] + ); + } + // Add up to 5 matching mailing lists if($include_lists) {