From 9b28c8ee1b8b44d0eb537821ccf3e6891017b268 Mon Sep 17 00:00:00 2001 From: vgilc Date: Fri, 27 Apr 2012 12:32:40 +0000 Subject: [PATCH] 2012-04-27 Vanessa Gil * godmode/alerts/alerts_list.list.php: Fixed: Action filter don't show right actions group. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6210 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/godmode/alerts/alert_list.list.php | 14 +++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index b013c8988e..ff71ef8db6 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-04-27 Vanessa Gil + + * godmode/alerts/alerts_list.list.php: Fixed: Action filter + don't show right actions group. + 2012-04-27 Sergio Martin * include/functions_groups.php diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index 4318168eb2..1453e0d36d 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -64,20 +64,28 @@ array('style' => 'background: url(' . $src_code . ') no-repeat right;'), true); $form_filter .= ui_print_help_tip(__('Type at least two characters to search'), true); //' ' . __("Type at least two characters to search") . ''; $form_filter .= "\n"; - $form_filter .= "".__('Module name').""; $form_filter .= html_print_input_text ('module_name', $moduleName, '', 12, 255, true); $form_filter .= "\n"; $form_filter .= "\n"; +$all_groups = db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']); + +$groups_user = users_get_groups($config['id_user'], 'AR', $all_groups); +if ($groups_user === false) { + $groups_user = array(); +} +$groups_id = implode(',', array_keys($groups_user)); + + $form_filter .= "\n"; switch ($config["dbtype"]) { case "mysql": case "postgresql": - $temp = db_get_all_rows_sql("SELECT id, name FROM talert_actions;"); + $temp = db_get_all_rows_sql("SELECT id, name FROM talert_actions WHERE id_group IN ($groups_id);"); break; case "oracle": - $temp = db_get_all_rows_sql("SELECT id, name FROM talert_actions"); + $temp = db_get_all_rows_sql("SELECT id, name FROM talert_actions WHERE id_group IN ($groups_id)"); break; }