From c2b678ef954d9f39cc4c7d0886a07eb38e230450 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Diaz Date: Tue, 13 Oct 2015 12:34:01 +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 386da0ba10..60829e06aa 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -141,17 +141,26 @@ function treeview_printModuleTable($id_module, $server_data = false) { // 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 {