mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Changes in networkmap_links_to_js_links
This commit is contained in:
parent
d6e82be357
commit
9fa26f9fcb
@ -731,6 +731,15 @@ function networkmap_links_to_js_links($relations, $nodes_graph) {
|
|||||||
|
|
||||||
$agent = agents_get_agent_id_by_module_id($relation['id_parent_source_data']);
|
$agent = agents_get_agent_id_by_module_id($relation['id_parent_source_data']);
|
||||||
$agent2 = agents_get_agent_id_by_module_id($relation['id_child_source_data']);
|
$agent2 = agents_get_agent_id_by_module_id($relation['id_child_source_data']);
|
||||||
|
foreach ($nodes_graph as $key2 => $node) {
|
||||||
|
if(isset($node['id_agent'])) {
|
||||||
|
if($node['id_agent'] == $agent) {
|
||||||
|
$agent = $node['id_db'];
|
||||||
|
} else if ($node['id_agent'] == $agent2) {
|
||||||
|
$agent2 = $node['id_db'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ($relation['child_type'] == 1) {
|
else if ($relation['child_type'] == 1) {
|
||||||
$mod1_status = db_get_value_filter('estado', 'tagente_estado', array('id_agente_modulo' => $relation['id_child_source_data']));
|
$mod1_status = db_get_value_filter('estado', 'tagente_estado', array('id_agente_modulo' => $relation['id_child_source_data']));
|
||||||
@ -742,8 +751,16 @@ function networkmap_links_to_js_links($relations, $nodes_graph) {
|
|||||||
$item['link_color'] = "#FAD403";
|
$item['link_color'] = "#FAD403";
|
||||||
}
|
}
|
||||||
|
|
||||||
$agent = $relation['id_parent_source_data'];
|
|
||||||
$agent2 = agents_get_agent_id_by_module_id($relation['id_child_source_data']);
|
$agent2 = agents_get_agent_id_by_module_id($relation['id_child_source_data']);
|
||||||
|
foreach ($nodes_graph as $key2 => $node) {
|
||||||
|
if(isset($node['id_agent'])) {
|
||||||
|
if($node['id_agent'] == $relation['id_parent_source_data']) {
|
||||||
|
$agent = $node['id_db'];
|
||||||
|
} else if ($node['id_agent'] == $agent2) {
|
||||||
|
$agent2 = $node['id_db'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ($relation['parent_type'] == 1) {
|
else if ($relation['parent_type'] == 1) {
|
||||||
$mod1_status = db_get_value_filter('estado', 'tagente_estado', array('id_agente_modulo' => $relation['id_parent_source_data']));
|
$mod1_status = db_get_value_filter('estado', 'tagente_estado', array('id_agente_modulo' => $relation['id_parent_source_data']));
|
||||||
@ -756,59 +773,67 @@ function networkmap_links_to_js_links($relations, $nodes_graph) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$agent = agents_get_agent_id_by_module_id($relation['id_parent_source_data']);
|
$agent = agents_get_agent_id_by_module_id($relation['id_parent_source_data']);
|
||||||
$agent2 = $relation['id_child_source_data'];
|
|
||||||
|
foreach ($nodes_graph as $key2 => $node) {
|
||||||
|
if(isset($node['id_agent'])) {
|
||||||
|
if($node['id_agent'] == $agent) {
|
||||||
|
$agent = $node['id_db'];
|
||||||
|
} else if ($node['id_agent'] == $relation['id_child_source_data']) {
|
||||||
|
$agent2 = $node['id_db'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (($relation['parent_type'] == 3) && ($relation['child_type'] == 3)) {
|
else if (($relation['parent_type'] == 3) && ($relation['child_type'] == 3)) {
|
||||||
foreach ($nodes_graph as $key => $node) {
|
foreach ($nodes_graph as $key2 => $node) {
|
||||||
if ($relation['id_parent'] == $node['id_db']) {
|
if ($relation['id_parent'] == $node['id_db']) {
|
||||||
$agent = $key;
|
$agent = $node['id_db'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($nodes_graph as $key => $node) {
|
foreach ($nodes_graph as $key2 => $node) {
|
||||||
if ($relation['id_child'] == $node['id_db']) {
|
if ($relation['id_child'] == $node['id_db']) {
|
||||||
$agent2 = $key;
|
$agent2 = $node['id_db'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (($relation['parent_type'] == 3) || ($relation['child_type'] == 3)) {
|
else if (($relation['parent_type'] == 3) || ($relation['child_type'] == 3)) {
|
||||||
if ($relation['parent_type'] == 3) {
|
if ($relation['parent_type'] == 3) {
|
||||||
foreach ($nodes_graph as $key => $node) {
|
foreach ($nodes_graph as $key2 => $node) {
|
||||||
if ($relation['id_parent'] == $node['id_db']) {
|
if ($relation['id_parent'] == $node['id_db']) {
|
||||||
$agent = $key;
|
$agent = $node['id_db'];
|
||||||
|
} else if ($node['id_agent'] == $relation['id_child_source_data']) {
|
||||||
|
$agent2 = $node['id_db'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$agent2 = $relation['id_child_source_data'];
|
|
||||||
}
|
}
|
||||||
else if ($relation['child_type'] == 3) {
|
else if ($relation['child_type'] == 3) {
|
||||||
foreach ($nodes_graph as $key => $node) {
|
foreach ($nodes_graph as $key2 => $node) {
|
||||||
if ($relation['id_child'] == $node['id_db']) {
|
if ($relation['id_child'] == $node['id_db']) {
|
||||||
$agent2 = $key;
|
$agent2 = $node['id_db'];
|
||||||
|
} else if ($node['id_agent'] == $relation['id_parent_source_data']) {
|
||||||
|
$agent = $node['id_db'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$agent = $relation['id_parent_source_data'];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$agent = $relation['id_parent_source_data'];
|
foreach ($nodes_graph as $key2 => $node) {
|
||||||
$agent2 = $relation['id_child_source_data'];
|
if(isset($node['id_agent'])) {
|
||||||
|
if($node['id_agent'] == $relation['id_parent_source_data']) {
|
||||||
|
$agent = $node['id_db'];
|
||||||
|
} else if ($node['id_agent'] == $relation['id_child_source_data']) {
|
||||||
|
$agent2 = $node['id_db'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($nodes_graph as $node) {
|
foreach ($nodes_graph as $node) {
|
||||||
if (!isset($node['id_agent'])) {
|
if ($node['id_db'] == $agent) {
|
||||||
if ($node['id'] == $agent) {
|
$item['target'] = $node['id'];
|
||||||
$item['target'] = $node['id'];
|
|
||||||
}
|
|
||||||
else if($node['id'] == $agent2) {
|
|
||||||
$item['source'] = $node['id'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else if($node['id_db'] == $agent2) {
|
||||||
if ($node['id_agent'] == $agent) {
|
$item['source'] = $node['id'];
|
||||||
$item['target'] = $node['id'];
|
|
||||||
}
|
|
||||||
else if ($node['id_agent'] == $agent2) {
|
|
||||||
$item['source'] = $node['id'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$return[] = $item;
|
$return[] = $item;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user