summaryrefslogtreecommitdiff
path: root/program/steps/mail/autocomplete.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2012-03-14 08:27:18 +0000
committerthomascube <thomas@roundcube.net>2012-03-14 08:27:18 +0000
commit168e5409239583343ae40695585aa8dbc276f740 (patch)
treeb15683c369ef636652bf19b82d0c13b955e9de1d /program/steps/mail/autocomplete.inc
parentec318158ceb0fa3e52ee24eada5f7763779da238 (diff)
Request all needed fields from address book backends (#1488394)
Diffstat (limited to 'program/steps/mail/autocomplete.inc')
-rw-r--r--program/steps/mail/autocomplete.inc7
1 files changed, 4 insertions, 3 deletions
diff --git a/program/steps/mail/autocomplete.inc b/program/steps/mail/autocomplete.inc
index a7823a5f9..95d611841 100644
--- a/program/steps/mail/autocomplete.inc
+++ b/program/steps/mail/autocomplete.inc
@@ -29,10 +29,10 @@ if ($RCMAIL->action == 'group-expand') {
$members = array();
$abook->set_group($gid);
$abook->set_pagesize(1000); // TODO: limit number of group members by config
- $result = $abook->list_records(array('email','name'));
+ $result = $abook->list_records(array('name', 'firstname', 'surname', 'email'));
while ($result && ($sql_arr = $result->iterate())) {
foreach ((array)$sql_arr['email'] as $email) {
- $members[] = format_email_recipient($email, $sql_arr['name']);
+ $members[] = format_email_recipient($email, rcube_addressbook::compose_list_name($sql_arr));
break; // only expand one email per contact
}
}
@@ -67,7 +67,7 @@ if (!empty($book_types) && strlen($search)) {
$abook = $RCMAIL->get_address_book($id);
$abook->set_pagesize($MAXNUM);
- if ($result = $abook->search(array('email','name'), $search, $mode, true, true, 'email')) {
+ if ($result = $abook->search(array('name', 'firstname', 'surname', 'email'), $search, $mode, true, true, 'email')) {
while ($sql_arr = $result->iterate()) {
// Contact can have more than one e-mail address
$email_arr = (array)$abook->get_col_values('email', $sql_arr, true);
@@ -78,6 +78,7 @@ if (!empty($book_types) && strlen($search)) {
continue;
}
+ $sql_arr['name'] = rcube_addressbook::compose_list_name($sql_arr);
$contact = format_email_recipient($email, $sql_arr['name']);
// skip entries that don't match