diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 38f14795cf..d2a327d58a 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,12 @@ +2009-03-27 Esteban Sanchez + + * include/functions_ui.php: Put template details icon on the left of + the cell. + + * operation/agentes/alerts_status.php: Fixed validation errors. Moved + validation to the top before reading the alerts. Added some size info + to the tables. + 2009-03-27 Esteban Sanchez * pandoradb.sql, extras/pandoradb_migrate_v2.x_to_v3.0.sql: Fixed diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 25ef8ca8ea..4e46b2eb24 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -271,15 +271,13 @@ function format_alert_row ($alert, $compound = false, $agent = true, $url = '') $data[1] = print_agent_name (get_agentmodule_agent ($alert["id_agent_module"]), true, 20); } - $data[2] = ''; - $data[2] .= mb_substr (safe_input ($description), 0, 35); - $data[2] .= ''; + $data[2] = ''; if (! $compound) { - $data[2] .= ' '; $data[2] .= ''; - $data[2] .= ''; - $data[2] .= ''; + $data[2] .= print_image ('images/zoom.png', true); + $data[2] .= ' '; } + $data[2] .= mb_substr (safe_input ($description), 0, 35); $data[3] = print_timestamp ($alert["last_fired"], true); diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index 59df9a565f..2848edc1d6 100644 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -34,12 +34,30 @@ $url = 'index.php?sec='.$sec.'&sec2='.$sec2.'&refr='.$config["refr"].'&filter='. // Force alert execution $flag_alert = (bool) get_parameter ('force_execution'); -if ($flag_alert == 1 && give_acl ($config['id_user'], $id_grupo, "AW")) { +$alert_validate = (bool) get_parameter ('alert_validate'); + +if ($flag_alert == 1 && give_acl ($config['id_user'], $id_group, "AW")) { require_once ("include/functions_alerts.php"); $id_alert = (int) get_parameter ('id_alert'); set_alerts_agent_module_force_execution ($id_alert); } +if ($alert_validate) { + $ids = (array) get_parameter_post ("validate", array ()); + $compound_ids = (array) get_parameter_post ("validate_compound", array ()); + + if (! empty ($ids) || ! empty ($compound_ids)) { + require_once ("include/functions_alerts.php"); + $result1 = validate_alert_agent_module ($ids); + $result2 = validate_alert_compound ($compound_ids); + $result == $result1 || $result2; + + print_result_message ($result, + __('Alert(s) validated'), + __('Error processing alert(s)')); + } +} + // Show alerts for specific agent if (isset ($_GET["id_agente"])) { $id_agent = (int) get_parameter_get ("id_agente", 0); @@ -86,22 +104,6 @@ if ($tab != '') { echo "

".__('Pandora Agents')." > ".__('Alerts').'

'; -if (get_parameter ('alert_validate')) { - $ids = (array) get_parameter_post ("validate", array ()); - $compound_ids = (array) get_parameter_post ("validate_compound", array ()); - - if (! empty ($ids) || ! empty ($compound_ids)) { - require_once ("include/functions_alerts.php"); - $result1 = validate_alert_agent_module ($ids); - $result2 = validate_alert_compound ($compound_ids); - $result == $result1 || $result2; - - print_result_message ($result, - __('Alert(s) validated'), - __('Error processing alert(s)')); - } -} - echo '
'; if ($print_agent) { @@ -127,6 +129,13 @@ echo '
'; $table->width = '90%'; $table->class = "databox"; +$table->size = array (); +$table->size[0] = '20px'; +$table->size[1] = '25%'; +$table->size[2] = '50%'; +$table->size[3] = '25%'; +$table->size[4] = '20px'; +$table->size[5] = '20px'; $table->head = array (); $table->head[0] = ''; $table->head[1] = ''; //Placeholder for name @@ -157,6 +166,8 @@ foreach ($alerts_simple as $alert) { array_push ($table->data, format_alert_row ($alert, false, $print_agent, $url)); } +echo '
'; + if (!empty ($table->data)) { pagination ($total, $url, $offset); print_table ($table);