diff --git a/pandora_console/include/functions_inventory.php b/pandora_console/include/functions_inventory.php index 5f9e3bd62d..376e3c9837 100644 --- a/pandora_console/include/functions_inventory.php +++ b/pandora_console/include/functions_inventory.php @@ -890,6 +890,12 @@ function get_data_basic_info_sql($params, $count=false) $where .= sprintf(' AND %s.id_agente = %d', $table, $params['id_agent']); } + if ($params['status'] >= 0 && $count === true) { + $where .= sprintf(' AND disabled = %d', $params['status']); + } else if ($params['status'] >= 0 && $count === false) { + $where .= sprintf(' AND %s.disabled = %d', $table, $params['status']); + } + if ($params['id_group'] > 0) { $where .= sprintf(' AND id_grupo = %d', $params['id_group']); } else { diff --git a/pandora_console/operation/inventory/inventory.php b/pandora_console/operation/inventory/inventory.php index 5f812f67e9..6b569289a3 100755 --- a/pandora_console/operation/inventory/inventory.php +++ b/pandora_console/operation/inventory/inventory.php @@ -91,6 +91,7 @@ if ($custom_date === '1') { $date_init = strtotime($date_init); $utimestamp = strtotime($date_end); +$status_agent = (int) get_parameter('status', -1); if (is_ajax() === true) { $get_csv_url = (bool) get_parameter('get_csv_url'); @@ -192,8 +193,9 @@ if (is_ajax() === true) { 'order' => $order, 'id_agent' => $id_agent, 'id_group' => $id_group, - 'utimestamp' => strtotime($utimestamp), + 'utimestamp' => $utimestamp, 'period' => $period, + 'status' => $status_agent, ]; $data = get_data_basic_info_sql($params); @@ -764,6 +766,23 @@ if (is_metaconsole() === false) { ); } +$table->data[2][0] = html_print_label_input_block( + __('Status agent'), + html_print_select( + [ + -1 => __('All'), + 0 => __('Enabled'), + 1 => __('Disabled'), + ], + 'status', + $status_agent, + '', + '', + 0, + true + ) +); + $searchForm .= html_print_table($table, true); $searchForm .= html_print_div( [ @@ -1355,6 +1374,7 @@ if ($inventory_module !== 'basic') { 'id_agent' => $id_agente, 'id_group' => $inventory_id_group, 'search' => $search, + 'status' => $status_agent, ], 'zeroRecords' => __('Agent info not found'), 'emptyTable' => __('Agent info not found'),