diff --git a/pandora_console/godmode/agentes/module_manager.php b/pandora_console/godmode/agentes/module_manager.php index 355024dcdb..aeb98f2ff9 100644 --- a/pandora_console/godmode/agentes/module_manager.php +++ b/pandora_console/godmode/agentes/module_manager.php @@ -101,6 +101,7 @@ if (strstr($sec2, "enterprise/godmode/policies/policies") !== false) { } $show_creation = false; +$checked = get_parameter("checked"); if (($policy_page) || (isset($agent))) { if ($policy_page) { @@ -115,6 +116,16 @@ if (($policy_page) || (isset($agent))) { // Create module/type combo echo '
'; echo ''; + echo __('Show in hierachy mode'); + if ($checked == "true") { + $checked = true; + } + else { + $checked = false; + } + html_print_checkbox ('status_hierachy_mode', "", $checked, false, false, "onChange=change_mod_filter();"); + echo ''; + echo ''; echo __("Type"); html_print_select ($modules, 'moduletype', '', '', '', '', false, false, false, '', false, 'max-width:300px;' ); html_print_input_hidden ('edit_module', 1); @@ -450,12 +461,23 @@ switch ($config["dbtype"]) { else { $limit_sql = ''; } - $sql = sprintf("SELECT %s - FROM tagente_modulo - LEFT JOIN tmodule_group - ON tagente_modulo.id_module_group = tmodule_group.id_mg - WHERE %s %s %s %s %s", - $params, $basic_where, $where, $where_tags, $order_sql, $limit_sql); + if ($checked) { + $sql = sprintf("SELECT * + FROM tagente_modulo + LEFT JOIN tmodule_group + ON tagente_modulo.id_module_group = tmodule_group.id_mg + WHERE %s %s %s %s %s", + $basic_where, $where, $where_tags, $order_sql, $limit_sql); + } + else { + $sql = sprintf("SELECT %s + FROM tagente_modulo + LEFT JOIN tmodule_group + ON tagente_modulo.id_module_group = tmodule_group.id_mg + WHERE %s %s %s %s %s", + $params, $basic_where, $where, $where_tags, $order_sql, $limit_sql); + } + $modules = db_get_all_rows_sql($sql); break; @@ -465,12 +487,24 @@ switch ($config["dbtype"]) { $set['limit'] = $limit; $set['offset'] = $offset; } - $sql = sprintf("SELECT %s - FROM tagente_modulo - LEFT JOIN tmodule_group - ON tmodule_group.id_mg = tagente_modulo.id_module_group - WHERE %s %s %s %s", - $params, $basic_where, $where, $where_tags, $order_sql); + + if ($checked) { + $sql = sprintf("SELECT * + FROM tagente_modulo + LEFT JOIN tmodule_group + ON tmodule_group.id_mg = tagente_modulo.id_module_group + WHERE %s %s %s %s", + $basic_where, $where, $where_tags, $order_sql); + } + else { + $sql = sprintf("SELECT %s + FROM tagente_modulo + LEFT JOIN tmodule_group + ON tmodule_group.id_mg = tagente_modulo.id_module_group + WHERE %s %s %s %s", + $params, $basic_where, $where, $where_tags, $order_sql); + } + $modules = oracle_recode_query ($sql, $set, 'AND', false); break; } @@ -555,6 +589,15 @@ foreach($tempRows as $row) { $numericModules[$row['id_tipo']] = true; } +if ($checked) { + $modules_hierachy = array(); + $modules_hierachy = get_hierachy_modules_tree($modules); + + $modules_dt = get_dt_from_modules_tree($modules_hierachy); + + $modules = $modules_dt; +} + foreach ($modules as $module) { if (! check_acl ($config["id_user"], $group, "AW", $id_agente) && ! check_acl ($config["id_user"], $group, "AD", $id_agente)) { continue; @@ -570,20 +613,29 @@ foreach ($modules as $module) { $module_group2 = $module["id_module_group"]; $data = array (); - if ($module['id_module_group'] != $last_modulegroup) { - $last_modulegroup = $module['id_module_group']; - $data[0] = ''.modules_get_modulegroup_name ($last_modulegroup).''; - $i = array_push ($table->data, $data); - $table->rowstyle[$i - 1] = 'text-align: center'; - $table->rowclass[$i - 1] = 'datos3'; - if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) - $table->colspan[$i - 1][0] = 10; - else - $table->colspan[$i - 1][0] = 8; - - $data = array (); + + if (!$checked) { + if ($module['id_module_group'] != $last_modulegroup) { + $last_modulegroup = $module['id_module_group']; + $data[0] = ''.modules_get_modulegroup_name ($last_modulegroup).''; + $i = array_push ($table->data, $data); + $table->rowstyle[$i - 1] = 'text-align: center'; + $table->rowclass[$i - 1] = 'datos3'; + if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) + $table->colspan[$i - 1][0] = 10; + else + $table->colspan[$i - 1][0] = 8; + + $data = array (); + } } $data[0] = ""; + + if (isset($module['deep']) && ($module['deep'] != 0)) { + $data[0] .= str_repeat('    ', $module['deep']); + $data[0] .= html_print_image("images/icono_escuadra.png", true, array("style" => 'padding-bottom: inherit;')) . "  "; + } + if ($module['quiet']) { $data[0] .= html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), @@ -764,3 +816,22 @@ if (check_acl ($config['id_user'], $agent['id_grupo'], "AW")) { echo '
'; } ?> + + diff --git a/pandora_console/include/ajax/module.php b/pandora_console/include/ajax/module.php index 2799539960..2f048564d5 100755 --- a/pandora_console/include/ajax/module.php +++ b/pandora_console/include/ajax/module.php @@ -852,9 +852,14 @@ if ($list_modules) { $data[2] .= '' . html_print_image("images/config.png", true, array("alt" => '0', "border" => "", "title" => __('Edit'))) . ''; - - + $data[3] = ""; + + if (isset($module['deep']) && ($module['deep'] != 0)) { + $data[3] .= str_repeat('    ', $module['deep']); + $data[3] .= html_print_image("images/icono_escuadra.png", true, array("style" => 'padding-bottom: inherit;')) . "  "; + } + if ($module['quiet']) { $data[3] .= html_print_image("images/dot_green.disabled.png", true, array("border" => '0', "title" => __('Quiet'), "alt" => "")) diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php index b7871ab223..f5c870dc83 100755 --- a/pandora_console/operation/agentes/estado_monitores.php +++ b/pandora_console/operation/agentes/estado_monitores.php @@ -186,6 +186,20 @@ ui_toggle($html_toggle, */ }); + function change_module_filter () { + hierachy_mode = $("#checkbox-status_hierachy_mode").is(":checked"); + if (hierachy_mode) { + $("#status_module_group").disable(); + $("#status_filter_monitor").disable(); + $("#status_module_group").val(-1); + $("#status_filter_monitor").val(-1); + } + else { + $("#status_module_group").enable(); + $("#status_filter_monitor").enable(); + } + } + function order_module_list(sort_field_param, sort_rows_param) { sort_field = sort_field_param; sort_rows = sort_rows_param; @@ -263,6 +277,9 @@ ui_toggle($html_toggle, $("#status_filter_monitor").val(-1); $("#status_module_group").val(-1); $("input[name='status_text_monitor']").val(""); + $("#checkbox-status_hierachy_mode").prop("checked", false); + $("#status_module_group").enable(); + $("#status_filter_monitor").enable(); filter_modules(); } @@ -453,7 +470,7 @@ function print_form_filter_monitors($id_agent, $status_filter_monitor = -1, } $table->data[0][5] = html_print_select ($rows_select,'status_module_group', $status_module_group, '', '',0, true); $table->data[0][6] = __('Show in hierachy mode'); - $table->data[0][6] .= html_print_checkbox ('status_hierachy_mode', "", false, true); + $table->data[0][6] .= html_print_checkbox ('status_hierachy_mode', "", false, true, false, "onChange=change_module_filter();"); $table->data[0][7] = html_print_button(__('Filter'), 'filter', false, 'filter_modules();', 'class="sub search"', true); $table->data[0][8] = ' ' . html_print_button(__('Reset'), 'filter', false, 'reset_filter_modules();', 'class="sub upd" style="margin-top:0px;"', true); $form_text .= html_print_table($table, true);