Fixed errors in networkmaps

This commit is contained in:
Arturo Gonzalez 2016-11-11 11:56:39 +01:00
parent 5ffa30e033
commit 2d2ffeddc0
1 changed files with 8 additions and 3 deletions
pandora_console/include

View File

@ -409,7 +409,7 @@ function networkmap_clean_relations_for_js(&$relations) {
foreach ($relations as $key => $relation) {
if ($relation['id_parent_source_data'] == $relation['id_child_source_data']) {
if (($relation['id_parent_source_data'] != -2) && $relation['id_child_source_data'] != -2) {
if (($relation['child_type'] != 3) && $relation['parent_type'] != 3) {
$cleaned = false;
if ($relation['parent_type'] == 1) {
@ -567,6 +567,12 @@ function networkmap_links_to_js_links($relations, $nodes_graph) {
else {
$agent = $relation['id_parent_source_data'];
$agent2 = $relation['id_child_source_data'];
if ($agent == 0) {
$agent = -1;
}
if ($agent2 == 0) {
$agent = -1;
}
}
foreach ($nodes_graph as $node) {
@ -590,7 +596,6 @@ function networkmap_links_to_js_links($relations, $nodes_graph) {
$return[] = $item;
}
return $return;
}