From f7278fbd98765b32c3973c8bdb51c1112c6c04c0 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Tue, 15 Sep 2009 12:02:06 +0000 Subject: [PATCH] 2009-09-14 Miguel de Dios * godmode/agentes/module_manager.php: change the method for test if a module is a numeric, and can normalize. Now obtain the ids from modules tipe that it's not proc or string, and this ids use to test. Fixes: 2849325 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1942 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 ++++++ .../godmode/agentes/module_manager.php | 24 ++++++++++++++----- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index ad70f055a8..e7a198495b 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2009-09-14 Miguel de Dios + + * godmode/agentes/module_manager.php: change the method for test if a + module is a numeric, and can normalize. Now obtain the ids from modules tipe + that it's not proc or string, and this ids use to test. + Fixes: 2849325 + 2009-09-14 Miguel de Dios * godmode/reporting/map_builder.php: change (at the moment) the ajax for diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index bd0f717ced..ae8fb0e88d 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -105,6 +105,16 @@ $table->data = array (); $agent_interval = get_agent_interval ($id_agente); $last_modulegroup = "0"; + +//Extract the ids only numeric modules for after show the normalize link. +$tempRows = get_db_all_rows_sql("SELECT * + FROM ttipo_modulo + WHERE nombre NOT LIKE '%string%' AND nombre NOT LIKE '%proc%'"); +$numericModules = array(); +foreach($tempRows as $row) { + $numericModules[$row['id_tipo']] = true; +} + foreach ($modules as $module) { $type = $module["id_tipo_modulo"]; $id_module = $module["id_modulo"]; @@ -172,12 +182,14 @@ foreach ($modules as $module) { $data[6] .= ' '; // Make a data normalization - if (($type == 22) OR ($type == 1) OR ($type == 4) OR ($type == 7) OR - ($type == 8) OR ($type == 11) OR ($type == 16) OR ($type == 22)) { - $data[6] .= ''; - $data[6] .= print_image ('images/chart_curve.png', true, - array ('title' => __('Normalize'))); - $data[6] .= ''; + + if (isset($numericModules[$type])) { + if ($numericModules[$type] === true) { + $data[6] .= ''; + $data[6] .= print_image ('images/chart_curve.png', true, + array ('title' => __('Normalize'))); + $data[6] .= ''; + } } array_push ($table->data, $data);