Thomas Bruederli
2014-06-04 3412e50b54e3daac8745234e21ab6e72be0ed165
program/steps/mail/autocomplete.inc
@@ -49,7 +49,7 @@
$single = (bool) $RCMAIL->config->get('autocomplete_single');
$search = rcube_utils::get_input_value('_search', rcube_utils::INPUT_GPC, true);
$source = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC);
$sid    = rcube_utils::get_input_value('_id', rcube_utils::INPUT_GPC);
$reqid  = rcube_utils::get_input_value('_reqid', rcube_utils::INPUT_GPC);
if (strlen($source)) {
    $book_types = array($source);
@@ -90,7 +90,7 @@
                    // skip duplicates
                    if (!in_array($contact, $contacts)) {
                        $contacts[]  = $contact;
                        $contacts[]  = array('name' => $contact, 'type' => $sql_arr['_type']);
                        $sort_keys[] = sprintf('%s %03d', $sql_arr['name'] , $idx++);
                        if (count($contacts) >= $MAXNUM) {
@@ -118,7 +118,7 @@
                if ($group_prop['email']) {
                    $idx = 0;
                    foreach ((array)$group_prop['email'] as $email) {
                        $contacts[]  = format_email_recipient($email, $group['name']);
                        $contacts[]  = array('name' => format_email_recipient($email, $group['name']), 'type' => 'group');
                        $sort_keys[] = sprintf('%s %03d', $group['name'] , $idx++);
                        if (count($contacts) >= $MAXNUM) {
@@ -131,6 +131,7 @@
                    $sort_keys[] = $group['name'];
                    $contacts[]  = array(
                        'name'   => $group['name'] . ' (' . intval($result->count) . ')',
                        'type'   => 'group',
                        'id'     => $group['ID'],
                        'source' => $id
                    );
@@ -154,5 +155,5 @@
    }
}
$OUTPUT->command('ksearch_query_results', $contacts, $search, $sid);
$OUTPUT->command('ksearch_query_results', $contacts, $search, $reqid);
$OUTPUT->send();