summaryrefslogtreecommitdiff
path: root/program/steps/mail/autocomplete.inc
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-05-10 19:38:45 +0000
committeralecpl <alec@alec.pl>2010-05-10 19:38:45 +0000
commit25fdec592dc0a37c6ccb0d566e288807aacf9114 (patch)
treee51b0d83c2cdc027bd67d9242fb0543200fefc9d /program/steps/mail/autocomplete.inc
parent5933d98c8cdee9ef4b04eaf680a7d29cb4928cfc (diff)
- Fix autocomplete shows entries without email (#1486452)
Diffstat (limited to 'program/steps/mail/autocomplete.inc')
-rw-r--r--program/steps/mail/autocomplete.inc10
1 files changed, 5 insertions, 5 deletions
diff --git a/program/steps/mail/autocomplete.inc b/program/steps/mail/autocomplete.inc
index b761f5398..4e6c617d3 100644
--- a/program/steps/mail/autocomplete.inc
+++ b/program/steps/mail/autocomplete.inc
@@ -31,7 +31,7 @@ if ($RCMAIL->action == 'group-expand') {
$result = $abook->list_records(array('email','name'));
while ($result && ($sql_arr = $result->iterate()))
$members[] = format_email_recipient($sql_arr['email'], $sql_arr['name']);
-
+
$OUTPUT->command('replace_group_recipients', $gid, join(', ', $members));
}
}
@@ -42,21 +42,21 @@ else if ($book_types && $search = get_input_value('_search', RCUBE_INPUT_GPC, tr
$abook = $RCMAIL->get_address_book($id);
$abook->set_pagesize($MAXNUM);
- if ($result = $abook->search(array('email','name'), $search, false, true, true)) {
+ if ($result = $abook->search(array('email','name'), $search, false, true, true, 'email')) {
while ($sql_arr = $result->iterate()) {
$contacts[] = format_email_recipient($sql_arr['email'], $sql_arr['name']);
if (count($contacts) >= $MAXNUM)
break 2;
}
}
-
+
// also list matching contact groups
if ($abook->groups) {
foreach ($abook->list_groups($search) as $group) {
$abook->reset();
$abook->set_group($group['ID']);
$result = $abook->count();
-
+
if ($result->count) {
$contacts[] = array('name' => $group['name'] . ' (' . intval($result->count) . ')', 'id' => $group['ID'], 'source' => $id);
if (count($contacts) >= $MAXNUM)
@@ -65,7 +65,7 @@ else if ($book_types && $search = get_input_value('_search', RCUBE_INPUT_GPC, tr
}
}
}
-
+
usort($contacts, 'contact_results_sort');
}