From 264604e8dee4476e4798dfcbdedae7e342b40cd2 Mon Sep 17 00:00:00 2001 From: hkosaka Date: Fri, 5 Jul 2013 08:28:48 +0000 Subject: [PATCH] 2013-07-05 Hirofumi Kosaka * godmode/alerts/alert_list.builder.php: When creating new alert, wrong action might be assigned to the alert (if you had some deleted actions in the past). Merged from branch 4.0 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8477 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 8 ++++++++ .../godmode/alerts/alert_list.builder.php | 13 ++----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index ab82636bbf..23a881a0b0 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,11 @@ +2013-07-05 Hirofumi Kosaka + + * godmode/alerts/alert_list.builder.php: When creating new + alert, wrong action might be assigned to the alert (if you had + some deleted actions in the past). + + Merged from branch 4.0 + 2013-07-04 Miguel de Dios * mobile/include/style/images/*, diff --git a/pandora_console/godmode/alerts/alert_list.builder.php b/pandora_console/godmode/alerts/alert_list.builder.php index 2bbd388c80..66042039e9 100644 --- a/pandora_console/godmode/alerts/alert_list.builder.php +++ b/pandora_console/godmode/alerts/alert_list.builder.php @@ -103,21 +103,12 @@ $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)"; + $sql = "SELECT id, name FROM talert_actions WHERE id_group IN ($groups)"; $actions = db_get_all_rows_sql($sql); } -$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($action_name,'action_select','','','','',true, '', false); +$table->data[2][1] = html_print_select(index_array ($actions, 'id', 'name'),'action_select','','','','',true, '', false); $table->data[2][1] .= '