Fixed the string module data in reports of items 'general'. #1819

This commit is contained in:
mdtrooper 2015-02-23 15:13:21 +01:00
parent e6be7e7143
commit 609802eb44
2 changed files with 22 additions and 3 deletions

View File

@ -867,6 +867,14 @@ function modules_is_string_type ($id_type) {
return (bool)preg_match('/_string$/', $type_name); return (bool)preg_match('/_string$/', $type_name);
} }
function modules_is_string($id_agentmodule) {
$id_type = db_get_value('id_tipo_modulo',
'tagente_modulo', 'id_agente_modulo',
(int) $id_agentmodule);
return modules_is_string_type($id_type);
}
/** /**
* Get the icon of a module type * Get the icon of a module type
* *

View File

@ -5490,8 +5490,13 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data[3] = '--'; $data[3] = '--';
} }
else { else {
$data[3] = format_for_graph($d, 2) . " " . if (!is_numeric($d)) {
$units[$i]; $data[3] = $d;
}
else {
$data[3] = format_for_graph($d, 2) . " " .
$units[$i];
}
} }
array_push ($table1->data, $data); array_push ($table1->data, $data);
$i++; $i++;
@ -5660,7 +5665,13 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$data[$i] = '--'; $data[$i] = '--';
} }
else { else {
$data[$i] = format_for_graph($value_res, 2) . " " . $unit; if (!is_numeric($d)) {
$data[$i] = $value_res;
}
else {
$data[$i] = format_for_graph($value_res, 2) . " " . $unit;
}
} }
$found = true; $found = true;
} }