final merge 3360 ticket

This commit is contained in:
marcos.alconada 2019-07-03 17:07:31 +02:00
parent 8ef22373a7
commit 2ad44fcf90
3 changed files with 13 additions and 5 deletions

View File

@ -1554,7 +1554,13 @@ function agents_get_alias($id_agent, $case='none')
function agents_get_alias_by_name($name, $case='none')
{
$alias = (string) db_get_value('alias', 'tagente', 'nombre', $name);
if (is_metaconsole()) {
$table = 'tmetaconsole_agent';
} else {
$table = 'tagente';
}
$alias = (string) db_get_value('alias', $table, 'nombre', $name);
switch ($case) {
case 'upper':

View File

@ -6969,6 +6969,7 @@ function reporting_general($report, $content)
$mod_name = modules_get_agentmodule_name($row['id_agent_module']);
$ag_name = modules_get_agentmodule_agent_alias($row['id_agent_module']);
$name_agent = modules_get_agentmodule_agent_name($row['id_agent_module']);
$type_mod = modules_get_last_value($row['id_agent_module']);
$is_string[$index] = modules_is_string($row['id_agent_module']);
$unit = db_get_value(
@ -7043,12 +7044,12 @@ function reporting_general($report, $content)
}
if ($data_res[$index] === false) {
$return['data'][$ag_name][$mod_name] = null;
$return['data'][$name_agent][$mod_name] = null;
} else {
if (!is_numeric($data_res[$index])) {
$return['data'][$ag_name][$mod_name] = $data_res[$index];
$return['data'][$name_agent][$mod_name] = $data_res[$index];
} else {
$return['data'][$ag_name][$mod_name] = format_for_graph($data_res[$index], 2).' '.$unit;
$return['data'][$name_agent][$mod_name] = format_for_graph($data_res[$index], 2).' '.$unit;
}
}
break;

View File

@ -3496,7 +3496,8 @@ function reporting_html_general($table, $item, $pdf=0)
$table1->head = array_merge([__('Agent')], $list_modules);
foreach ($item['data'] as $agent => $modules) {
$row = [];
$row['agent'] = $agent;
$alias = agents_get_alias_by_name($agent);
$row['agent'] = $alias;
$table1->style['agent'] = 'text-align: center;';
foreach ($list_modules as $name) {
$table1->style[$name] = 'text-align: center;';