- DOn't generate contact name here, it's not required
| | |
| | | if ($section == 'head') { |
| | | $content = ''; |
| | | |
| | | // unset display name if it is composed from name parts (same composition function as in save.inc) |
| | | // unset display name if it is composed from name parts |
| | | if ($record['name'] == rcube_addressbook::compose_display_name(array('name' => '') + (array)$record)) |
| | | unset($record['name']); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | // let a dedicated function or a plugin compose the full name if empty |
| | | if (empty($a_record['name'])) { |
| | | $a_record['name'] = rcube_addressbook::compose_display_name($a_record); |
| | | } |
| | | |
| | | |
| | | // do input checks (delegated to $CONTACTS instance) |
| | | if (!$CONTACTS->validate($a_record)) { |
| | |
| | | // show notice if existing contacts with same e-mail are found |
| | | $existing = false; |
| | | foreach ($CONTACTS->get_col_values('email', $a_record, true) as $email) { |
| | | if (($res = $CONTACTS->search('email', $email, false, false)) && $res->count) { |
| | | if (($res = $CONTACTS->search('email', $email, false, false, true)) && $res->count) { |
| | | $OUTPUT->show_message('contactexists', 'notice', null, false); |
| | | break; |
| | | } |