| | |
| | | /** |
| | | * Get a specific contact record |
| | | * |
| | | * @param mixed record identifier(s) |
| | | * @param mixed Record identifier(s) |
| | | * @param boolean True to return record as associative array, otherwise a result set is returned |
| | | * |
| | | * @return mixed Result object with all record fields or False if not found |
| | | * @return rcube_result_set|array Result object with all record fields |
| | | */ |
| | | abstract function get_record($id, $assoc=false); |
| | | |
| | |
| | | else if ($compose_mode == 1) |
| | | $fn = join(' ', array($contact['firstname'], $contact['middlename'], $contact['surname'])); |
| | | else if ($compose_mode == 0) |
| | | $fn = !empty($contact['name']) ? $contact['name'] : join(' ', array($contact['prefix'], $contact['firstname'], $contact['middlename'], $contact['surname'], $contact['suffix'])); |
| | | $fn = $contact['name'] ?: join(' ', array($contact['prefix'], $contact['firstname'], $contact['middlename'], $contact['surname'], $contact['suffix'])); |
| | | else { |
| | | $plugin = rcube::get_instance()->plugins->exec_hook('contact_listname', array('contact' => $contact)); |
| | | $fn = $plugin['fn']; |
| | |
| | | // fallbacks... |
| | | if ($fn === '') { |
| | | // ... display name |
| | | if (!empty($contact['name'])) { |
| | | $fn = $contact['name']; |
| | | if ($name = trim($contact['name'])) { |
| | | $fn = $name; |
| | | } |
| | | // ... organization |
| | | else if (!empty($contact['organization'])) { |
| | | $fn = $contact['organization']; |
| | | else if ($org = trim($contact['organization'])) { |
| | | $fn = $org; |
| | | } |
| | | // ... email address |
| | | else if (($email = self::get_col_values('email', $contact, true)) && !empty($email)) { |