diff --git a/addressbook/inc/class.addressbook_hooks.inc.php b/addressbook/inc/class.addressbook_hooks.inc.php index 67116fa5f0..20bf44184f 100644 --- a/addressbook/inc/class.addressbook_hooks.inc.php +++ b/addressbook/inc/class.addressbook_hooks.inc.php @@ -181,7 +181,7 @@ class addressbook_hooks if (($cf_opts = Api\Contacts::cf_options())) { $settings['link_title_cf'] = array( - 'type' => 'select', + 'type' => 'multiselect', 'label' => 'Add a customfield to link title', 'name' => 'link_title_cf', 'values' => $cf_opts, diff --git a/api/src/Contacts.php b/api/src/Contacts.php index 81ed028a8c..cc45a06bae 100755 --- a/api/src/Contacts.php +++ b/api/src/Contacts.php @@ -1494,9 +1494,13 @@ class Contacts extends Contacts\Storage $type = null; } $title = $this->fileas($contact,$type); - if ($this->prefs['link_title_cf'] && $contact['#'.$this->prefs['link_title_cf']]) + $field_list = is_string($this->prefs['link_title_cf']) ? explode(',', $this->prefs['link_title_cf']) : $this->prefs['link_title_cf']; + foreach ($field_list as $field) { - $title .= ' ' . $contact['#'.$this->prefs['link_title_cf']]; + if($contact['#'.$field]) + { + $title .= ', ' . $contact['#'.$field]; + } } return $title ; }