Removed last value on visual console boolean static graphs

This commit is contained in:
fermin831 2017-11-13 11:13:42 +01:00
parent 3493b9c15c
commit 6c519ff08a
2 changed files with 28 additions and 2 deletions

View File

@ -987,6 +987,28 @@ function modules_is_string($id_agentmodule) {
return modules_is_string_type($id_type);
}
/**
* Know if a module type is a boolean or not
*
* @param int $id_type Type id
*
* @return bool true if boolean. false if not
*/
function modules_is_boolean_type ($id_type) {
$type_name = modules_get_type_name($id_type);
return (bool)preg_match('/_proc$/', $type_name);
}
function modules_is_boolean($id_agentmodule) {
$id_type = db_get_value('id_tipo_modulo',
'tagente_modulo', 'id_agente_modulo',
(int) $id_agentmodule);
return modules_is_boolean_type($id_type);
}
/**
* Get the icon of a module type
*

View File

@ -1583,8 +1583,12 @@ function visual_map_print_item($mode = "read", $layoutData,
if (!empty($unit_text))
$value .= " " . $unit_text;
$img_style_title .= " <br>" . __("Last value: ") .
$value;
// Hide value on boolean modules
if (!modules_is_boolean($layoutData['id_agente_modulo'])) {
$img_style_title .=
" <br>" . __("Last value: ")
. $value;
}
}
if(get_parameter('action') == 'edit'){