Changed the edges (before as global var) for the enterprise dashboard

This commit is contained in:
mdtrooper 2016-05-04 10:38:47 +02:00
parent 0690e303e9
commit 2cc5f96915
3 changed files with 17 additions and 6 deletions

View File

@ -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";
?>

View File

@ -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']) {

View File

@ -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 ||