summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-07-25 11:48:50 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-07-25 11:48:50 +0000
commita3f4e43f6c042261551b7de9f916b8d4b034ad43 (patch)
tree553ce453885053fd96ed21bafb14d1c0d2666529 /roundcubemail/program/steps
parent290f4cc442269f79008553fd5f1b70d5784f4cdc (diff)
- Fixed display name on contact lists
git-svn-id: https://svn.roundcube.net/trunk@4965 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps')
-rw-r--r--roundcubemail/program/steps/addressbook/func.inc9
-rw-r--r--roundcubemail/program/steps/addressbook/save.inc4
2 files changed, 9 insertions, 4 deletions
diff --git a/roundcubemail/program/steps/addressbook/func.inc b/roundcubemail/program/steps/addressbook/func.inc
index f372c1c33..6b3ebad08 100644
--- a/roundcubemail/program/steps/addressbook/func.inc
+++ b/roundcubemail/program/steps/addressbook/func.inc
@@ -294,8 +294,13 @@ function rcmail_js_contacts_list($result, $prefix='')
}
// format each col
- foreach ($a_show_cols as $col)
- $a_row_cols[$col] = Q($row[$col]);
+ foreach ($a_show_cols as $col) {
+ $val = $row[$col];
+ if ($val == '' && $col == 'name') {
+ $val = rcube_addressbook::compose_display_name($row, true);
+ }
+ $a_row_cols[$col] = Q($val);
+ }
$OUTPUT->command($prefix.'add_contact_row', $row['ID'], $a_row_cols);
}
diff --git a/roundcubemail/program/steps/addressbook/save.inc b/roundcubemail/program/steps/addressbook/save.inc
index a8dd38f27..393eb5145 100644
--- a/roundcubemail/program/steps/addressbook/save.inc
+++ b/roundcubemail/program/steps/addressbook/save.inc
@@ -188,8 +188,8 @@ if (!empty($cid))
$a_js_cols = array();
$record = $CONTACTS->get_record($newcid ? $newcid : $cid, true);
$record['email'] = reset($CONTACTS->get_col_values('email', $record, true));
- if (!$record['name'])
- $record['name'] = $record['email'];
+ if (empty($record['name']))
+ $record['name'] = rcube_addressbook::compose_display_name($record, true);
foreach (array('name', 'email') as $col)
$a_js_cols[] = Q((string)$record[$col]);