From f9a967763e2a4cc595b44f40ac1ca666b2a02af6 Mon Sep 17 00:00:00 2001 From: thomascube Date: Sat, 11 Feb 2012 11:28:58 +0000 Subject: User configurable setting how to display contact names in list --- program/steps/mail/addcontact.inc | 5 ++++- program/steps/mail/list_contacts.inc | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'program/steps/mail') diff --git a/program/steps/mail/addcontact.inc b/program/steps/mail/addcontact.inc index 8e11272e0..74768116e 100644 --- a/program/steps/mail/addcontact.inc +++ b/program/steps/mail/addcontact.inc @@ -61,7 +61,10 @@ if (!empty($_POST['_address']) && is_object($CONTACTS)) } $contact['email'] = rcube_idn_to_utf8($contact['email']); - $contact['name'] = rcube_addressbook::compose_display_name($contact); + $contact = $RCMAIL->plugins->exec_hook('contact_displayname', $contact); + + if (empty($contact['firstname']) || empty($contact['surname'])) + $contact['name'] = rcube_addressbook::compose_display_name($contact); // validate contact record if (!$CONTACTS->validate($contact, true)) { diff --git a/program/steps/mail/list_contacts.inc b/program/steps/mail/list_contacts.inc index 23804b155..0791ae350 100644 --- a/program/steps/mail/list_contacts.inc +++ b/program/steps/mail/list_contacts.inc @@ -68,7 +68,7 @@ if ($CONTACTS && $CONTACTS->ready) { else if (!empty($result) && $result->count > 0) { // create javascript list while ($row = $result->next()) { - $name = rcube_addressbook::compose_display_name($row, true); + $name = rcube_addressbook::compose_list_name($row); // add record for every email address of the contact foreach ($CONTACTS->get_col_values('email', $row, true) as $i => $email) { -- cgit v1.2.3