forked from extern/egroupware
* Api - Fix references to sub-fields of custom field entries only merged for the first entry of each type
This commit is contained in:
parent
cb3de8cf91
commit
59483c4b79
@ -211,7 +211,7 @@ abstract class Merge
|
|||||||
* @param boolean $ignore_acl =false true: no acl check
|
* @param boolean $ignore_acl =false true: no acl check
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function contact_replacements($contact,$prefix='',$ignore_acl=false)
|
public function contact_replacements($contact,$prefix='',$ignore_acl=false, &$content = '')
|
||||||
{
|
{
|
||||||
if (!is_array($contact))
|
if (!is_array($contact))
|
||||||
{
|
{
|
||||||
@ -287,6 +287,11 @@ abstract class Merge
|
|||||||
Customfields::format($field, (string)$contact[$name]);
|
Customfields::format($field, (string)$contact[$name]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($content && strpos($content, '$$#') !== FALSE)
|
||||||
|
{
|
||||||
|
$this->cf_link_to_expand($contact, $content, $replacements, 'addressbook');
|
||||||
|
}
|
||||||
|
|
||||||
// Add in extra cat field
|
// Add in extra cat field
|
||||||
$cats = array();
|
$cats = array();
|
||||||
foreach(is_array($contact['cat_id']) ? $contact['cat_id'] : explode(',',$contact['cat_id']) as $cat_id)
|
foreach(is_array($contact['cat_id']) ? $contact['cat_id'] : explode(',',$contact['cat_id']) as $cat_id)
|
||||||
@ -1356,7 +1361,6 @@ abstract class Merge
|
|||||||
$expand_sub_cfs[$cf[$index]] .= '$$'.$cf_sub . '$$ ';
|
$expand_sub_cfs[$cf[$index]] .= '$$'.$cf_sub . '$$ ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$expand_sub_cfs = array_unique($expand_sub_cfs);
|
|
||||||
|
|
||||||
foreach($cf as $index => $field)
|
foreach($cf as $index => $field)
|
||||||
{
|
{
|
||||||
@ -1413,7 +1417,7 @@ abstract class Merge
|
|||||||
$replacements = array();
|
$replacements = array();
|
||||||
if($app == 'addressbook')
|
if($app == 'addressbook')
|
||||||
{
|
{
|
||||||
return $this->contact_replacements($id, $prefix);
|
return $this->contact_replacements($id, $prefix, false, $content);
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
Loading…
Reference in New Issue
Block a user