From aa27bfe149157e58216622819d1e7201e7c22a33 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Thu, 20 Jan 2011 19:19:48 +0000 Subject: [PATCH] 2011-01-20 Miguel de Dios * operation/agentes/status_monitor.php: fixed and optimized the extract the list of Module name for the select box in the filter. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3753 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++ .../operation/agentes/status_monitor.php | 33 +++++++++++++++++-- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 2c1703d32b..b33049d8a5 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2011-01-20 Miguel de Dios + + * operation/agentes/status_monitor.php: fixed and optimized the extract the + list of Module name for the select box in the filter. + 2011-01-20 Miguel de Dios * operation/agentes/estado_generalagente.php: fixed when the agent haven't diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 1f762803fb..2fa028952a 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -72,9 +72,38 @@ echo ''.__('Module name').''; echo ''; $user_groups = implode (",", array_keys (get_user_groups ())); -$user_agents = array_keys (get_group_agents($user_groups)); +//$user_agents = array_keys (get_group_agents($user_groups)); + +//$modules = get_db_all_rows_filter ('tagente_modulo', array('id_agente' => $user_agents, 'nombre' => '<>delete_pending'), 'DISTINCT(nombre)'); + +$sql = ' +select distinct(nombre) +from tagente_modulo +where nombre <> "delete_pending" and id_agente in +( + select id_agente + from tagente where id_grupo IN ( + select id_grupo + from tusuario_perfil + where id_usuario = "' . $config['id_user'] . '" + and id_perfil IN ( + select id_perfil + from tperfil where agent_view = 1 + ) + ) + OR 0 IN ( + select id_grupo + from tusuario_perfil + where id_usuario = "' . $config['id_user'] . '" + and id_perfil IN ( + select id_perfil + from tperfil where agent_view = 1 + ) + ) +)'; + +$modules = get_db_all_rows_sql($sql); -$modules = get_db_all_rows_filter ('tagente_modulo', array('id_agente' => $user_agents, 'nombre' => '<>delete_pending'), 'DISTINCT(nombre)'); print_select (index_array ($modules, 'nombre', 'nombre'), "ag_modulename", $ag_modulename, 'this.form.submit();', __('All'), '', false, false, true, '', false, 'width: 150px;');