mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
fix delete-account did not show 0 entries for InfoLog, also give a total per InfoLog type
This commit is contained in:
parent
c6cb42eb96
commit
e5a6f195dc
@ -376,7 +376,11 @@ class admin_account
|
||||
$content['delete_apps'][] = $app;
|
||||
$sel_options['delete_apps'][] = array(
|
||||
'value' => $app,
|
||||
'label' => lang($app) . (is_array($counts) ? (': ' . $counts['total'] . ' ' . $entry) : '')
|
||||
'label' => lang($app) . (is_array($counts) ? (': ' . $counts['total'] . ' ' . $entry.
|
||||
(count($counts) > 1 ? ' ('.implode(', ', array_map(static function($type) use ($counts)
|
||||
{
|
||||
return $type.': '.$counts[$type];
|
||||
}, array_diff(array_keys($counts), ['total']))).')' : '')) : '')
|
||||
);
|
||||
}
|
||||
else if (is_array($counts) && $counts['total'])
|
||||
@ -496,4 +500,4 @@ class admin_account
|
||||
Api\Json\Response::get()->data($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1159,8 +1159,7 @@ class Accounts
|
||||
{
|
||||
$owner_columns = static::get_owner_columns();
|
||||
|
||||
$selects = array();
|
||||
|
||||
$selects = $counts = [];
|
||||
foreach($owner_columns as $app => $column)
|
||||
{
|
||||
list($table, $column_name) = explode('.', $column['column']);
|
||||
@ -1184,15 +1183,11 @@ class Accounts
|
||||
break;
|
||||
}
|
||||
$selects[] = $select;
|
||||
$counts[$app] = ['total' => 0];
|
||||
}
|
||||
|
||||
$counts = array();
|
||||
foreach($GLOBALS['egw']->db->union($selects, __LINE__ , __FILE__) as $row)
|
||||
{
|
||||
if(!is_array($counts[$row['app']]))
|
||||
{
|
||||
$counts[$row['app']] = array('total' => 0);
|
||||
}
|
||||
$counts[$row['app']][$row['type']] = $row['count'];
|
||||
if($row['type'] != 'total')
|
||||
{
|
||||
@ -1540,4 +1535,4 @@ class Accounts
|
||||
self::$_instance = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user