mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
#13331 added filter status in inventory and fixed date
This commit is contained in:
parent
4b6fd8ef33
commit
bade6328f9
@ -890,6 +890,12 @@ function get_data_basic_info_sql($params, $count=false)
|
|||||||
$where .= sprintf(' AND %s.id_agente = %d', $table, $params['id_agent']);
|
$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) {
|
if ($params['id_group'] > 0) {
|
||||||
$where .= sprintf(' AND id_grupo = %d', $params['id_group']);
|
$where .= sprintf(' AND id_grupo = %d', $params['id_group']);
|
||||||
} else {
|
} else {
|
||||||
|
@ -91,6 +91,7 @@ if ($custom_date === '1') {
|
|||||||
|
|
||||||
$date_init = strtotime($date_init);
|
$date_init = strtotime($date_init);
|
||||||
$utimestamp = strtotime($date_end);
|
$utimestamp = strtotime($date_end);
|
||||||
|
$status_agent = (int) get_parameter('status', -1);
|
||||||
|
|
||||||
if (is_ajax() === true) {
|
if (is_ajax() === true) {
|
||||||
$get_csv_url = (bool) get_parameter('get_csv_url');
|
$get_csv_url = (bool) get_parameter('get_csv_url');
|
||||||
@ -192,8 +193,9 @@ if (is_ajax() === true) {
|
|||||||
'order' => $order,
|
'order' => $order,
|
||||||
'id_agent' => $id_agent,
|
'id_agent' => $id_agent,
|
||||||
'id_group' => $id_group,
|
'id_group' => $id_group,
|
||||||
'utimestamp' => strtotime($utimestamp),
|
'utimestamp' => $utimestamp,
|
||||||
'period' => $period,
|
'period' => $period,
|
||||||
|
'status' => $status_agent,
|
||||||
];
|
];
|
||||||
|
|
||||||
$data = get_data_basic_info_sql($params);
|
$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_table($table, true);
|
||||||
$searchForm .= html_print_div(
|
$searchForm .= html_print_div(
|
||||||
[
|
[
|
||||||
@ -1355,6 +1374,7 @@ if ($inventory_module !== 'basic') {
|
|||||||
'id_agent' => $id_agente,
|
'id_agent' => $id_agente,
|
||||||
'id_group' => $inventory_id_group,
|
'id_group' => $inventory_id_group,
|
||||||
'search' => $search,
|
'search' => $search,
|
||||||
|
'status' => $status_agent,
|
||||||
],
|
],
|
||||||
'zeroRecords' => __('Agent info not found'),
|
'zeroRecords' => __('Agent info not found'),
|
||||||
'emptyTable' => __('Agent info not found'),
|
'emptyTable' => __('Agent info not found'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user