summaryrefslogtreecommitdiff
path: root/program/steps/mail
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2012-02-11 11:28:58 +0000
committerthomascube <thomas@roundcube.net>2012-02-11 11:28:58 +0000
commitf9a967763e2a4cc595b44f40ac1ca666b2a02af6 (patch)
treeacf8a043fe90dbe860888402f718608eaaee8344 /program/steps/mail
parentd3ec72522b44e3c8d5ff29edecde866a9199f921 (diff)
User configurable setting how to display contact names in list
Diffstat (limited to 'program/steps/mail')
-rw-r--r--program/steps/mail/addcontact.inc5
-rw-r--r--program/steps/mail/list_contacts.inc2
2 files changed, 5 insertions, 2 deletions
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) {