From 28090d38c137e05927896b11732ddf6bfe1cffbf Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 1 Jul 2016 10:12:44 +0200 Subject: [PATCH] Use contact_search_name format in popup on results in compose contacts search --- CHANGELOG | 1 + program/steps/mail/search_contacts.inc | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 821e6741f..b791a3837 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -24,6 +24,7 @@ CHANGELOG Roundcube Webmail - Fix bug where microsecond format in logged date didn't work in some cases - Fix conflict in new_user_dialog and password_force_new_user settings (#5275) - Don't create multipart/alternative messages with empty text/plain part (#5283) +- Use contact_search_name format in popup on results in compose contacts search RELEASE 1.2.0 ------------- diff --git a/program/steps/mail/search_contacts.inc b/program/steps/mail/search_contacts.inc index 12066a99d..3280ea012 100644 --- a/program/steps/mail/search_contacts.inc +++ b/program/steps/mail/search_contacts.inc @@ -46,9 +46,6 @@ foreach ($sources as $s) { continue; } - // get records - $result = $source->list_records($afields); - while ($row = $result->next()) { $row['sourceid'] = $s['id']; $key = rcube_addressbook::compose_contact_key($row, $addr_sort_col); @@ -86,8 +83,10 @@ if (!empty($result) && $result->count > 0) { foreach ($emails as $i => $email) { $row_id = $row['ID'].'-'.$i; $jsresult[$row_id] = format_email_recipient($email, $name); + $title = rcube_addressbook::compose_search_name($row, $email, $name); + $OUTPUT->command('add_contact_row', $row_id, array( - 'contact' => html::a(array('title' => $email), rcube::Q($name ?: $email) . + 'contact' => html::a(array('title' => $title), rcube::Q($name ?: $email) . ($name && count($emails) > 1 ? ' ' . html::span('email', rcube::Q($email)) : '') )), 'person'); }