Weird fix agentmodule retrieval proc.

This commit is contained in:
fbsanchez 2018-08-01 15:17:58 +02:00
parent 1b962ad53e
commit 9924c7877a

View File

@ -4182,10 +4182,14 @@ function visual_map_instanciate_template($id_layout_template, $name, $id_agent)
foreach ($template_data as $item) {
// update fields
$item["id_agente_modulo"] = modules_get_agentmodule_id($item["module_name"], $id_agent);
$item["id_agente_modulo"] = db_get_value_filter('id_agente_modulo', 'tagente_modulo', array('nombre' => $item["module_name"], 'id_agente' => $id_agent, 'delete_pending' => 0));
$item["id_agent"] = $id_agent;
$item["id_layout"] = $layout_id;
// replace macro names
$item["label"] = str_replace('_agentalias_', agents_get_alias($id_agent), $item["label"]);
$item["label"] = str_replace('_agent_', agents_get_name($id_agent), $item["label"]);
// remove useless fields
unset($item["id"]);
unset($item["id_layout_template"]);