mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 00:34:46 +02:00
minor fixes in report item
This commit is contained in:
parent
24990b26f3
commit
84905a6579
@ -3141,11 +3141,13 @@ $class = 'databox filters';
|
||||
<?php
|
||||
html_print_select_from_sql(
|
||||
'SELECT id_os, name FROM tconfig_os',
|
||||
'agent_os_filter',
|
||||
'agent_os_filter[]',
|
||||
$selected_agent_os_filter,
|
||||
'',
|
||||
'',
|
||||
'0'
|
||||
'All',
|
||||
'0',
|
||||
false,
|
||||
true
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
@ -3193,13 +3195,13 @@ $class = 'databox filters';
|
||||
|
||||
html_print_select(
|
||||
$fields,
|
||||
'agent_status_filter',
|
||||
'agent_status_filter[]',
|
||||
$selected_agent_status_filter,
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
|
@ -2298,11 +2298,7 @@ function reporting_agents_inventory($report, $content)
|
||||
}
|
||||
|
||||
if ($es_os_filter != '') {
|
||||
$search_sql .= ' AND id_os = '.$es_os_filter;
|
||||
}
|
||||
|
||||
if ($es_agent_status_filter != '') {
|
||||
$search_sql .= ' AND tae.estado = '.$es_agent_status_filter;
|
||||
$search_sql .= ' AND id_os IN ('.implode(',', $es_os_filter).')';
|
||||
}
|
||||
|
||||
if ($es_agent_version_filter != '') {
|
||||
@ -2327,7 +2323,6 @@ function reporting_agents_inventory($report, $content)
|
||||
'SELECT DISTINCT(tagente.id_agente) AS id_agente,
|
||||
tagente.id_os,
|
||||
tagente.direccion,
|
||||
tae.estado,
|
||||
tagente.agent_version,
|
||||
tagente.alias,
|
||||
tagente.id_grupo,
|
||||
@ -2338,12 +2333,6 @@ function reporting_agents_inventory($report, $content)
|
||||
ON tagente.id_agente = tasg.id_agent
|
||||
INNER JOIN tagente_modulo tam
|
||||
ON tam.id_agente = tagente.id_agente
|
||||
INNER JOIN (
|
||||
SELECT *
|
||||
FROM (SELECT id_agente, estado FROM tagente_estado ORDER BY `utimestamp` DESC) tagente_estado
|
||||
GROUP BY `id_agente`
|
||||
) tae
|
||||
ON tae.id_agente = tagente.id_agente
|
||||
WHERE (tagente.id_grupo IN (%s) OR tasg.id_group IN (%s))
|
||||
%s',
|
||||
$user_groups_to_sql,
|
||||
@ -2403,6 +2392,15 @@ function reporting_agents_inventory($report, $content)
|
||||
|
||||
$agents[$key]['custom_fields'] = $agent_custom_fields;
|
||||
}
|
||||
|
||||
if (array_search('estado', $es_agents_inventory_display_options) !== false) {
|
||||
if (in_array(agents_get_status($value['id_agente']), $es_agent_status_filter)) {
|
||||
$agents[$key]['estado'] = agents_get_status($value['id_agente']);
|
||||
} else {
|
||||
// Agent does not match status filter.
|
||||
unset($agents[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($agents as $key => $value) {
|
||||
|
@ -1535,12 +1535,19 @@ function reporting_html_agents_inventory($table, $item, $pdf=0)
|
||||
foreach ($data as $data_field_key => $data_field_value) {
|
||||
$column_value = $data_field_value;
|
||||
|
||||
$show_link = $pdf === 0 ? true : false;
|
||||
|
||||
// Necessary transformations of data prior to represent it.
|
||||
if ($data_field_key === 'id_os') {
|
||||
$column_value = get_os_name((int) $data_field_value);
|
||||
} else if ($data_field_key === 'remote' && $pdf === 0) {
|
||||
$column_value = ((int) $data_field_value === 1) ? __('Yes') : __('No');
|
||||
} else if ($data_field_key === 'url_address' && $pdf === 0) {
|
||||
$column_value = ui_print_truncate_text($data_field_value, 10);
|
||||
} else if ($data_field_key === 'estado') {
|
||||
$column_value = ($pdf === 0) ? ui_print_module_status((int) $data_field_value, true) : modules_get_modules_status((int) $data_field_value);
|
||||
} else if ($data_field_key === 'id_grupo') {
|
||||
$column_value = ui_print_group_icon((int) $data_field_value, true);
|
||||
$column_value = ui_print_group_icon((int) $data_field_value, true, 'groups_small', '', $show_link);
|
||||
} else if ($data_field_key === 'custom_fields') {
|
||||
$custom_fields_value = [];
|
||||
|
||||
@ -1556,7 +1563,7 @@ function reporting_html_agents_inventory($table, $item, $pdf=0)
|
||||
|
||||
if (is_array($data_field_value)) {
|
||||
foreach ($data_field_value as $value) {
|
||||
$custom_fields_value[] = ui_print_group_icon((int) $value['id_group'], true);
|
||||
$custom_fields_value[] = ui_print_group_icon((int) $value['id_group'], true, 'groups_small', '', $show_link);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user