#10000 Fixed api call tree_agents

This commit is contained in:
Daniel Maya 2022-12-12 16:39:14 +01:00
parent 8a6e3e5e06
commit 198f539901
1 changed files with 8 additions and 9 deletions

View File

@ -904,7 +904,7 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType)
global $module_field_column_mampping;
// module related field mappings 2/2 (output field => column for 'tagente_estado')
global $estado_fields_to_columns_mapping;
global $estado_fields_to_columns_mapping;
// alert related field mappings (output field => column for 'talert_template_modules', ... )
$alert_fields_to_columns_mapping = [
@ -1016,9 +1016,9 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType)
$groups = [];
}
$groups = str_replace('\n', $returnReplace, $groups);
foreach ($groups as &$group) {
$group = str_replace('\n', $returnReplace, $group);
$group['type_row'] = 'group';
$returnVar[] = $group;
@ -1034,9 +1034,9 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType)
$agents = [];
}
$agents = str_replace('\n', $returnReplace, $agents);
foreach ($agents as $index => &$agent) {
$agent = str_replace('\n', $returnReplace, $agent);
$agent['type_row'] = 'agent';
$returnVar[] = $agent;
@ -1063,9 +1063,9 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType)
$modules = [];
}
$modules = str_replace('\n', $returnReplace, $modules);
foreach ($modules as &$module) {
$module = str_replace('\n', $returnReplace, $module);
$module['type_row'] = 'module';
if ($module['module_macros']) {
@ -1097,9 +1097,8 @@ function api_get_tree_agents($trash1, $trahs2, $other, $returnType)
$alerts = [];
}
$alerts = str_replace('\n', $returnReplace, $alerts);
foreach ($alerts as &$alert) {
$alert = str_replace('\n', $returnReplace, $alert);
$alert['type_row'] = 'alert';
$returnVar[] = $alert;
}