Changeset 4965 in subversion
- Timestamp:
- Jul 25, 2011 7:48:50 AM (22 months ago)
- Location:
- trunk/roundcubemail/program
- Files:
-
- 3 edited
-
include/rcube_addressbook.php (modified) (2 diffs)
-
steps/addressbook/func.inc (modified) (1 diff)
-
steps/addressbook/save.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_addressbook.php
r4919 r4965 435 435 * 436 436 * @param array Hash array with contact data as key-value pairs 437 * @param bool The name will be used on the list 438 * 437 439 * @return string Display name 438 440 */ 439 public static function compose_display_name($contact )441 public static function compose_display_name($contact, $list_mode = false) 440 442 { 441 443 $contact = rcmail::get_instance()->plugins->exec_hook('contact_displayname', $contact); … … 447 449 // use email address part for name 448 450 $email = is_array($contact['email']) ? $contact['email'][0] : $contact['email']; 451 449 452 if ($email && (empty($fn) || $fn == $email)) { 453 // Use full email address on contacts list 454 if ($list_mode) 455 return $email; 456 450 457 list($emailname) = explode('@', $email); 451 458 if (preg_match('/(.*)[\.\-\_](.*)/', $emailname, $match)) -
trunk/roundcubemail/program/steps/addressbook/func.inc
r4959 r4965 295 295 296 296 // format each col 297 foreach ($a_show_cols as $col) 298 $a_row_cols[$col] = Q($row[$col]); 297 foreach ($a_show_cols as $col) { 298 $val = $row[$col]; 299 if ($val == '' && $col == 'name') { 300 $val = rcube_addressbook::compose_display_name($row, true); 301 } 302 $a_row_cols[$col] = Q($val); 303 } 299 304 300 305 $OUTPUT->command($prefix.'add_contact_row', $row['ID'], $a_row_cols); -
trunk/roundcubemail/program/steps/addressbook/save.inc
r4959 r4965 189 189 $record = $CONTACTS->get_record($newcid ? $newcid : $cid, true); 190 190 $record['email'] = reset($CONTACTS->get_col_values('email', $record, true)); 191 if ( !$record['name'])192 $record['name'] = $record['email'];191 if (empty($record['name'])) 192 $record['name'] = rcube_addressbook::compose_display_name($record, true); 193 193 194 194 foreach (array('name', 'email') as $col)
Note: See TracChangeset
for help on using the changeset viewer.
