forked from extern/egroupware
* Addressbook - Allow multiselection for customfield added to link title
This commit is contained in:
parent
8f99f175aa
commit
3c5b7c8ba5
@ -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,
|
||||
|
@ -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 ;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user