From b705e4abf52628bae88b95fd9705c028e0bd71d5 Mon Sep 17 00:00:00 2001 From: vgilc Date: Fri, 20 Apr 2012 09:07:34 +0000 Subject: [PATCH] 2012-04-20 Vanessa Gil * godmode/alerts/alert_list.builder.php: Fixed bug: In tab alert within agent detail, the actions depends on the template. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6057 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 ++ .../godmode/alerts/alert_list.builder.php | 90 ++++--------------- 2 files changed, 21 insertions(+), 74 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 7b04ce2375..c337a3fed0 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-04-20 Vanessa Gil + + * godmode/alerts/alert_list.builder.php: Fixed bug: In tab alert + within agent detail, the actions depends on the template. + 2012-04-20 Kikuchi Koichiro * extensions/update_manager.php, diff --git a/pandora_console/godmode/alerts/alert_list.builder.php b/pandora_console/godmode/alerts/alert_list.builder.php index 11dc8c8a5d..d36c9df942 100644 --- a/pandora_console/godmode/alerts/alert_list.builder.php +++ b/pandora_console/godmode/alerts/alert_list.builder.php @@ -64,8 +64,6 @@ $table->data[0][1] .= ' '; $table->data[0][1] .= ' '; -$table->data[1][0] = __('Template'); - $table->data[1][0] = __('Template'); $own_info = get_user_info ($config['id_user']); if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) @@ -89,13 +87,25 @@ if (check_acl ($config['id_user'], 0, "LM")) { } $table->data[2][0] = __('Actions'); + +$groups_user = users_get_groups($config["id_user"]); +if (!empty($groups_user)) { + $groups = implode(',', array_keys($groups_user)); + $sql = "SELECT name FROM talert_actions WHERE id_group IN ($groups)"; + $actions = db_get_all_rows_sql($sql); +} -$actions = array ('0' => __('None')); +$i=1; +$action_name = array ('0' => __('None')); +foreach ($actions as $action) { + foreach ($action as $key=>$name) { + $action_name[$i] = $name; + $i++; + } +} $table->data[2][1] = '
'; -$table->data[2][1] = html_print_select($actions,'action_select','','','','',true); -$table->data[2][1] .= ' '; +$table->data[2][1] = html_print_select($action_name,'action_select_','','','','',true, '', false); $table->data[2][1] .= '