Added new function to redirect with dbclick when fictinal have a map link

This commit is contained in:
Arturo Gonzalez 2017-07-25 15:38:28 +02:00
parent a2d15f9f34
commit 6b30accd11
1 changed files with 95 additions and 12 deletions

View File

@ -307,7 +307,12 @@ function change_shape(id_db_node) {
})
.on("click", selected_node)
.on("dblclick", function(d) {
edit_node(d, true);
if (d.type == undefined) {
move_to_networkmap(d);
}
else {
edit_node(d, true);
}
})
.on("contextmenu", function(d) { show_menu("node", d);});
@ -342,7 +347,12 @@ function change_shape(id_db_node) {
})
.on("click", selected_node)
.on("dblclick", function(d) {
edit_node(d, true);
if (d.type == undefined) {
move_to_networkmap(d);
}
else {
edit_node(d, true);
}
})
.on("contextmenu", function(d) { show_menu("node", d);});
@ -365,7 +375,12 @@ function change_shape(id_db_node) {
})
.on("click", selected_node)
.on("dblclick", function(d) {
edit_node(d, true);
if (d.type == undefined) {
move_to_networkmap(d);
}
else {
edit_node(d, true);
}
})
.on("contextmenu", function(d) { show_menu("node", d);});
@ -400,7 +415,12 @@ function change_shape(id_db_node) {
})
.on("click", selected_node)
.on("dblclick", function(d) {
edit_node(d, true);
if (d.type == undefined) {
move_to_networkmap(d);
}
else {
edit_node(d, true);
}
})
.on("contextmenu", function(d) { show_menu("node", d);});
@ -425,7 +445,12 @@ function change_shape(id_db_node) {
})
.on("click", selected_node)
.on("dblclick", function(d) {
edit_node(d, true);
if (d.type == undefined) {
move_to_networkmap(d);
}
else {
edit_node(d, true);
}
})
.on("contextmenu", function(d) { show_menu("node", d);});
@ -460,7 +485,12 @@ function change_shape(id_db_node) {
})
.on("click", selected_node)
.on("dblclick", function(d) {
edit_node(d, true);
if (d.type == undefined) {
move_to_networkmap(d);
}
else {
edit_node(d, true);
}
})
.on("contextmenu", function(d) { show_menu("node", d);});
}
@ -3154,7 +3184,12 @@ function draw_elements_graph() {
})
.on("click", selected_node)
.on("dblclick", function(d) {
edit_node(d, true);
if (d.type == undefined) {
move_to_networkmap(d);
}
else {
edit_node(d, true);
}
})
.on("contextmenu", function(d) { show_menu("node", d);});
@ -3188,7 +3223,12 @@ function draw_elements_graph() {
})
.on("click", selected_node)
.on("dblclick", function(d) {
edit_node(d, true);
if (d.type == undefined) {
move_to_networkmap(d);
}
else {
edit_node(d, true);
}
})
.on("contextmenu", function(d) { show_menu("node", d);});
@ -3216,7 +3256,12 @@ function draw_elements_graph() {
})
.on("click", selected_node)
.on("dblclick", function(d) {
edit_node(d, true);
if (d.type == undefined) {
move_to_networkmap(d);
}
else {
edit_node(d, true);
}
})
.on("contextmenu", function(d) { show_menu("node", d);});
@ -3254,7 +3299,12 @@ function draw_elements_graph() {
})
.on("click", selected_node)
.on("dblclick", function(d) {
edit_node(d, true);
if (d.type == undefined) {
move_to_networkmap(d);
}
else {
edit_node(d, true);
}
})
.on("contextmenu", function(d) { show_menu("node", d);});
@ -3284,7 +3334,12 @@ function draw_elements_graph() {
})
.on("click", selected_node)
.on("dblclick", function(d) {
edit_node(d, true);
if (d.type == undefined) {
move_to_networkmap(d);
}
else {
edit_node(d, true);
}
})
.on("contextmenu", function(d) { show_menu("node", d);});
@ -3322,7 +3377,12 @@ function draw_elements_graph() {
})
.on("click", selected_node)
.on("dblclick", function(d) {
edit_node(d, true);
if (d.type == undefined) {
move_to_networkmap(d);
}
else {
edit_node(d, true);
}
})
.on("contextmenu", function(d) { show_menu("node", d);});
@ -3353,6 +3413,29 @@ function draw_elements_graph() {
node.exit().remove();
}
function move_to_networkmap (node) {
var params = [];
params.push("get_networkmap_from_fictional=1");
params.push("id=" + node.id_db);
params.push("id_map=" + node.map_id);
params.push("page=enterprise/operation/agentes/pandora_networkmap.view");
jQuery.ajax ({
data: params.join ("&"),
dataType: 'json',
type: 'POST',
url: action="ajax.php",
success: function (data) {
if (data['correct']) {
window.location="index.php?sec=network&sec2=operation/agentes/pandora_networkmap&tab=view&id_networkmap=" + data['id_networkmap'];
}
else {
edit_node(node, true);
}
}
});
}
function choose_group_for_show_agents() {
if (enterprise_installed) {
group = $("#group_for_show_agents option:selected").val();