Merge branch 'ent-11371-bugs-vista-de-inventario' into 'develop'

Ent 11371 bugs vista de inventario

See merge request artica/pandorafms!5967
This commit is contained in:
Rafael Ameijeiras 2023-05-30 09:33:01 +00:00
commit a43146e494
2 changed files with 9 additions and 7 deletions

View File

@ -818,9 +818,16 @@ function inventory_get_datatable(
function get_data_basic_info_sql($params, $count=false)
{
$table = 'tagente';
if (is_metaconsole() === true) {
$table = 'tmetaconsole_agent';
}
$where = 'WHERE 1=1 ';
if ($params['id_agent'] > 0) {
if ($params['id_agent'] > 0 && $count === true) {
$where .= sprintf(' AND id_agente = %d', $params['id_agent']);
} else if ($params['id_agent'] > 0 && $count === false) {
$where .= sprintf(' AND %s.id_agente = %d', $table, $params['id_agent']);
}
if ($params['id_group'] > 0) {
@ -897,11 +904,6 @@ function get_data_basic_info_sql($params, $count=false)
$innerjoin = '';
$groupby = '';
$table = 'tagente';
if (is_metaconsole() === true) {
$table = 'tmetaconsole_agent';
}
if ($count !== true) {
$fields = '*';
$innerjoin = 'LEFT JOIN tagente_estado ON '.$table.'.id_agente = tagente_estado.id_agente ';

View File

@ -1041,9 +1041,9 @@ if ($inventory_module !== 'basic') {
<?php
if ($order_by_agent === true) {
foreach ($rows as $agent_rows) {
$data = [];
$modules = '';
foreach ($agent_rows['row'] as $key_row => $row) {
$data = [];
$columns = explode(';', io_safe_output($row['data_format']));
array_push($columns, 'Timestamp');