From d9088a6eb4a39f75a15fa52182f1cb7c9b9fc6c6 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Thu, 22 Apr 2010 16:51:23 +0000 Subject: [PATCH] 2010-04-22 Sergio Martin * include/functions_ui.php include/functions_agents.php include/functions_db.php: Change the way of validate the All group. Now the group All has id_group = 0 and is not on the database * extensions/module_groups.php: Remove the All group row from the table. Inprove the table style * operation/agentes/status_monitor.php operation/agentes/alerts_status.php operation/agentes/estado_agente.php operation/agentes/exportdata.php operation/agentes/networkmap.php godmode/agentes/modificar_agente.php godmode/agentes/planned_downtime.php: Changed the All group on combos from 1 to 0 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2588 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 20 +++++++++ pandora_console/extensions/module_groups.php | 23 +++++----- .../godmode/agentes/modificar_agente.php | 13 ++---- .../godmode/agentes/planned_downtime.php | 9 ++-- pandora_console/include/functions_agents.php | 6 +-- pandora_console/include/functions_db.php | 43 +++++++++++++------ pandora_console/include/functions_ui.php | 7 ++- .../operation/agentes/alerts_status.php | 2 +- .../operation/agentes/estado_agente.php | 2 +- .../operation/agentes/exportdata.php | 4 +- .../operation/agentes/networkmap.php | 2 +- .../operation/agentes/status_monitor.php | 8 ++-- 12 files changed, 88 insertions(+), 51 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index ac79ec0a0e..3e4dae0261 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,23 @@ +2010-04-22 Sergio Martin + + * include/functions_ui.php + include/functions_agents.php + include/functions_db.php: Change the way of validate + the All group. Now the group All has id_group = 0 + and is not on the database + + * extensions/module_groups.php: Remove the All + group row from the table. Inprove the table style + + * operation/agentes/status_monitor.php + operation/agentes/alerts_status.php + operation/agentes/estado_agente.php + operation/agentes/exportdata.php + operation/agentes/networkmap.php + godmode/agentes/modificar_agente.php + godmode/agentes/planned_downtime.php: Changed the + All group on combos from 1 to 0 + 2010-04-22 Sergio Martin * godmode/groups/group_list.php: Added validation diff --git a/pandora_console/extensions/module_groups.php b/pandora_console/extensions/module_groups.php index 5b18c812e7..8dd914d190 100644 --- a/pandora_console/extensions/module_groups.php +++ b/pandora_console/extensions/module_groups.php @@ -43,7 +43,7 @@ function mainModuleGroups() { echo "

" . __("This table shows in columns the modules group and in rows agents group. The cell shows all modules") . "

"; - $agentGroups = get_user_groups ($config['id_user']); + $agentGroups = get_user_groups ($config['id_user'], "AR", false); $modelGroups = get_all_model_groups(); array_walk($modelGroups, 'translate'); //Translate all head titles to language is set @@ -83,36 +83,37 @@ function mainModuleGroups() { } $color = 'transparent'; //Defaut color for cell - $font_color = '#ffffff'; //Default font color for cell + $font_color = '#000000'; //Default font color for cell if ($count == 0) { $color = '#babdb6'; //Grey when the cell for this model group and agent group hasn't modules. $alinkStart = ''; $alinkEnd = ''; } - else { - $alinkStart = ''; - $alinkEnd = ''; - + else { if (array_key_exists(0,$states) && (count($states) == 1)) $color = '#8ae234'; //Green when the cell for this model group and agent has OK state all modules. else { if (array_key_exists(1,$states)) { $color = '#cc0000'; //Red when the cell for this model group and agent has at least one module in critical state and the rest in any state. + $font_color = '#ffffff'; } else $color = '#fce94f'; //Yellow when the cell for this model group and agent has at least one in warning state and the rest in green state. } + + $alinkStart = ''; + $alinkEnd = ''; } array_push($row, '
- ' . $alinkStart . $count . ' modules' . $alinkEnd . '
'); + text-align: center; padding-top: 0px; font-size: 18px;"> + ' . $alinkStart . $count . $alinkEnd . ''); } array_push($tableData,$row); } diff --git a/pandora_console/godmode/agentes/modificar_agente.php b/pandora_console/godmode/agentes/modificar_agente.php index ee6144c092..20f0f8a77a 100644 --- a/pandora_console/godmode/agentes/modificar_agente.php +++ b/pandora_console/godmode/agentes/modificar_agente.php @@ -67,16 +67,9 @@ if (isset($_POST["ag_group"])){ echo ""; echo ""; echo "'; echo ''; echo '"; echo "
".__('Group').""; -echo ""; +print_select (get_user_groups(), "ag_group", $ag_group, 'this.form.submit();', '', 0); + echo "
' . __('Group') . '
'; -print_select_from_sql ('SELECT id_grupo, nombre FROM tgrupo WHERE id_grupo > 1 ORDER BY nombre', 'group', $group, '', 'All', 0, false); +print_select_from_sql ('SELECT id_grupo, nombre FROM tgrupo WHERE id_grupo > 0 ORDER BY nombre', 'group', $group, '', 'All', 0, false); echo '
' . __('Layout') . '
'; print_select ($layout_array, 'layout', $layout, '', '', ''); diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 606c076717..5ca23046d0 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -33,7 +33,7 @@ print_page_header ("Monitor detail", "images/bricks.png", false); $ag_freestring = get_parameter ('ag_freestring'); $ag_modulename = (string) get_parameter ('ag_modulename'); -$ag_group = (int) get_parameter ('ag_group', 1); +$ag_group = (int) get_parameter ('ag_group', 0); $offset = (int) get_parameter ('offset'); $status = (int) get_parameter ('status', 4); $modulegroup = (int) get_parameter ('modulegroup'); @@ -51,11 +51,11 @@ echo "
".__('Monitor status').""; $fields = array (); -$fields[0] = __('Normal'); //default +$fields[0] = __('Normal'); $fields[1] = __('Warning'); $fields[2] = __('Critical'); $fields[3] = __('Unknown'); -$fields[4] = __('Not normal'); +$fields[4] = __('Not normal'); //default $fields[5] = __('Not init'); print_select ($fields, "status", $status, 'this.form.submit();', __('All'), -1); @@ -92,7 +92,7 @@ $sql = " FROM tagente, tagente_modulo, tagente_estado AND tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo"; // Agent group selector -if ($ag_group > 1 && give_acl ($config["id_user"], $ag_group, "AR")) { +if ($ag_group > 0 && give_acl ($config["id_user"], $ag_group, "AR")) { $sql .= sprintf (" AND tagente.id_grupo = %d", $ag_group); } else { // User has explicit permission on group 1 ?