mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 00:13:35 +01:00
Correct category formatting
This commit is contained in:
parent
0c97c3bd10
commit
3980ba3692
@ -232,10 +232,16 @@ abstract class bo_merge
|
||||
foreach(is_array($contact['cat_id']) ? $contact['cat_id'] : explode(',',$contact['cat_id']) as $cat_id)
|
||||
{
|
||||
if(!$cat_id) continue;
|
||||
$cats[] = $GLOBALS['egw']->categories->id2name($cat_id,'path');
|
||||
$cats[$GLOBALS['egw']->categories->id2name($cat_id,'main')] = array();
|
||||
if($GLOBALS['egw']->categories->id2name($cat_id,'main') != $cat_id)
|
||||
{
|
||||
$cats[$GLOBALS['egw']->categories->id2name($cat_id,'main')][] = $GLOBALS['egw']->categories->id2name($cat_id,'name');
|
||||
}
|
||||
}
|
||||
foreach($cats as $main => $cat) {
|
||||
$replacements['$$'.($prefix ? $prefix.'/':'').'categories$$'] .= $GLOBALS['egw']->categories->id2name($main,'name')
|
||||
. (count($cat) > 0 ? ': ' : '') . implode(', ', $cats[$main]) . "\n";
|
||||
}
|
||||
$replacements['$$'.($prefix ? $prefix.'/':'').'categories$$'] = implode("\n",$cats);
|
||||
|
||||
return $replacements;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user