From cddaea8477afbf954e65628d2313790ff6386734 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 18 Feb 2015 18:29:39 +0100 Subject: [PATCH] Fixed period was undefined sometimes in ajax call to get list of module data dialog. --- .../operation/agentes/status_monitor.php | 42 +++++++++++++++---- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/pandora_console/operation/agentes/status_monitor.php b/pandora_console/operation/agentes/status_monitor.php index 55eb14999c..41743ffee9 100644 --- a/pandora_console/operation/agentes/status_monitor.php +++ b/pandora_console/operation/agentes/status_monitor.php @@ -45,6 +45,8 @@ else { ui_meta_print_header(__("Monitor view")); } + + $ag_freestring = get_parameter ('ag_freestring'); $ag_modulename = (string) get_parameter ('ag_modulename'); if (!defined('METACONSOLE')) { @@ -220,8 +222,10 @@ if ($tag_filter !== 0) { } } + // Fix: for tag functionality groups have to be all user_groups (propagate ACL funct!) $groups = users_get_groups($config["id_user"]); + if ($ag_group !== 0) { $sql_conditions_tags = tags_get_acl_tags($config['id_user'], $ag_group, 'AR', 'module_condition', 'AND', 'tagente_modulo', true, array(), true); } else { @@ -345,7 +349,9 @@ if (defined('METACONSOLE')) { // Get all info for filters of all nodes $modules_temp = db_get_all_rows_sql($sql); - + + + $rows_temp = db_get_all_rows_sql("SELECT distinct name FROM tmodule_group ORDER BY name"); @@ -390,9 +396,11 @@ echo ' false, 'width:150px;', false, false, 'id_grupo', $strict_user) . ' '; - + echo '' . __('Monitor status') . ""; + + echo ""; $fields = array (); @@ -407,6 +415,8 @@ html_print_select ($fields, "status", $status, '', __('All'), -1, false, false, true, '', false, 'width: 150px;'); echo ''; + + echo '' . __('Module group') . ''; echo ''; if (!defined('METACONSOLE')) { @@ -424,10 +434,14 @@ $rows_select[0] = __('Not assigned'); html_print_select($rows_select, 'modulegroup', $modulegroup, '', __('All'),-1,false, false, true, '', false, 'width: 120px;'); echo ''; + + echo ''; echo ''; + + echo '' . __('Module name') . ''; echo ''; @@ -440,6 +454,7 @@ html_print_select (index_array ($modules, 'nombre', 'nombre'), "ag_modulename", echo ''; + echo '' . __('Search') . ''; @@ -458,11 +473,17 @@ if (empty($tags)) { echo __('No tags'); } else { - - html_print_select ($tags, "tag_filter", $tag_filter, '', __('All'), '', false, false, true, '', false, 'width: 150px;'); + + html_print_select ($tags, "tag_filter", + $tag_filter, '', __('All'), '', false, false, true, '', false, 'width: 150px;'); } echo ''; + + + + + echo ''; html_print_submit_button (__('Show'), "uptbutton", false, 'class="sub search"'); echo ""; @@ -807,7 +828,7 @@ else { WHERE disabled = 0"); if ($servers === false) $servers = array(); - + $result = array(); $count_modules = 0; foreach ($servers as $server) { @@ -1251,6 +1272,8 @@ foreach ($result as $row) { } } + + if ($module_value == $sub_string) { $salida = $module_value; } @@ -1329,7 +1352,7 @@ ui_require_javascript_file('pandora_modules'); $("#tag_td").css('display', ''); } }); - + function toggle_full_value(id) { text = $("#hidden_value_module_" + id).html(); old_text = $("#value_module_text_" + id).html(); @@ -1342,7 +1365,12 @@ ui_require_javascript_file('pandora_modules'); // Show the modal window of an module function show_module_detail_dialog(module_id, id_agent, server_name, offset, period) { if (period == -1) { - period = $('#period').val(); + if ($("#period").length == 1) { + period = $('#period').val(); + } + else { + period = ; + } } $.ajax({