mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
recursion taken in mind in group report
This commit is contained in:
parent
6b25ae6004
commit
5d69ca3126
@ -2972,7 +2972,11 @@ function reporting_group_report($report, $content)
|
||||
|
||||
$return['data']['count_events'] = count($events);
|
||||
|
||||
$return['data']['group_stats'] = reporting_get_group_stats($content['id_group']);
|
||||
$return['data']['group_stats'] = reporting_get_group_stats(
|
||||
$content['id_group'],
|
||||
'AR',
|
||||
(bool) $content['recursion']
|
||||
);
|
||||
|
||||
if ($config['metaconsole']) {
|
||||
metaconsole_restore_db();
|
||||
@ -8969,7 +8973,7 @@ function reporting_get_agents_detailed_event(
|
||||
*
|
||||
* @return array Group statistics
|
||||
*/
|
||||
function reporting_get_group_stats($id_group=0, $access='AR')
|
||||
function reporting_get_group_stats($id_group=0, $access='AR', $recursion=true)
|
||||
{
|
||||
global $config;
|
||||
|
||||
@ -9071,7 +9075,9 @@ function reporting_get_group_stats($id_group=0, $access='AR')
|
||||
// Store the groups where we are quering
|
||||
$covered_groups = [];
|
||||
$group_array = [];
|
||||
|
||||
foreach ($id_group as $group) {
|
||||
if ($recursion === true) {
|
||||
$children = groups_get_children($group);
|
||||
|
||||
// Show empty groups only if they have children with agents
|
||||
@ -9083,6 +9089,7 @@ function reporting_get_group_stats($id_group=0, $access='AR')
|
||||
array_push($group_array, $sub['id_grupo']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add id of this group to create the clause
|
||||
// If the group is quering previously, we ingore it
|
||||
|
Loading…
x
Reference in New Issue
Block a user