|
|
@@ -32,13 +32,15 @@ $(document).ready(function() {
|
|
|
break;
|
|
|
}
|
|
|
temp["id"] = id;
|
|
|
- if(TYPE == "childs")
|
|
|
+ if (TYPE == "childs") {
|
|
|
temp["type"] = "proces";
|
|
|
- else
|
|
|
- if(arr[id]["TYPE"] == "STANOWISKO" || arr[id]["TYPE"] == "DZIAL" || arr[id]["TYPE"] == "PODMIOT")
|
|
|
+ } else {
|
|
|
+ if (arr[id]["TYPE"] == "STANOWISKO" || arr[id]["TYPE"] == "DZIAL" || arr[id]["TYPE"] == "PODMIOT") {
|
|
|
temp["type"] = "stanowiska";
|
|
|
- else
|
|
|
+ } else {
|
|
|
temp["type"] = "zasoby";
|
|
|
+ }
|
|
|
+ }
|
|
|
temp["text"] = "<span class=detailsTable2 " + style + " >" + id + "</span> " + arr[id]["DESC"];
|
|
|
temp["parent"] = arr[id]["PARENT_ID"];
|
|
|
data.push(temp);
|
|
|
@@ -48,7 +50,6 @@ $(document).ready(function() {
|
|
|
return data;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
$(document).on('keyup', '#search', function(e) {
|
|
|
if (sTimeout) {
|
|
|
clearTimeout(sTimeout);
|
|
|
@@ -63,7 +64,7 @@ $(document).ready(function() {
|
|
|
var tree = $("#tree").jstree(true);
|
|
|
var id = node.id;
|
|
|
var items = {};
|
|
|
- if (node.type === "proces")
|
|
|
+ if (node.type === "proces") {
|
|
|
items = {
|
|
|
"ProcesEditor": {
|
|
|
"separator_before": false,
|
|
|
@@ -89,7 +90,6 @@ $(document).ready(function() {
|
|
|
window.location = BASE_URL + 'procesy5.php?task=CRM_TESTY_ADD_PYTANIA&id_proces=' + id;
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
"ProcesMap": {
|
|
|
"separator_before": false,
|
|
|
"separator_after": false,
|
|
|
@@ -162,20 +162,21 @@ $(document).ready(function() {
|
|
|
}
|
|
|
},
|
|
|
};
|
|
|
+ }
|
|
|
|
|
|
- if (node.type === "zasoby" || node.type === "stanowiska")
|
|
|
- items = {
|
|
|
- "Edit": {
|
|
|
- "separator_before": false,
|
|
|
- "separator_after": true,
|
|
|
- "label": "Edytuj zasób",
|
|
|
- "action": function(obj) {
|
|
|
- var zId = id.replace("wsk", "");
|
|
|
- window.location = BASE_URL + 'index.php?_route=ViewTableAjax&typeName=p5_default_db:CRM_LISTA_ZASOBOW#EDIT/' + zId;
|
|
|
- }
|
|
|
- },
|
|
|
- };
|
|
|
-
|
|
|
+ if (node.type === "zasoby" || node.type === "stanowiska") {
|
|
|
+ items = {
|
|
|
+ "Edit": {
|
|
|
+ "separator_before": false,
|
|
|
+ "separator_after": true,
|
|
|
+ "label": "Edytuj zasób",
|
|
|
+ "action": function(obj) {
|
|
|
+ var zId = id.replace("wsk", "");
|
|
|
+ window.location = BASE_URL + 'index.php?_route=ViewTableAjax&typeName=p5_default_db:CRM_LISTA_ZASOBOW#EDIT/' + zId;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ };
|
|
|
+ }
|
|
|
return items;
|
|
|
}
|
|
|
|
|
|
@@ -220,7 +221,6 @@ $(document).ready(function() {
|
|
|
"items": customMenu
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function renderPanels() {
|
|
|
@@ -231,7 +231,7 @@ $(document).ready(function() {
|
|
|
$.each(arr, function(i, e){
|
|
|
createPanel(e["ID"], i, e["TYPE"]);
|
|
|
});
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
createPanel(START_ID, 0, TYPE);
|
|
|
}
|
|
|
}
|
|
|
@@ -241,34 +241,32 @@ $(document).ready(function() {
|
|
|
var temp = {};
|
|
|
temp["ID"] = id;
|
|
|
var inherit = $("#depth" + (depth - 1)).data("type");
|
|
|
- if ("connect" == inherit)
|
|
|
+ if ("connect" == inherit) {
|
|
|
inherit = "childs";
|
|
|
-
|
|
|
- if ("aliasChilds" == inherit)
|
|
|
+ }
|
|
|
+ if ("aliasChilds" == inherit) {
|
|
|
inherit = "res";
|
|
|
-
|
|
|
- if ("gotoChilds" == inherit)
|
|
|
+ }
|
|
|
+ if ("gotoChilds" == inherit) {
|
|
|
inherit = "childs";
|
|
|
-
|
|
|
-
|
|
|
- if (type == "inherit")
|
|
|
+ }
|
|
|
+ if (type == "inherit") {
|
|
|
type = inherit;
|
|
|
-
|
|
|
- if (type == "childs" && procesy[id]["childs"].length == 0)
|
|
|
+ }
|
|
|
+ if (type == "childs" && procesy[id]["childs"].length == 0) {
|
|
|
type = "details";
|
|
|
-
|
|
|
-
|
|
|
- if (type == "alias")
|
|
|
+ }
|
|
|
+ if (type == "alias") {
|
|
|
type = "detailsRes";
|
|
|
-
|
|
|
- if (type == "res" && res[id]["childs"].length == 0)
|
|
|
+ }
|
|
|
+ if (type == "res" && res[id]["childs"].length == 0) {
|
|
|
type = "detailsRes";
|
|
|
+ }
|
|
|
temp["TYPE"] = type;
|
|
|
temp["FOCUS"] = 0;
|
|
|
state[depth] = temp;
|
|
|
if(depth > 0)
|
|
|
state[depth-1]["FOCUS"] = id;
|
|
|
- //console.log(state);
|
|
|
renderPanel(depth);
|
|
|
}
|
|
|
|
|
|
@@ -276,46 +274,49 @@ $(document).ready(function() {
|
|
|
var type = state[depth]["TYPE"];
|
|
|
var id = state[depth]["ID"];
|
|
|
var link = BASE_URL + "index.php?_route=UrlAction_ProcesView&_task=getDetailsAjax&id=" + id;
|
|
|
- if ("connect" == type)
|
|
|
+ if ("connect" == type) {
|
|
|
link = BASE_URL + "index.php?_route=UrlAction_ProcesView&_task=getConnectedProcAjax&id=" + id;
|
|
|
- $("#depth" + (depth - 1)).nextAll(".singleAdv").remove();
|
|
|
- var target = $("<div class=singleAdv data-depth=" + depth + " id=depth" + depth + " data-parent=" + id + " data-type=" + type + " ></div>");
|
|
|
- target.appendTo("#procCon");
|
|
|
- $("#procCon").css("width", depth * 460 + 460);
|
|
|
- $("#ulproc").scrollLeft(depth * 460 + 460);
|
|
|
+ }
|
|
|
+ $("#depth" + (depth - 1)).nextAll(".singleAdv").remove();
|
|
|
+ var target = $('<div class="singleAdv" data-depth="' + depth + '" id="depth' + depth + '" data-parent="' + id + '" data-type="' + type + '"></div>');
|
|
|
+ target.appendTo("#procCon");
|
|
|
+ $("#procCon").css("width", depth * 460 + 460);
|
|
|
+ $("#ulproc").scrollLeft(depth * 460 + 460);
|
|
|
|
|
|
$.get(link, function(exp) {
|
|
|
-
|
|
|
- //console.log(procesy);
|
|
|
-
|
|
|
- //console.log(next);
|
|
|
var result = "";
|
|
|
-
|
|
|
result += "<li ";
|
|
|
- if(id != 0){
|
|
|
- if("childs" == type || "goto" == type || "details" == type)
|
|
|
+ if (id != 0) {
|
|
|
+ if ("childs" == type || "goto" == type || "details" == type) {
|
|
|
result += "data-opis='" + procesy[id]["OPIS"] + "' data-desc='" + procesy[id]["DESC"] + "' data-id=" + id + " ";
|
|
|
- else
|
|
|
+ } else {
|
|
|
result += "data-opis='" + res[id]["OPIS"] + "' data-desc='" + res[id]["DESC"] + "' data-id=" + id + " ";
|
|
|
+ }
|
|
|
}
|
|
|
- if ("childs" == type)
|
|
|
+ if ("childs" == type) {
|
|
|
result += "class='list-group-item disabled-item normalChilds'>" + (id == 0 ? "Procesy" : "{" + id + "} Procesy podrzędne");
|
|
|
- if ("details" == type)
|
|
|
+ }
|
|
|
+ if ("details" == type) {
|
|
|
result += "class='list-group-item disabled-item normalChilds '>{" + id + "} Szczegóły";
|
|
|
- if ("res" == type || "alias" == type)
|
|
|
+ }
|
|
|
+ if ("res" == type || "alias" == type) {
|
|
|
result += "class='list-group-item disabled-item normalChilds'>" + (id == 0 ? "Zasoby" : "[" + id + "] Zasoby podrzędne");
|
|
|
- if ("detailsRes" == type)
|
|
|
+ }
|
|
|
+ if ("detailsRes" == type) {
|
|
|
result += "class='list-group-item disabled-item normalChilds'>[" + id + "] Szczegóły";
|
|
|
- if ("goto" == type)
|
|
|
+ }
|
|
|
+ if ("goto" == type) {
|
|
|
result += "class='list-group-item disabled-item normalChilds'>{" + id + "} Procesy podrzędne";
|
|
|
- if ("connect" == type)
|
|
|
+ }
|
|
|
+ if ("connect" == type) {
|
|
|
result += "class='list-group-item disabled-item normalChilds'>[" + id + "] Procesy powiązane";
|
|
|
+ }
|
|
|
if(id != 0 && "connect" != type){
|
|
|
result += "<div style=float:right;><div class='dropdown '>";
|
|
|
|
|
|
if ("goto" == type || "details" == type || "childs" == type) {
|
|
|
- result += "<span class='glyph glyphicon glyphicon glyphicon-menu-hamburger dropdown-toggle' data-toggle='dropdown' aria-haspopup='true' aria-expanded='true' id='dropdownMenuP" + procesy[id]["ID"] + "'></span>";
|
|
|
- result += '<ul class="dropdown-menu dropdown-menu-right" style=z-index:100 aria-labelledby="dropdownMenuP' + procesy[id]["ID"] + '">';
|
|
|
+ result += "<span class='glyph glyphicon glyphicon glyphicon-menu-hamburger dropdown-toggle' data-toggle='dropdown' aria-haspopup='true' aria-expanded='true' id='dropdownMenuP" + procesy[id]["ID"] + "'></span>";
|
|
|
+ result += '<ul class="dropdown-menu dropdown-menu-right" style=z-index:100 aria-labelledby="dropdownMenuP' + procesy[id]["ID"] + '">';
|
|
|
}
|
|
|
if ("res" == type || "alias" == type || "connect" == type || "detailsRes" == type) {
|
|
|
result += "<span class='glyph glyphicon glyphicon glyphicon-menu-hamburger dropdown-toggle' data-toggle='dropdown' aria-haspopup='true' aria-expanded='true' id='dropdownMenuR" + res[id]["ID"] + "'></span>";
|
|
|
@@ -342,22 +343,17 @@ $(document).ready(function() {
|
|
|
result += '<li><a href="' + BASE_URL + 'index.php?_route=ViewTableAjax&typeName=p5_default_db:CRM_LISTA_ZASOBOW#EDIT/' + data["ID"] + '">Edytuj zasób</a></li>';
|
|
|
result += '<li><a href="" class=connect>Procesy powiązane</a></li>';
|
|
|
}
|
|
|
-
|
|
|
result += '</ul>';
|
|
|
result += "</div><div>";
|
|
|
}
|
|
|
result += "</li>";
|
|
|
-
|
|
|
-
|
|
|
result += "<ul class='singleAdvList list-group' style=margin-bottom:0px;>";
|
|
|
-
|
|
|
if (("details" == type && "res" != $("#depth" + (depth - 1)).data("type"))) {
|
|
|
result += getDetails(procesy[id], exp, "proces");
|
|
|
}
|
|
|
if (("details" == type && "res" == $("#depth" + (depth - 1)).data("type")) || "detailsRes" == type) {
|
|
|
result += getDetails(res[id], exp, "res");
|
|
|
}
|
|
|
-
|
|
|
if ("childs" == type || "gotoChilds" == type) {
|
|
|
if (procesy[id]["childs"].length > 0) {
|
|
|
$.each(procesy[id]["childs"], function(i, e) {
|
|
|
@@ -367,11 +363,9 @@ $(document).ready(function() {
|
|
|
result += getDetails(procesy[id], exp, "proces");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
if ("goto" == type) {
|
|
|
result += getDetails(procesy[id], exp);
|
|
|
}
|
|
|
-
|
|
|
if ("connect" == type) {
|
|
|
if (exp["wsk"].length > 0) {
|
|
|
$.each(exp["wsk"], function(i, e) {
|
|
|
@@ -381,7 +375,6 @@ $(document).ready(function() {
|
|
|
result += "<li class='list-group-item disabled-item list-group-item-danger'>Brak procesów powiązanych.</li>";
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
if ("res" == type || "aliasChilds" == type) {
|
|
|
if (res[id]["childs"].length > 0) {
|
|
|
$.each(res[id]["childs"], function(i, e) {
|
|
|
@@ -391,37 +384,27 @@ $(document).ready(function() {
|
|
|
result += getDetails(res[id], exp);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
if ("alias" == type) {
|
|
|
result += getDetails(res[id], exp);
|
|
|
}
|
|
|
-
|
|
|
result += "</ul></div>";
|
|
|
-
|
|
|
-
|
|
|
$("#ulproc").scrollTop(0);
|
|
|
target.html(result);
|
|
|
$(".singleAdvList").css("height", $(window).height() - 200 + "px");
|
|
|
-
|
|
|
-
|
|
|
});
|
|
|
- //console.log(result);
|
|
|
localStorage.setItem( TYPE, JSON.stringify(state) );
|
|
|
}
|
|
|
|
|
|
function render() {
|
|
|
if (panels) {
|
|
|
- //console.log("panels");
|
|
|
renderPanels();
|
|
|
} else {
|
|
|
- //console.log("drzewo");
|
|
|
renderTree();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function updateParent(id, parent, item) {
|
|
|
var link = BASE_URL + 'wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&SRSNAME=EPSG:3003&';
|
|
|
-
|
|
|
var req = `
|
|
|
<Transaction
|
|
|
xmlns="http://www.opengis.net/wfs"
|
|
|
@@ -453,16 +436,13 @@ xmlns:gml="http://www.opengis.net/gml">
|
|
|
$.notify("Brak połączenia z bazą danych", "error");
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
}
|
|
|
|
|
|
$(document).on("click", ".toggleRoute", function(){
|
|
|
-
|
|
|
var obj = $(this).closest(".singleAdv");
|
|
|
var id = $(obj).data("parent");
|
|
|
var type = $(obj).data("type");
|
|
|
-
|
|
|
- if($(this).data("state") == 0){
|
|
|
+ if ($(this).data("state") == 0) {
|
|
|
$(this).data("state", 1);
|
|
|
$(this).text("UKRYJ ŚCIEŻKĘ");
|
|
|
$(this).parent().find(".route").html("<ul style=list-style:none;padding-left:0px;>"+showTree(id, type, 0)+"</ul>");
|
|
|
@@ -472,7 +452,7 @@ xmlns:gml="http://www.opengis.net/gml">
|
|
|
depth += 16;
|
|
|
});
|
|
|
$(this).parent().find(".route").show();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
$(this).data("state", 0);
|
|
|
$(this).text("POKAŻ ŚCIEŻKĘ");
|
|
|
$(this).parent().find(".route").hide();
|
|
|
@@ -481,31 +461,29 @@ xmlns:gml="http://www.opengis.net/gml">
|
|
|
});
|
|
|
|
|
|
function showTree(id, type, count) {
|
|
|
- //console.log(count);
|
|
|
- if(id == "#" || count >= 100)
|
|
|
+ if (id == "#" || count >= 100) return "";
|
|
|
+ if (type == "detailsRes" || type == "alias") {
|
|
|
+ if (typeof res[id]["DESC"] != "undefined") {
|
|
|
+ return showTree(res[id]["PARENT_ID"], "detailsRes", count+1)+"<li style=padding-left:0px;><span class='glyphicon glyphicon-arrow-right'></span> " + res[id]["DESC"] + "</li>";
|
|
|
+ } else {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (typeof procesy[id]["DESC"] != "undefined") {
|
|
|
+ return showTree(procesy[id]["PARENT_ID"], "detailsProc", count+1)+"<li style=padding-left:0px;><span class='glyphicon glyphicon-arrow-right'></span> " + procesy[id]["DESC"] + "</li>";
|
|
|
+ } else {
|
|
|
return "";
|
|
|
- if(type == "detailsRes" || type == "alias")
|
|
|
- if(typeof res[id]["DESC"] != "undefined")
|
|
|
- return showTree(res[id]["PARENT_ID"], "detailsRes", count+1)+"<li style=padding-left:0px;><span class='glyphicon glyphicon-arrow-right'></span> " + res[id]["DESC"] + "</li>";
|
|
|
- else
|
|
|
- return "";
|
|
|
- else
|
|
|
- if(typeof procesy[id]["DESC"] != "undefined")
|
|
|
- return showTree(procesy[id]["PARENT_ID"], "detailsProc", count+1)+"<li style=padding-left:0px;><span class='glyphicon glyphicon-arrow-right'></span> " + procesy[id]["DESC"] + "</li>";
|
|
|
- else
|
|
|
- return "";
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
function getDetails(e, data, type) {
|
|
|
-
|
|
|
- //console.log("test", e);
|
|
|
var result = "";
|
|
|
- if(type == "proces")
|
|
|
+ if (type == "proces") {
|
|
|
result += '<div class="panel panel-info" style=margin-bottom:0px;>';
|
|
|
- else
|
|
|
+ } else {
|
|
|
result += '<div class="panel panel-success" style=margin-bottom:0px;>';
|
|
|
+ }
|
|
|
result += '<div class="panel-heading"><h3 class="panel-title">' + e["DESC"] + '</h3></div>';
|
|
|
result += '<div class="panel-body pbody">';
|
|
|
result += e["OPIS"];
|
|
|
@@ -538,6 +516,7 @@ xmlns:gml="http://www.opengis.net/gml">
|
|
|
});
|
|
|
result += "</ul>";
|
|
|
}
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@@ -548,8 +527,8 @@ xmlns:gml="http://www.opengis.net/gml">
|
|
|
var parent_id = $(this).data("id");
|
|
|
var id = procesy[parent_id]["ID"];
|
|
|
var depth = $(this).closest(".singleAdv").data("depth") + 1;
|
|
|
-
|
|
|
createPanel(id, depth, "goto");
|
|
|
+
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
@@ -560,8 +539,8 @@ xmlns:gml="http://www.opengis.net/gml">
|
|
|
var parent_id = $(this).data("id");
|
|
|
var id = res[parent_id]["ID"];
|
|
|
var depth = $(this).closest(".singleAdv").data("depth") + 1;
|
|
|
-
|
|
|
createPanel(id, depth, "alias");
|
|
|
+
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
@@ -646,23 +625,27 @@ xmlns:gml="http://www.opengis.net/gml">
|
|
|
|
|
|
if (data["ALIAS_ID"] != 0 && type == "res") {
|
|
|
var id = data["ALIAS_ID"];
|
|
|
- data = res[id];
|
|
|
- result += "<li class='list-group-item alias " + (state[depth]["FOCUS"] == data["ID"] ? "list-group-item-info" : "") + "'; ";
|
|
|
- result += "data-opis='" + data["OPIS"] + "' data-desc='" + data["DESC"] + "' data-id=" + data["ID"] + " style=border-top-style:none;>";
|
|
|
- result += "";
|
|
|
- result += '<div class="textTable">'
|
|
|
- result += "<span class=gotoInfo><span class='glyphicon glyphicon-arrow-right'></span> ALIAS </span><span class=gotoWay>" + data["ID"] + "</span>";
|
|
|
- result += "</div>"
|
|
|
- result += "<div style=float:right;><span class='glyph glyphicon gl glyphicon-triangle-right'></span>";
|
|
|
- result += "<div class='dropdown '>";
|
|
|
- result += "<span class='glyph glyphicon glyphicon glyphicon-menu-hamburger dropdown-toggle' data-toggle='dropdown' aria-haspopup='true' aria-expanded='true' id='dropdownMenu" + data["ID"] + "'></span>";
|
|
|
- result += '<ul class="dropdown-menu dropdown-menu-right" style=z-index:100 aria-labelledby="dropdownMenu' + data["ID"] + '">';
|
|
|
- result += '<li><a href="' + BASE_URL + 'index.php?_route=ViewTableAjax&typeName=p5_default_db:CRM_LISTA_ZASOBOW#EDIT/' + data["ID"] + '">Edytuj zasób</a></li>';
|
|
|
- result += '<li><a href="" class=connect>Procesy powiązane</a></li>';
|
|
|
- result += '<li><a href="" class=details>Szczegóły</a></li>';
|
|
|
- result += '</ul>';
|
|
|
- result += "</div>";
|
|
|
- result += '</div><div class=clearfix></div></blockqoute></li>';
|
|
|
+ if (id in res) {
|
|
|
+ data = res[id];
|
|
|
+ result += "<li class='list-group-item alias " + (state[depth]["FOCUS"] == data["ID"] ? "list-group-item-info" : "") + "'; ";
|
|
|
+ result += "data-opis='" + data["OPIS"] + "' data-desc='" + data["DESC"] + "' data-id=" + data["ID"] + " style=border-top-style:none;>";
|
|
|
+ result += "";
|
|
|
+ result += '<div class="textTable">'
|
|
|
+ result += "<span class=gotoInfo><span class='glyphicon glyphicon-arrow-right'></span> ALIAS </span><span class=gotoWay>" + data["ID"] + "</span>";
|
|
|
+ result += "</div>"
|
|
|
+ result += "<div style=float:right;><span class='glyph glyphicon gl glyphicon-triangle-right'></span>";
|
|
|
+ result += "<div class='dropdown '>";
|
|
|
+ result += "<span class='glyph glyphicon glyphicon glyphicon-menu-hamburger dropdown-toggle' data-toggle='dropdown' aria-haspopup='true' aria-expanded='true' id='dropdownMenu" + data["ID"] + "'></span>";
|
|
|
+ result += '<ul class="dropdown-menu dropdown-menu-right" style=z-index:100 aria-labelledby="dropdownMenu' + data["ID"] + '">';
|
|
|
+ result += '<li><a href="' + BASE_URL + 'index.php?_route=ViewTableAjax&typeName=p5_default_db:CRM_LISTA_ZASOBOW#EDIT/' + data["ID"] + '">Edytuj zasób</a></li>';
|
|
|
+ result += '<li><a href="" class=connect>Procesy powiązane</a></li>';
|
|
|
+ result += '<li><a href="" class=details>Szczegóły</a></li>';
|
|
|
+ result += '</ul>';
|
|
|
+ result += "</div>";
|
|
|
+ result += '</div><div class=clearfix></div></blockqoute></li>';
|
|
|
+ } else {
|
|
|
+ console.log('BUG ALIAS_ID['+data['ALIAS_ID']+'] in ['+data['ID']+'] not in res', data, res);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
@@ -679,8 +662,6 @@ xmlns:gml="http://www.opengis.net/gml">
|
|
|
var parentOfParent_id = $(this).closest(".singleAdv").data("parent");
|
|
|
var depth = $(this).closest(".singleAdv").data("depth") + 1;
|
|
|
createPanel(parent_id, depth, "connect");
|
|
|
-
|
|
|
-
|
|
|
});
|
|
|
|
|
|
$(document).on('click', '.details', function(e) {
|
|
|
@@ -695,10 +676,8 @@ xmlns:gml="http://www.opengis.net/gml">
|
|
|
var depth = $(this).closest(".singleAdv").data("depth") + 1;
|
|
|
if ($(this).closest(".list-group-item").hasClass("wsk") || $(this).closest(".singleAdv").data("type") == "res" || $(this).closest(".list-group-item").hasClass("alias")) {
|
|
|
createPanel(parent_id, depth, "detailsRes");
|
|
|
- //console.log("detailsRes");
|
|
|
} else {
|
|
|
createPanel(parent_id, depth, "details");
|
|
|
- //console.log("details");
|
|
|
}
|
|
|
initSortable();
|
|
|
});
|
|
|
@@ -736,17 +715,17 @@ xmlns:gml="http://www.opengis.net/gml">
|
|
|
});
|
|
|
|
|
|
$(document).on('click', '.liProc', function() {
|
|
|
-
|
|
|
$(this).parents(".singleAdv").find(".active").removeClass("active");
|
|
|
$(this).parents(".singleAdv").find(".list-group-item-info").removeClass("list-group-item-info");
|
|
|
$(this).addClass("active");
|
|
|
var parent_id = $(this).data("id");
|
|
|
var parentOfParent_id = $(this).closest(".singleAdv").data("parent");
|
|
|
var depth = $(this).closest(".singleAdv").data("depth") + 1;
|
|
|
- if ($(this).hasClass("wsk"))
|
|
|
+ if ($(this).hasClass("wsk")) {
|
|
|
createPanel(parent_id, depth, "res");
|
|
|
- else
|
|
|
+ } else {
|
|
|
createPanel(parent_id, depth, "inherit");
|
|
|
+ }
|
|
|
initSortable();
|
|
|
});
|
|
|
|
|
|
@@ -766,31 +745,41 @@ xmlns:gml="http://www.opengis.net/gml">
|
|
|
// updateParent($(ui.item).data("id"),$(ui.item).closest(".singleAdv").data("parent"), this);
|
|
|
// },
|
|
|
// }).disableSelection();
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function start() {
|
|
|
var link = BASE_URL + 'index.php?_route=UrlAction_ProcesView&_task=getAllAjax';
|
|
|
$.get(link, function(data) {
|
|
|
- //console.log("x");
|
|
|
- //console.log(data);
|
|
|
- procesy = data;
|
|
|
- if (TYPE == "childs")
|
|
|
- render();
|
|
|
- //console.log(procesy);
|
|
|
+ procesy = {}
|
|
|
+ for (idx in data) {// FIX childs by SORT_PRIO
|
|
|
+ var d = data[idx]
|
|
|
+ if ('childs' in d) {
|
|
|
+ var dataChilds = d['childs'].map(function (child) {
|
|
|
+ var idChild = child['ID'];
|
|
|
+ var sortPrio = (idChild in data) ? parseInt(data[idChild]['SORT_PRIO']) : 0;
|
|
|
+ return {SORT_PRIO: sortPrio, ID: idChild};
|
|
|
+ });
|
|
|
+ var sortedChilds = dataChilds.sort(function(a, b) {
|
|
|
+ if (a['SORT_PRIO'] == b['SORT_PRIO']) {
|
|
|
+ return a['ID'] - b['ID'];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return a['SORT_PRIO'] - b['SORT_PRIO'];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ d['childs'] = sortedChilds;
|
|
|
+ }
|
|
|
+ procesy[idx] = d;
|
|
|
+ }
|
|
|
+ if (TYPE == "childs") render();
|
|
|
});
|
|
|
link = BASE_URL + 'index.php?_route=UrlAction_ProcesView&_task=getAllResAjax';
|
|
|
$.get(link, function(data) {
|
|
|
- //console.log("x");
|
|
|
- //console.log(data);
|
|
|
res = data;
|
|
|
- if (TYPE == "res")
|
|
|
- render();
|
|
|
- //console.log(res);
|
|
|
-
|
|
|
+ if (TYPE == "res") render();
|
|
|
});
|
|
|
}
|
|
|
- start();
|
|
|
|
|
|
+ start();
|
|
|
|
|
|
});
|