diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index 97f70426bf..8d99fb6d82 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -167,8 +167,10 @@ class Tree */ protected function getDisabledFilter() { + $only_disabled = (is_metaconsole() === true) ? (int) $this->filter['show_disabled'] : 0; + if (empty($this->filter['showDisabled'])) { - return ' tam.disabled = 0 AND ta.disabled = 0'; + return ' tam.disabled = 0 AND ta.disabled = '.$only_disabled; } return ' 1 = 1'; diff --git a/pandora_console/include/class/TreeGroup.class.php b/pandora_console/include/class/TreeGroup.class.php index 48c64c898d..dbc48b9296 100644 --- a/pandora_console/include/class/TreeGroup.class.php +++ b/pandora_console/include/class/TreeGroup.class.php @@ -311,13 +311,14 @@ class TreeGroup extends Tree $table = is_metaconsole() ? 'tmetaconsole_agent' : 'tagente'; $table_sec = is_metaconsole() ? 'tmetaconsole_agent_secondary_group' : 'tagent_secondary_group'; + $only_disabled = (is_metaconsole() === true) ? (int) $this->filter['show_disabled'] : 0; $sql_model = "SELECT %s FROM ( SELECT COUNT(DISTINCT(ta.id_agente)) AS total, id_grupo AS g FROM $table ta $module_search_inner - WHERE ta.disabled = 0 + WHERE ta.disabled = $only_disabled %s $agent_search_filter $agent_status_filter @@ -330,7 +331,7 @@ class TreeGroup extends Tree FROM $table ta INNER JOIN $table_sec tasg ON ta.id_agente = tasg.id_agent $module_search_inner - WHERE ta.disabled = 0 + WHERE ta.disabled = $only_disabled %s $agent_search_filter $agent_status_filter diff --git a/pandora_console/operation/tree.php b/pandora_console/operation/tree.php index ad11c1da46..7f86bce105 100755 --- a/pandora_console/operation/tree.php +++ b/pandora_console/operation/tree.php @@ -45,6 +45,8 @@ $group_id = (int) get_parameter('group_id'); $tag_id = (int) get_parameter('tag_id'); $strict_acl = (bool) db_get_value('strict_acl', 'tusuario', 'id_user', $config['id_user']); $serach_hirearchy = (bool) get_parameter('searchHirearchy', false); +$show_disabled = get_parameter('show_disabled', false); + // ---------------------Tabs ------------------------------------------- $enterpriseEnable = false; if (enterprise_include_once('include/functions_policies.php') !== ENTERPRISE_NOT_HOOK) { @@ -249,6 +251,10 @@ $row[] = html_print_input_hidden('show_not_init_modules_hidden', $show_not_init_ if (is_metaconsole() === true) { $table->data[] = $row; $row = []; + $row[] = __('Show only disabled'); + $row[] = html_print_checkbox('show_disabled', $show_disabled, false, true); + $table->data[] = $row; + $row = []; } $row[] = html_print_submit_button(__('Filter'), 'uptbutton', false, 'class="sub search"', true); @@ -390,6 +396,13 @@ enterprise_hook('close_meta_frame'); $('#hidden-show_not_init_modules_hidden').val(0); } + if($("#checkbox-show_disabled").is(':checked')){ + parameters['filter']['show_disabled'] = 1; + } + else{ + parameters['filter']['show_disabled'] = 0; + } + $.ajax({ type: "POST", url: "",