From 65dba0156c60eba634c5401848232f32abeb2766 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 24 Jun 2009 16:04:19 +0000 Subject: [PATCH] 2009-06-24 Miguel de Dios * operation/agentes/estado_monitores.php: add organization list of monitors, add row in table with title the monitor group. * include/styles/pandora.css: add new class for cell used monitor group title in the list of monitors in estado_monitores.php Fixes: #2805001 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1764 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 12 +++++- pandora_console/include/styles/pandora.css | 6 +++ .../operation/agentes/estado_monitores.php | 40 +++++++++++++++---- 3 files changed, 49 insertions(+), 9 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 39ba53e34e..8de9ed612e 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2009-06-24 Miguel de Dios + + * operation/agentes/estado_monitores.php: add organization list of monitors, add + row in table with title the monitor group. + * include/styles/pandora.css: add new class for cell used monitor group title + in the list of monitors in estado_monitores.php + Fixes: #2805001 + 2009-06-24 Jorge Gonzalez * include/functions_reporting.php, include/functions_ui.php, @@ -20,8 +28,8 @@ * translation. * include/languages/index.pot: Updated po template. - -2009-06-24 Miguel de Dios + +2009-06-24 Miguel de Dios * pandora_console/godmode/groups/group_list.php: fix group without image don't print image tag. diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 70c2e9efba..de2f5da760 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -319,6 +319,12 @@ tr.datos2b:hover, tr.datos2_id:hover, tr.datos2f9:hover { td.datos3 { background-color: #d4ddc6; } +td.datos4 { + //Add !important because in php the function print_table write style in cell and this is style head. + text-align: center !important; + background-color: #d4ddc6; +} + td.datos_id { color: #1a313a; } diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index 2652dbfb6d..307ddd32b9 100644 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -25,12 +25,18 @@ if (!isset ($id_agente)) { } // Get all module from agent -$sql = sprintf ("SELECT * FROM tagente_estado, tagente_modulo WHERE tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo - AND tagente_modulo.id_agente = %d - AND tagente_modulo.disabled = 0 - AND tagente_modulo.delete_pending = 0 - AND tagente_estado.utimestamp != 0 - ORDER BY tagente_modulo.nombre", $id_agente); +$sql = sprintf (" + SELECT * + FROM tagente_estado, tagente_modulo + LEFT JOIN tmodule_group + ON tmodule_group.id_mg = tagente_modulo.id_module_group + WHERE tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo + AND tagente_modulo.id_agente = %d + AND tagente_modulo.disabled = 0 + AND tagente_modulo.delete_pending = 0 + AND tagente_estado.utimestamp != 0 + ORDER BY tagente_modulo.id_module_group , tagente_modulo.nombre + ", $id_agente); $modules = get_db_all_rows_sql ($sql); if (empty ($modules)) { @@ -53,7 +59,25 @@ $table->head[6] = __('Last contact'); $table->align = array("left","left","left","left","center"); + +$last_modulegroup = 0; +$rowIndex = 0; foreach ($modules as $module) { + + //The code add the row of 1 cell with title of group for to be more organice the list. + + if ($module["id_module_group"] != $last_modulegroup) + { + $table->colspan[$rowIndex][0] = count($table->head); + $table->rowclass[$rowIndex] = 'datos4'; + + array_push ($table->data, array (''.$module['name'].'')); + + $rowIndex++; + $last_modulegroup = $module["id_module_group"]; + } + //End of title of group + $data = array (); if (($module["id_modulo"] != 1) && ($module["id_tipo_modulo"] != 100)) { if ($module["flag"] == 0) { @@ -111,8 +135,10 @@ foreach ($modules as $module) { } $data[6] .= print_timestamp ($module["utimestamp"], true); $data[6] .= ''; + array_push ($table->data, $data); -} + $rowIndex++; +} if (empty ($table->data)) { echo '
'.__('This agent doesn\'t have any active monitors').'
';