Merge branch 'ent-12363-agent-module-view-las-columnas-se-muestran-mal-al-exportar-a-csv' into 'develop'

Fix csv agent-module pandora_enterprise#12363

See merge request artica/pandorafms!6623
This commit is contained in:
Rafael Ameijeiras 2023-11-27 14:36:53 +00:00
commit 57124c4f26
2 changed files with 20 additions and 2 deletions

View File

@ -106,7 +106,25 @@ if ($get_agents_module_csv === '1') {
foreach ($results as $result) { foreach ($results as $result) {
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
$out_csv .= io_safe_output($value).$divider; if (preg_match('/Linux/i', $_SERVER['HTTP_USER_AGENT'])) {
$value = preg_replace(
'/\s+/',
' ',
io_safe_output($value)
);
} else {
$value = mb_convert_encoding(
preg_replace(
'/\s+/',
'',
io_safe_output($value)
),
'UTF-16LE',
'UTF-8'
);
}
$out_csv .= $value.$divider;
} }
$out_csv .= "\n"; $out_csv .= "\n";

View File

@ -4735,7 +4735,7 @@ function export_agents_module_csv($filters)
$query_filter .= ' AND tam.nombre IN '.$module_filter.' '; $query_filter .= ' AND tam.nombre IN '.$module_filter.' ';
} else { } else {
$module_filter = '('.implode(', ', $filter).')'; $module_filter = '('.implode(', ', $filter).')';
$query_filter .= ' AND tam.id_tipo_modulo IN '.$module_filter.' '; $query_filter .= ' AND tam.id_agente_modulo IN '.$module_filter.' ';
} }
} }
break; break;