From c923cb98449b00df32af5a6024520a3bb776e825 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 7 Apr 2010 15:58:44 +0000 Subject: [PATCH] 2010-04-07 Miguel de Dios * godmode/alerts/alert_list.list.php: fixed the id of agent in source and now hide the column agent in list when the edit alerts is in the agent configuration. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2549 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++ .../godmode/alerts/alert_list.list.php | 55 +++++++++++-------- 2 files changed, 38 insertions(+), 23 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 327371ce75..c8f7125c4a 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2010-04-07 Miguel de Dios + + * godmode/alerts/alert_list.list.php: fixed the id of agent in source and + now hide the column agent in list when the edit alerts is in the agent + configuration. + 2010-04-07 Miguel de Dios * ChangeLog: fixed date of last commit. diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index c413745a22..134da5aaef 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -25,9 +25,7 @@ if (! give_acl ($config['id_user'], 0, "LW")) { exit; } -$id_group = 0; /* Check if this page is included from a agent edition */ -$id_agente = 0; if (! give_acl ($config['id_user'], 0, "LW")) { audit_db ($config['id_user'], $_SERVER['REMOTE_ADDR'], "ACL Violation", @@ -112,18 +110,29 @@ $table->width = '90%'; $table->size = array (); $table->head = array (); $table->head[0] = "" . __('E/D') . ""; - -$table->style = array (); -$table->style[1] = 'font-weight: bold'; -$table->head[1] = __('Agent'); -$table->size[0] = '20px'; -$table->size[1] = '15%'; -$table->size[2] = '20%'; -$table->size[3] = '15%'; -if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { - $table->size[4] = '20px'; +if (! $id_agente) { + $table->style = array (); + $table->style[1] = 'font-weight: bold'; + $table->head[1] = __('Agent'); + $table->size[0] = '20px'; + $table->size[1] = '15%'; + $table->size[2] = '20%'; + $table->size[3] = '15%'; + if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { + $table->size[4] = '20px'; + } + $table->size[5] = '50%'; +} +else { + /* Different sizes or the layout screws up */ + $table->size[0] = '20px'; + $table->size[2] = '30%'; + $table->size[3] = '20%'; + if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { + $table->size[4] = '20px'; + } + $table->size[5] = '50%'; } -$table->size[5] = '50%'; $table->head[2] = __('Module'); $table->head[3] = __('Template'); @@ -165,16 +174,16 @@ foreach ($simple_alerts as $alert) { } $data[0] .= print_input_hidden ('id_alert', $alert['id'], true); $data[0] .= ''; - - $id_agent = get_agentmodule_agent ($alert['id_agent_module']); - $data[1] = ''; - if ($alert['disabled']) - $data[1] .= ''; - $data[1] .= get_agent_name ($id_agent); - if ($alert['disabled']) - $data[1] .= ''; - $data[1] .= ''; - + if (! $id_agente) { + $id_agent = get_agentmodule_agent ($alert['id_agent_module']); + $data[1] = ''; + if ($alert['disabled']) + $data[1] .= ''; + $data[1] .= get_agent_name ($id_agent); + if ($alert['disabled']) + $data[1] .= ''; + $data[1] .= ''; + } $data[2] = get_agentmodule_name ($alert['id_agent_module']); $data[3] = '