Fixed colour link and delete link

This commit is contained in:
danielmaya 2018-01-22 16:17:10 +01:00
parent c96b9aac0d
commit 72aefbd96d
2 changed files with 10 additions and 4 deletions

View File

@ -87,7 +87,7 @@ function maps_duplicate_items_map($id, $map_items) {
'options' => $item['options'], 'style' => $item['style']); 'options' => $item['options'], 'style' => $item['style']);
$result_copy_item = db_process_sql_insert('titem', $copy_items); $result_copy_item = db_process_sql_insert('titem', $copy_items);
if ($result_copy_item) { if ($result_copy_item) {
$item_relations = db_get_all_rows_sql("SELECT * FROM trel_item WHERE id = " . $item['id']); $item_relations = db_get_all_rows_sql("SELECT * FROM trel_item WHERE id = " . $item['id'] . " AND deleted = 0");
if ($item['id'] == $item_relations['parent_id']) { if ($item['id'] == $item_relations['parent_id']) {
$copy_item_relations = array( $copy_item_relations = array(
'id_parent' => $result_copy_item, 'id_parent' => $result_copy_item,

View File

@ -582,10 +582,16 @@ function update_link(row_index, id_link) {
delete_link_from_id(index); delete_link_from_id(index);
var temp_link = {}; var temp_link = {};
temp_link["status_start"] = "0";
temp_link["status_end"] = "0";
temp_link["id_db"] = String(data['id_db_link']); temp_link["id_db"] = String(data['id_db_link']);
if (data['type_source'] == 1) { if (data['type_source'] == 1) {
temp_link["arrow_start"] = "module"; temp_link["arrow_start"] = "module";
temp_link["id_module_start"] = interface_source; temp_link["id_module_start"] = interface_source;
temp_link["status_start"] = data['status'];
temp_link["link_color"] = (data['status'] == "1") ? "#FC4444" : "#999";
} }
else { else {
temp_link["arrow_start"] = ""; temp_link["arrow_start"] = "";
@ -595,14 +601,14 @@ function update_link(row_index, id_link) {
if (data['type_target'] == 1) { if (data['type_target'] == 1) {
temp_link["arrow_end"] = "module"; temp_link["arrow_end"] = "module";
temp_link["id_module_end"] = interface_target; temp_link["id_module_end"] = interface_target;
temp_link["status_end"] = data['status'];
temp_link["link_color"] = (data['status'] == "1") ? "#FC4444" : "#999";
} }
else { else {
temp_link["arrow_end"] = ""; temp_link["arrow_end"] = "";
temp_link["id_agent_end"] = interface_target; temp_link["id_agent_end"] = interface_target;
temp_link["id_module_end"] = 0; temp_link["id_module_end"] = 0;
} }
temp_link["status_start"] = "0";
temp_link["status_end"] = "0";
temp_link["text_start"] = data["text_start"]; temp_link["text_start"] = data["text_start"];
temp_link["text_end"] = data["text_end"]; temp_link["text_end"] = data["text_end"];