diff --git a/program/steps/mail/autocomplete.inc b/program/steps/mail/autocomplete.inc index 3d2130b03..2b3e714dc 100644 --- a/program/steps/mail/autocomplete.inc +++ b/program/steps/mail/autocomplete.inc @@ -30,10 +30,10 @@ if ($RCMAIL->action == 'group-expand') { $result = $abook->list_records($RCMAIL->config->get('contactlist_fields')); $members = array(); - while ($result && ($sql_arr = $result->iterate())) { - $emails = (array) $abook->get_col_values('email', $sql_arr, true); + while ($result && ($record = $result->iterate())) { + $emails = (array) $abook->get_col_values('email', $record, true); if (!empty($emails) && ($email = array_shift($emails))) { - $members[] = format_email_recipient($email, rcube_addressbook::compose_list_name($sql_arr)); + $members[] = format_email_recipient($email, rcube_addressbook::compose_list_name($record)); } } @@ -70,9 +70,9 @@ if (!empty($book_types) && strlen($search)) { $abook->set_pagesize($MAXNUM); if ($result = $abook->search($RCMAIL->config->get('contactlist_fields'), $search, $mode, true, true, 'email')) { - while ($sql_arr = $result->iterate()) { + while ($record = $result->iterate()) { // Contact can have more than one e-mail address - $email_arr = (array)$abook->get_col_values('email', $sql_arr, true); + $email_arr = (array)$abook->get_col_values('email', $record, true); $email_cnt = count($email_arr); $idx = 0; @@ -81,7 +81,7 @@ if (!empty($book_types) && strlen($search)) { continue; } - $name = rcube_addressbook::compose_list_name($sql_arr); + $name = rcube_addressbook::compose_list_name($record); $contact = format_email_recipient($email, $name); // skip entries that don't match @@ -95,17 +95,17 @@ if (!empty($book_types) && strlen($search)) { if (empty($contacts[$index])) { $contact = array( 'name' => $contact, - 'type' => $sql_arr['_type'], - 'id' => $sql_arr['ID'], + 'type' => $record['_type'], + 'id' => $record['ID'], 'source' => $abook_id, ); - if (($display = rcube_addressbook::compose_search_name($sql_arr, $email, $name)) && $display != $contact['name']) { + if (($display = rcube_addressbook::compose_search_name($record, $email, $name)) && $display != $contact['name']) { $contact['display'] = $display; } // groups with defined email address will not be expanded to its members' addresses - if ($sql_arr['_type'] == 'group') { + if ($record['_type'] == 'group') { $contact['email'] = $email; }