From f5343d781510503ebdec4cc3c0f0ad771f4c4cc0 Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Thu, 17 Feb 2011 17:20:31 +0000 Subject: [PATCH] 2011-02-17 Juan Manuel Ramon * operation/agentes/estado_agente.php godmode/alerts/configure_alert_template.php godmode/alerts/alert_list.builder.php: Now users can see alerts and templates of their groups and group "All". git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3905 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 +++++++ pandora_console/godmode/alerts/alert_list.builder.php | 2 +- .../godmode/alerts/configure_alert_template.php | 4 +++- pandora_console/operation/agentes/estado_agente.php | 6 +----- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 3bd4c4ad20..b678715e19 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2011-02-17 Juan Manuel Ramon + + * operation/agentes/estado_agente.php + godmode/alerts/configure_alert_template.php + godmode/alerts/alert_list.builder.php: Now users can see alerts and templates + of their groups and group "All". + 2011-02-17 Javier Lanz * godmode/gis_maps/index.php: Show only user's GIS maps diff --git a/pandora_console/godmode/alerts/alert_list.builder.php b/pandora_console/godmode/alerts/alert_list.builder.php index fd6a604663..49e926714e 100644 --- a/pandora_console/godmode/alerts/alert_list.builder.php +++ b/pandora_console/godmode/alerts/alert_list.builder.php @@ -68,7 +68,7 @@ $own_info = get_user_info ($config['id_user']); if ($own_info['is_admin'] || give_acl ($config['id_user'], 0, "PM")) $templates = get_alert_templates (false, array ('id', 'name')); else{ - $usr_groups = get_user_groups($config['id_user'], 'LW', false); + $usr_groups = get_user_groups($config['id_user'], 'LW', true); $filter_groups = ''; $filter_groups = implode(',', array_keys($usr_groups)); $templates = get_alert_templates (array ('id_group IN (' . $filter_groups . ')'), array ('id', 'name')); diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php index e0e2d9a0e8..429c798576 100644 --- a/pandora_console/godmode/alerts/configure_alert_template.php +++ b/pandora_console/godmode/alerts/configure_alert_template.php @@ -455,7 +455,9 @@ if ($step == 2) { $table->data['field3'][1] = print_textarea ('field3', 10, 30, $field3, '', true); $table->data[4][0] = __('Default action'); - $table->data[4][1] = print_select_from_sql ('SELECT id, name FROM talert_actions ORDER BY name', + $usr_groups = implode(',', array_keys(get_user_groups($config['id_user'], 'LM', true))); + $sql_query = sprintf('SELECT id, name FROM talert_actions WHERE id_group IN (%s) ORDER BY name', $usr_groups); + $table->data[4][1] = print_select_from_sql ($sql_query, 'default_action', $default_action, '', __('None'), 0, true, false, false).print_help_tip (__('In case you fill any Field 1, Field 2 or Field 3 above, those will replace the corresponding fields of this associated "Default action".'), true); } else if ($step == 3) { diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 2acbbdf267..d8ecf046a9 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -35,11 +35,7 @@ if (is_ajax ()) { $own_info = get_user_info ($config['id_user']); $usr_groups = array(); - if ($own_info['is_admin']) - $usr_groups = get_user_groups ($config['id_user'], 'LW', true); - - else - $usr_groups = get_user_groups($config['id_user'], 'LW', false); + $usr_groups = get_user_groups($config['id_user'], 'LW', true); $filter_groups = ''; $filter_groups = implode(',', array_keys($usr_groups));