diff --git a/pandora_console/include/class/Map.class.php b/pandora_console/include/class/Map.class.php index 7bc32d13d6..ae6775d8e2 100644 --- a/pandora_console/include/class/Map.class.php +++ b/pandora_console/include/class/Map.class.php @@ -111,7 +111,7 @@ abstract class Map { public function writeJSGraph() { $nodes_name = "nodes_" . $this->id; - $edges_name = "edges_" . $this->id; $edges_name = "edges"; + $edges_name = "edges_" . $this->id; $filter_name = "filter_" . $this->id; $filter_name = "filter"; ?> diff --git a/pandora_console/include/javascript/map/MapController.js b/pandora_console/include/javascript/map/MapController.js index 0859b64a5a..f5bf2af4f3 100644 --- a/pandora_console/include/javascript/map/MapController.js +++ b/pandora_console/include/javascript/map/MapController.js @@ -235,6 +235,17 @@ MapController.prototype.get_nodes_map = function() { return window["nodes_" + self._id]; } +MapController.prototype.get_edges_map = function() { + var self = this; + + return window["edges_" + self._id]; +} + +MapController.prototype.set_edges_map = function(edges) { + var self = this; + + window["edges_" + self._id] = edges; +} MapController.prototype.get_subtype_map = function() { var self = this; @@ -425,7 +436,7 @@ MapController.prototype.get_arrow = function(id_to, id_from) { }); if (count_nodes == 2) { - $.each(edges, function(i, edge) { + $.each(self.get_edges_map(), function(i, edge) { if (edge['to'] == arrow['nodes']['to']['graph_id'] && edge['from'] == arrow['nodes']['from']['graph_id']) { diff --git a/pandora_console/include/javascript/map/NetworkmapController.js b/pandora_console/include/javascript/map/NetworkmapController.js index cc725a19f3..3814357568 100644 --- a/pandora_console/include/javascript/map/NetworkmapController.js +++ b/pandora_console/include/javascript/map/NetworkmapController.js @@ -40,7 +40,7 @@ NetworkmapController.prototype.init_map = function() { var self = this; var clean_arrows = []; - $.each(edges, function(i, edge) { + $.each(self.get_edges_map(), function(i, edge) { var arrow_AF_or_FF = self.get_arrow_AF_or_FF(edge['to'], edge['from']); if (arrow_AF_or_FF !== null) { if (!self.exists_arrow(clean_arrows, arrow_AF_or_FF)) { @@ -411,7 +411,7 @@ NetworkmapController.prototype.get_arrow_AF_or_FF = function(id_to, id_from) { var arrow_AF_or_FF; var found = false; - $.each(edges, function(i, edge) { + $.each(self.get_edges_map(), function(i, edge) { if (self.get_node_type(id_to) == ITEM_TYPE_FICTIONAL_NODE || self.get_node_type(id_from) == ITEM_TYPE_FICTIONAL_NODE) { @@ -612,7 +612,7 @@ NetworkmapController.prototype.get_arrow_GMM = function(id_to, id_from) { var arrow_GMM; var found = false; - $.each(edges, function(i, edge) { + $.each(self.get_edges_map(), function(i, edge) { if (self.get_node_type(id_to) == ITEM_TYPE_MODULEGROUP_NETWORKMAP || self.get_node_type(id_from) == ITEM_TYPE_MODULEGROUP_NETWORKMAP) { if (self.get_node_type(id_to) == ITEM_TYPE_MODULE_NETWORKMAP || @@ -656,7 +656,7 @@ NetworkmapController.prototype.get_arrow_GMA = function(id_to, id_from) { var arrow_GMA; var found = false; - $.each(edges, function(i, edge) { + $.each(self.get_edges_map(), function(i, edge) { if (self.get_node_type(id_to) == ITEM_TYPE_MODULEGROUP_NETWORKMAP || self.get_node_type(id_from) == ITEM_TYPE_MODULEGROUP_NETWORKMAP) { if (self.get_node_type(id_to) == ITEM_TYPE_AGENT_NETWORKMAP ||