From 6e6029267346a2e1916fb51793c50bf50f59d62c Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Diaz Date: Tue, 13 Oct 2015 12:35:40 +0200 Subject: [PATCH] Fixed module proc data in tree view(Now respect module types). Ticket #2713 --- .../include/functions_treeview.php | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index 9b4e831e91..2ea8ba5839 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -168,17 +168,26 @@ function treeview_printModuleTable($id_module, $server_data = false, $no_head = // Data $last_data = db_get_row_filter ('tagente_estado', array('id_agente_modulo' => $module['id_agente_modulo'], 'order' => array('field' => 'id_agente_estado', 'order' => 'DESC'))); if ($config["render_proc"]) { - if (is_numeric($last_data["datos"]) && $last_data["datos"] == 1) { - $data = "" . $config["render_proc_ok"] . ""; - } - else if (is_numeric($last_data["datos"]) && $last_data["datos"] == 0){ - $data = "" . $config["render_proc_fail"] . ""; - } - else { - if (is_numeric($last_data["datos"])) - $data = "" . format_numeric($last_data["datos"]) . ""; - else - $data = "" . substr(io_safe_output($last_data['datos']),0,12) . ""; + switch($module["id_tipo_modulo"]) { + case 2: + case 6: + case 9: + case 18: + case 21: + case 31: + if (is_numeric($last_data["datos"]) && $last_data["datos"] >= 1) { + $data = "" . $config["render_proc_ok"] . ""; + } + else { + $data = "" . $config["render_proc_fail"] . ""; + } + break; + default: + if (is_numeric($last_data["datos"])) + $data = "" . format_numeric($last_data["datos"]) . ""; + else + $data = "" . substr(io_safe_output($last_data['datos']),0,12) . ""; + break; } } else {