Merge branch 'ent-fix-custom-report' into 'develop'

Fixed custom report

See merge request artica/pandorafms!4167
This commit is contained in:
Daniel Rodriguez 2021-06-03 15:08:26 +00:00
commit a12c692972
2 changed files with 12 additions and 3 deletions

View File

@ -2406,12 +2406,14 @@ function modules_get_agentmodule_data(
$module_name = modules_get_agentmodule_name($id_agent_module);
$agent_id = modules_get_agentmodule_agent($id_agent_module);
$agent_name = modules_get_agentmodule_agent_name($id_agent_module);
$agent_alias = modules_get_agentmodule_agent_alias($id_agent_module);
$module_type = modules_get_agentmodule_type($id_agent_module);
foreach ($values as $key => $data) {
$values[$key]['module_name'] = $module_name;
$values[$key]['agent_id'] = $agent_id;
$values[$key]['agent_name'] = $agent_name;
$values[$key]['agent_alias'] = $agent_alias;
$values[$key]['module_type'] = $module_type;
}
@ -2429,6 +2431,7 @@ function modules_get_agentmodule_data(
'module_name' => $values[$key]['module_name'],
'agent_id' => $values[$key]['agent_id'],
'agent_name' => $values[$key]['agent_name'],
'agent_alias' => $values[$key]['agent_alias'],
'module_type' => $values[$key]['module_type'],
];
}

View File

@ -9060,8 +9060,8 @@ function reporting_custom_graph(
case 'data':
$data = [];
foreach ($modules as $key => $value) {
$data[$value] = modules_get_agentmodule_data(
$value,
$data[$value['module']] = modules_get_agentmodule_data(
$value['module'],
$content['period'],
$report['datetime']
);
@ -10557,7 +10557,13 @@ function reporting_get_stats_users($data)
$tdata = [];
$tdata[0] = html_print_image('images/user.png', true, ['title' => __('Defined users'), 'class' => 'invert_filter']);
$tdata[1] = count(get_users());
$user_groups = users_get_strict_mode_groups($config['id_user'], false);
if (array_key_exists(0, $user_groups)) {
$users = users_get_user_users($config['id_user'], 'AR', true);
} else {
$users = users_get_user_users($config['id_user'], 'AR', false);
}
$tdata[1] = count($users);
$tdata[1] = '<a class="big_data" href="'.$urls['defined_users'].'">'.$tdata[1].'</a>';
$tdata[2] = $tdata[3] = '&nbsp;';