|
|
@@ -30,8 +30,7 @@ function setSort() {
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
version="1.0.0"
|
|
|
service="WFS"
|
|
|
- xmlns:p5_default_db="` + BASE_URL + `wfs/default_db/PROBLEMS"
|
|
|
- xsi:schemaLocation="` + BASE_URL + `wfs/default_db/PROBLEMS` + BASE_URL + `dev-pl/se-feature-api/wfs.php/xml/wfs/default_db/PROBLEMS/?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=p5_default_db:PROBLEMS&SRSNAME=EPSG:4326&"
|
|
|
+ xmlns:p5_default_db="` + BASE_WFS_URL + `/default_db/"
|
|
|
xmlns:gml="http://www.opengis.net/gml">
|
|
|
`;
|
|
|
var i = 0;
|
|
|
@@ -40,9 +39,9 @@ function setSort() {
|
|
|
i++;
|
|
|
req += `
|
|
|
<Insert xmlns="http://www.opengis.net/wfs">
|
|
|
- <PROBLEMS xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">
|
|
|
- <ID xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">` + $(this).data("id") + `</ID>
|
|
|
- <SORT_PRIO xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">` + i + `</SORT_PRIO>
|
|
|
+ <PROBLEMS xmlns="` + BASE_WFS_URL + `/default_db/">
|
|
|
+ <ID xmlns="` + BASE_WFS_URL + `/default_db/">` + $(this).data("id") + `</ID>
|
|
|
+ <SORT_PRIO xmlns="` + BASE_WFS_URL + `/default_db/">` + i + `</SORT_PRIO>
|
|
|
</PROBLEMS>
|
|
|
</Insert>
|
|
|
`;
|
|
|
@@ -59,9 +58,14 @@ function setSort() {
|
|
|
contentType: "text/xml",
|
|
|
dataType: "xml",
|
|
|
success: function(data) {
|
|
|
- //console.log("sorted");
|
|
|
//console.log(data);
|
|
|
- $.notify("Sortowanie zsynchronizowane", "success");
|
|
|
+ //console.log("sorted");
|
|
|
+ if($(data).find("ServiceException").text() == ""){
|
|
|
+ $.notify("Sortowanie zsynchronizowane", "success");
|
|
|
+ }else{
|
|
|
+ $.notify($(data).find("ServiceException").text(), "danger");
|
|
|
+ $.notify("Błąd. Skontaktuj się z administratorem", "error");
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
var temp = [];
|
|
|
@@ -78,15 +82,10 @@ function setSort() {
|
|
|
render();
|
|
|
}
|
|
|
|
|
|
-function createLink(name, id, target) {
|
|
|
- var link;
|
|
|
- if (TYPE == "PROBLEM") {
|
|
|
- link = BASE_URL + 'index.php?MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID=' + ProblemsTableId + "#EDIT/" + id;
|
|
|
- }
|
|
|
- if (TYPE == "PROJECT") {
|
|
|
- link = BASE_URL + 'index.php?MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID=' + ProjectsTableId + "#EDIT/" + id;
|
|
|
- }
|
|
|
- $(target).attr("href", link);
|
|
|
+function createLink(name, id) {
|
|
|
+ if (TYPE == "PROBLEM") return 'index.php?_route=ViewTableAjax&namespace=default_db/' + "PROBLEMS" + '#EDIT/' + id
|
|
|
+ if (TYPE == "PROJECT") return 'index.php?_route=ViewTableAjax&namespace=default_db/' + "IN7_MK_BAZA_DYSTRYBUCJI" + '#EDIT/' + id
|
|
|
+ return '#'
|
|
|
}
|
|
|
|
|
|
function getDetails(value) {
|
|
|
@@ -185,6 +184,9 @@ function updateProgress() {
|
|
|
if (procAcc == 0) {
|
|
|
$("#accepted").text("");
|
|
|
}
|
|
|
+ if(proc == procAcc){
|
|
|
+ $("#completed").text("");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function getCaretPosition(ctrl) {
|
|
|
@@ -315,21 +317,22 @@ $(document).on('keydown', '.hours', function(e) {
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
version="1.0.0"
|
|
|
service="WFS"
|
|
|
- xmlns:p5_default_db="` + BASE_URL + `wfs/default_db/PROBLEMS"
|
|
|
- xsi:schemaLocation="` + BASE_URL + `wfs/default_db/PROBLEMS` + BASE_URL + `dev-pl/se-feature-api/wfs.php/xml/wfs/default_db/PROBLEMS/?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=p5_default_db:PROBLEMS&SRSNAME=EPSG:4326&"
|
|
|
+ xmlns:p5_default_db="` + BASE_WFS_URL + `/default_db/"
|
|
|
+ xsi:schemaLocation="` + BASE_WFS_URL + `/default_db/` + BASE_URL + `dev-pl/se-feature-api/wfs.php/xml/wfs/default_db/PROBLEMS/?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=p5_default_db:PROBLEMS&SRSNAME=EPSG:4326&"
|
|
|
xmlns:gml="http://www.opengis.net/gml">
|
|
|
`;
|
|
|
req += `
|
|
|
<Insert xmlns="http://www.opengis.net/wfs">
|
|
|
- <PROBLEMS xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">
|
|
|
- <ID xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">` + $(this).parents("li").data('id') + `</ID>
|
|
|
- <L_APPOITMENT_PERIOD xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">` + $(textarea).val()+ `</L_APPOITMENT_PERIOD>
|
|
|
+ <PROBLEMS xmlns="` + BASE_WFS_URL + `/default_db">
|
|
|
+ <ID xmlns="` + BASE_WFS_URL + `/default_db">` + $(this).parents("li").data('id') + `</ID>
|
|
|
+ <L_APPOITMENT_PERIOD xmlns="` + BASE_WFS_URL + `/default_db">` + $(textarea).val()+ `</L_APPOITMENT_PERIOD>
|
|
|
</PROBLEMS>
|
|
|
</Insert>`;
|
|
|
req += '</Transaction>';
|
|
|
var id = getIndexById($(this).parents("li").data('id'));
|
|
|
var period = $(this).val();
|
|
|
var link = BASE_URL + 'wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&SRSNAME=EPSG:3003&';
|
|
|
+ //console.log(req);
|
|
|
$.ajax({
|
|
|
url: link,
|
|
|
data: req,
|
|
|
@@ -337,6 +340,7 @@ $(document).on('keydown', '.hours', function(e) {
|
|
|
contentType: "text/xml",
|
|
|
dataType: "xml",
|
|
|
success: function(data) {
|
|
|
+ //console.log(data);
|
|
|
$.notify("Zapisano!", "success");
|
|
|
state[id]["period"] = period;
|
|
|
render();
|
|
|
@@ -356,26 +360,25 @@ $(document).on('keydown', '.editable', function(e) {
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
version="1.0.0"
|
|
|
service="WFS"
|
|
|
- xmlns:p5_default_db="` + BASE_URL + `wfs/default_db/PROBLEMS"
|
|
|
- xsi:schemaLocation="` + BASE_URL + `wfs/default_db/PROBLEMS` + BASE_URL + `dev-pl/se-feature-api/wfs.php/xml/wfs/default_db/PROBLEMS/?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=p5_default_db:PROBLEMS&SRSNAME=EPSG:4326&"
|
|
|
+ xmlns:p5_default_db="` + BASE_WFS_URL + `/default_db/"
|
|
|
xmlns:gml="http://www.opengis.net/gml">
|
|
|
`;
|
|
|
req += `
|
|
|
<Insert xmlns="http://www.opengis.net/wfs">
|
|
|
- <PROBLEMS xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">
|
|
|
- <ID xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">` + $(this).parents("li").data('id') + `</ID>`;
|
|
|
+ <PROBLEMS xmlns="` + BASE_WFS_URL + `/default_db/">
|
|
|
+ <ID xmlns="` + BASE_WFS_URL + `/default_db/">` + $(this).parents("li").data('id') + `</ID>`;
|
|
|
if (details.worker != false)
|
|
|
- req += '<L_APPOITMENT_USER xmlns="' + BASE_URL + 'wfs/default_db/PROBLEMS">' + details.worker + '</L_APPOITMENT_USER>';
|
|
|
+ req += '<L_APPOITMENT_USER xmlns="' + BASE_WFS_URL + '/default_db/">' + details.worker + '</L_APPOITMENT_USER>';
|
|
|
else
|
|
|
- req += '<L_APPOITMENT_USER xmlns="' + BASE_URL + 'wfs/default_db/PROBLEMS">' + USER + '</L_APPOITMENT_USER>';
|
|
|
+ req += '<L_APPOITMENT_USER xmlns="' + BASE_WFS_URL + '/default_db/">' + USER + '</L_APPOITMENT_USER>';
|
|
|
|
|
|
if (details.date != false)
|
|
|
- req += '<A_PROBLEM_DATE xmlns="' + BASE_URL + 'wfs/default_db/PROBLEMS">' + details.date + '</A_PROBLEM_DATE>';
|
|
|
+ req += '<A_PROBLEM_DATE xmlns="' + BASE_WFS_URL + '/default_db/">' + details.date + '</A_PROBLEM_DATE>';
|
|
|
else
|
|
|
- req += '<A_PROBLEM_DATE xmlns="' + BASE_URL + 'wfs/default_db/PROBLEMS">' + moment().format('YYYY-MM-DD HH:mm:ss') + '</A_PROBLEM_DATE>';
|
|
|
+ req += '<A_PROBLEM_DATE xmlns="' + BASE_WFS_URL + '/default_db/">' + moment().format('YYYY-MM-DD HH:mm:ss') + '</A_PROBLEM_DATE>';
|
|
|
|
|
|
- req += `<A_PROBLEM_DESC xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">` + $(this).val() + `</A_PROBLEM_DESC>
|
|
|
- <CUSTOMER_ADMIN_USER xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">BRAK</CUSTOMER_ADMIN_USER>
|
|
|
+ req += `<A_PROBLEM_DESC xmlns="` + BASE_WFS_URL + `/default_db/">` + $(this).val() + `</A_PROBLEM_DESC>
|
|
|
+ <CUSTOMER_ADMIN_USER xmlns="` + BASE_WFS_URL + `/default_db/">BRAK</CUSTOMER_ADMIN_USER>
|
|
|
</PROBLEMS>
|
|
|
</Insert>`;
|
|
|
req += '</Transaction>';
|
|
|
@@ -413,39 +416,39 @@ $(document).on('keydown', '.eInput', function(e) {
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
version="1.0.0"
|
|
|
service="WFS"
|
|
|
- xmlns:p5_default_db="` + BASE_URL + `wfs/default_db/PROBLEMS"
|
|
|
- xsi:schemaLocation="` + BASE_URL + `wfs/default_db/PROBLEMS` + BASE_URL + `dev-pl/se-feature-api/wfs.php/xml/wfs/default_db/PROBLEMS/?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=p5_default_db:PROBLEMS&SRSNAME=EPSG:4326&"
|
|
|
+ xmlns:p5_default_db="` + BASE_WFS_URL + `/default_db/"
|
|
|
xmlns:gml="http://www.opengis.net/gml">
|
|
|
`;
|
|
|
req += `
|
|
|
<Insert xmlns="http://www.opengis.net/wfs">
|
|
|
- <PROBLEMS xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">`;
|
|
|
+ <PROBLEMS xmlns="` + BASE_WFS_URL + `/default_db/">`;
|
|
|
if (TYPE == "PROBLEM") {
|
|
|
- req += `<PARENT_ID xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">` + TASK + `</PARENT_ID>`;
|
|
|
+ req += `<PARENT_ID xmlns="` + BASE_WFS_URL + `/default_db/">` + TASK + `</PARENT_ID>`;
|
|
|
}
|
|
|
if (TYPE == "PROJECT") {
|
|
|
- req += `<PARENT_ID xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">0</PARENT_ID>`;
|
|
|
+ req += `<PARENT_ID xmlns="` + BASE_WFS_URL + `/default_db/">0</PARENT_ID>`;
|
|
|
}
|
|
|
if (details.worker != false) {
|
|
|
- req += '<L_APPOITMENT_USER xmlns="' + BASE_URL + 'wfs/default_db/PROBLEMS">' + details.worker + '</L_APPOITMENT_USER>';
|
|
|
+ req += '<L_APPOITMENT_USER xmlns="' + BASE_WFS_URL + '/default_db/">' + details.worker + '</L_APPOITMENT_USER>';
|
|
|
} else {
|
|
|
- req += '<L_APPOITMENT_USER xmlns="' + BASE_URL + 'wfs/default_db/PROBLEMS">' + USER + '</L_APPOITMENT_USER>';
|
|
|
+ req += '<L_APPOITMENT_USER xmlns="' + BASE_WFS_URL + '/default_db/">' + USER + '</L_APPOITMENT_USER>';
|
|
|
}
|
|
|
|
|
|
if (details.date != false) {
|
|
|
- req += '<A_PROBLEM_DATE xmlns="' + BASE_URL + 'wfs/default_db/PROBLEMS">' + details.date + '</A_PROBLEM_DATE>';
|
|
|
+ req += '<A_PROBLEM_DATE xmlns="' + BASE_WFS_URL + '/default_db/">' + details.date + '</A_PROBLEM_DATE>';
|
|
|
} else {
|
|
|
- req += '<A_PROBLEM_DATE xmlns="' + BASE_URL + 'wfs/default_db/PROBLEMS">' + moment().format('YYYY-MM-DD HH:mm:ss') + '</A_PROBLEM_DATE>';
|
|
|
+ req += '<A_PROBLEM_DATE xmlns="' + BASE_WFS_URL + '/default_db/">' + moment().format('YYYY-MM-DD HH:mm:ss') + '</A_PROBLEM_DATE>';
|
|
|
}
|
|
|
- req += `<ID_PROJECT xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">` + ProjectId + `</ID_PROJECT>`;
|
|
|
- req += `<L_APPOITMENT_PERIOD xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">0</L_APPOITMENT_PERIOD>`;
|
|
|
- req += `<A_PROBLEM_DESC xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">` + $(this).val() + `</A_PROBLEM_DESC>
|
|
|
- <CUSTOMER_ADMIN_USER xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">BRAK</CUSTOMER_ADMIN_USER>
|
|
|
+ req += `<ID_PROJECT xmlns="` + BASE_WFS_URL + `/default_db">` + ProjectId + `</ID_PROJECT>`;
|
|
|
+ req += `<L_APPOITMENT_PERIOD xmlns="` + BASE_WFS_URL + `/default_db">0</L_APPOITMENT_PERIOD>`;
|
|
|
+ req += `<A_PROBLEM_DESC xmlns="` + BASE_WFS_URL + `/default_db">` + $(this).val() + `</A_PROBLEM_DESC>
|
|
|
+ <CUSTOMER_ADMIN_USER xmlns="` + BASE_WFS_URL + `/default_db">BRAK</CUSTOMER_ADMIN_USER>
|
|
|
</PROBLEMS>
|
|
|
</Insert>`;
|
|
|
req += '</Transaction>';
|
|
|
var link = BASE_URL + 'wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&SRSNAME=EPSG:3003&';
|
|
|
var info = this;
|
|
|
+ //console.log(req);
|
|
|
$.ajax({
|
|
|
url: link,
|
|
|
data: req,
|
|
|
@@ -453,19 +456,29 @@ $(document).on('keydown', '.eInput', function(e) {
|
|
|
contentType: "text/xml",
|
|
|
dataType: "xml",
|
|
|
success: function(data) {
|
|
|
+ //console.log(data);
|
|
|
+ if($(data).find("ServiceException").text() != ""){
|
|
|
+ $.notify("Błąd API: Prawdopodobnie nie masz uprawnień. Skontaktuj się z administratorem.", "error");
|
|
|
+ $.notify($(data).find("ServiceException").text(), "danger");
|
|
|
+ }else{
|
|
|
var temp = {};
|
|
|
temp["id"] = $(data).find("FeatureId").attr("fid").substr($(data).find("FeatureId").attr("fid").indexOf('.') + 1);
|
|
|
temp["desc"] = $(info).val();
|
|
|
temp["percent"] = "0%";
|
|
|
temp["period"] = "0";
|
|
|
+ temp["childs"] = false;
|
|
|
temp["status"] = "WAITING";
|
|
|
temp["worker"] = (details.worker != false ? details.worker : USER);
|
|
|
temp["owner"] = USER;
|
|
|
state.push(temp);
|
|
|
$(".eInput").val("");
|
|
|
+ //console.log(temp);
|
|
|
+ //console.log("x", state);
|
|
|
updateProgress();
|
|
|
render();
|
|
|
setSort();
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -474,10 +487,18 @@ $(document).on('keydown', '.eInput', function(e) {
|
|
|
});
|
|
|
|
|
|
$(document).on('click', '.delTask', function() {
|
|
|
+ var id = $(this).closest(".singleTask").data("id");
|
|
|
+ var index = getIndexById(id);
|
|
|
+
|
|
|
if ($(this).parents(".singleTask").find(".aCheck").data("state") == "1") {
|
|
|
$.notify("Nie możesz zmieniać stanu zatwierdzonych zadań", "danger");
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
+ if(state[index]['childs'] != false){
|
|
|
+ $.notify("Zmieniać status można tylko wtedy, jeżeli zadanie nie ma podzadań.", "danger");
|
|
|
+ return;
|
|
|
+ }
|
|
|
if ($(this).parents(".singleTask").data("step") == 2) {
|
|
|
allCount--;
|
|
|
} else {
|
|
|
@@ -485,23 +506,21 @@ $(document).on('click', '.delTask', function() {
|
|
|
activeCount--;
|
|
|
}
|
|
|
|
|
|
- var id = $(this).closest(".singleTask").data("id");
|
|
|
- var index = getIndexById(id);
|
|
|
+
|
|
|
var req = `
|
|
|
<Transaction
|
|
|
xmlns="http://www.opengis.net/wfs"
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
version="1.0.0"
|
|
|
service="WFS"
|
|
|
- xmlns:p5_default_db="` + BASE_URL + `wfs/default_db/PROBLEMS"
|
|
|
- xsi:schemaLocation="` + BASE_URL + `wfs/default_db/PROBLEMS` + BASE_URL + `dev-pl/se-feature-api/wfs.php/xml/wfs/default_db/PROBLEMS/?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=p5_default_db:PROBLEMS&SRSNAME=EPSG:4326&"
|
|
|
+ xmlns:p5_default_db="` + BASE_WFS_URL + `/default_db/"
|
|
|
xmlns:gml="http://www.opengis.net/gml">
|
|
|
`;
|
|
|
req += `
|
|
|
<Insert xmlns="http://www.opengis.net/wfs">
|
|
|
- <PROBLEMS xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">`;
|
|
|
- req += `<ID xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">` + id + `</ID>`;
|
|
|
- req += `<A_STATUS xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">DELETED</A_STATUS>
|
|
|
+ <PROBLEMS xmlns="` + BASE_WFS_URL + `/default_db/">`;
|
|
|
+ req += `<ID xmlns="` + BASE_WFS_URL + `/default_db/">` + id + `</ID>`;
|
|
|
+ req += `<A_STATUS xmlns="` + BASE_WFS_URL + `/default_db/">DELETED</A_STATUS>
|
|
|
</PROBLEMS>
|
|
|
</Insert>`;
|
|
|
req += '</Transaction>';
|
|
|
@@ -543,24 +562,24 @@ $(document).on('click', '.aCheck', function() {
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
version="1.0.0"
|
|
|
service="WFS"
|
|
|
- xmlns:p5_default_db="` + BASE_URL + `wfs/default_db/PROBLEMS"
|
|
|
- xsi:schemaLocation="` + BASE_URL + `wfs/default_db/PROBLEMS` + BASE_URL + `dev-pl/se-feature-api/wfs.php/xml/wfs/default_db/PROBLEMS/?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=p5_default_db:PROBLEMS&SRSNAME=EPSG:4326&"
|
|
|
+ xmlns:p5_default_db="` + BASE_WFS_URL + `/default_db"
|
|
|
xmlns:gml="http://www.opengis.net/gml">
|
|
|
`;
|
|
|
req += `
|
|
|
<Insert xmlns="http://www.opengis.net/wfs">
|
|
|
- <PROBLEMS xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">
|
|
|
- <ID xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">` + id + `</ID>`;
|
|
|
+ <PROBLEMS xmlns="` + BASE_WFS_URL + `/default_db">
|
|
|
+ <ID xmlns="` + BASE_WFS_URL + `/default_db">` + $(node).parents("li").data("id") + `</ID>`;
|
|
|
if (state[id]['status'] != "OFF_HARD") {
|
|
|
- req += '<A_STATUS xmlns="' + BASE_URL + 'wfs/default_db/PROBLEMS">OFF_HARD</A_STATUS>';
|
|
|
+ req += '<A_STATUS xmlns="' + BASE_WFS_URL + '/default_db">OFF_HARD</A_STATUS>';
|
|
|
state[id]['status'] = "OFF_HARD";
|
|
|
} else {
|
|
|
- req += '<A_STATUS xmlns="' + BASE_URL + 'wfs/default_db/PROBLEMS">WAITING</A_STATUS>';
|
|
|
+ req += '<A_STATUS xmlns="' + BASE_WFS_URL + '/default_db">WAITING</A_STATUS>';
|
|
|
state[id]['status'] = "WAITING";
|
|
|
}
|
|
|
req += `</PROBLEMS>
|
|
|
</Insert>
|
|
|
</Transaction>`;
|
|
|
+ //console.log(req);
|
|
|
$.ajax({
|
|
|
url: link,
|
|
|
data: req,
|
|
|
@@ -568,6 +587,7 @@ $(document).on('click', '.aCheck', function() {
|
|
|
contentType: "text/xml",
|
|
|
dataType: "text",
|
|
|
success: function(data) {
|
|
|
+ //console.log(data);
|
|
|
setSort();
|
|
|
updateProgress();
|
|
|
render();
|
|
|
@@ -604,20 +624,19 @@ $(document).on('click', '.check', function() {
|
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
version="1.0.0"
|
|
|
service="WFS"
|
|
|
- xmlns:p5_default_db="` + BASE_URL + `wfs/default_db/PROBLEMS"
|
|
|
- xsi:schemaLocation="` + BASE_URL + `wfs/default_db/PROBLEMS` + BASE_URL + `dev-pl/se-feature-api/wfs.php/xml/wfs/default_db/PROBLEMS/?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=p5_default_db:PROBLEMS&SRSNAME=EPSG:4326&"
|
|
|
+ xmlns:p5_default_db="` + BASE_WFS_URL + `/default_db"
|
|
|
xmlns:gml="http://www.opengis.net/gml">
|
|
|
`;
|
|
|
req += `
|
|
|
<Insert xmlns="http://www.opengis.net/wfs">
|
|
|
- <PROBLEMS xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">
|
|
|
- <ID xmlns="` + BASE_URL + `wfs/default_db/PROBLEMS">` + $(node).parents("li").data("id") + `</ID>`;
|
|
|
+ <PROBLEMS xmlns="` + BASE_URL + `/default_db">
|
|
|
+ <ID xmlns="` + BASE_WFS_URL + `/default_db">` + $(node).parents("li").data("id") + `</ID>`;
|
|
|
|
|
|
if (state[index]['percent'] != "100%") {
|
|
|
- req += '<A_PROBLEM_COMPLETE_PERCENT xmlns="' + BASE_URL + 'wfs/default_db/PROBLEMS">100%</A_PROBLEM_COMPLETE_PERCENT>';
|
|
|
+ req += '<A_PROBLEM_COMPLETE_PERCENT xmlns="' + BASE_WFS_URL + '/default_db/PROBLEMS">100%</A_PROBLEM_COMPLETE_PERCENT>';
|
|
|
state[index]['percent'] = "100%";
|
|
|
} else {
|
|
|
- req += '<A_PROBLEM_COMPLETE_PERCENT xmlns="' + BASE_URL + 'wfs/default_db/PROBLEMS">0%</A_PROBLEM_COMPLETE_PERCENT>';
|
|
|
+ req += '<A_PROBLEM_COMPLETE_PERCENT xmlns="' + BASE_WFS_URL + '/default_db/PROBLEMS">0%</A_PROBLEM_COMPLETE_PERCENT>';
|
|
|
state[index]['percent'] = "0%";
|
|
|
}
|
|
|
req += `</PROBLEMS>
|
|
|
@@ -727,7 +746,7 @@ function renderForm() {
|
|
|
field += '<div class="form-group">';
|
|
|
field += '<div class="col-xs-offset-0 col-xs-12 col-sm-offset-3 col-sm-9 col-md-offset-2 col-md-10">';
|
|
|
field += '</div></div>';
|
|
|
- field += '<a><button type="submit" class="btn btn-primary" id=save tabindex="20">Edytuj</button></a>';
|
|
|
+ field += '<a class="btn btn-primary" href="' + createLink("PROBLEMS", TASK) + '">Edytuj</a>';
|
|
|
$("#left").append(field);
|
|
|
$("#left").append("<div class=clearfix></div>");
|
|
|
createLink("PROBLEMS", TASK, $("#save").parents("a"));
|
|
|
@@ -748,7 +767,7 @@ function getData() {
|
|
|
link = BASE_URL + 'wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:PROBLEMS&SRSNAME=EPSG:3003&Filter=<ogc:Filter><ogc:And><ogc:PropertyIsEqualTo><ogc:PropertyName>PARENT_ID</ogc:PropertyName><ogc:Literal>' + TASK + '</ogc:Literal></ogc:PropertyIsEqualTo><ogc:Not><ogc:PropertyIsEqualTo><ogc:PropertyName>A_STATUS</ogc:PropertyName><ogc:Literal>Deleted</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Not></ogc:And></ogc:Filter>&sortBy=ID+D';//SORT_PRIO+A';
|
|
|
}
|
|
|
if (TYPE == "PROJECT") {
|
|
|
- link = BASE_URL + 'wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:PROBLEMS&SRSNAME=EPSG:3003&Filter=<ogc:Filter><ogc:And><ogc:PropertyIsEqualTo><ogc:PropertyName>ID_PROJECT</ogc:PropertyName><ogc:Literal>' + TASK + '</ogc:Literal></ogc:PropertyIsEqualTo><ogc:PropertyIsEqualTo><ogc:PropertyName>PARENT_ID</ogc:PropertyName><ogc:Literal>0</ogc:Literal></ogc:PropertyIsEqualTo><ogc:Not><ogc:PropertyIsEqualTo><ogc:PropertyName>A_STATUS</ogc:PropertyName><ogc:Literal>DELETED</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Not></ogc:And></ogc:Filter>&sortBy=SORT_PRIO+A';
|
|
|
+ link = BASE_URL + 'wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:PROBLEMS&SRSNAME=EPSG:3003&Filter=<ogc:Filter><ogc:And><ogc:PropertyIsEqualTo><ogc:PropertyName>ID_PROJECT</ogc:PropertyName><ogc:Literal>' + TASK + '</ogc:Literal></ogc:PropertyIsEqualTo><ogc:PropertyIsEqualTo><ogc:PropertyName>PARENT_ID</ogc:PropertyName><ogc:Literal>0</ogc:Literal></ogc:PropertyIsEqualTo><ogc:Not><ogc:PropertyIsEqualTo><ogc:PropertyName>A_STATUS</ogc:PropertyName><ogc:Literal>DELETED</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Not></ogc:And></ogc:Filter>&sortBy=ID+D';//SORT_PRIO+A
|
|
|
}
|
|
|
$.get(link, function(data) {
|
|
|
loaded = false;
|
|
|
@@ -760,8 +779,17 @@ function getData() {
|
|
|
}
|
|
|
var temp = {};
|
|
|
temp["id"] = $(this).find("ID").text();
|
|
|
+
|
|
|
temp["desc"] = $(this).find("A_PROBLEM_DESC").text();
|
|
|
temp["percent"] = $(this).find("A_PROBLEM_COMPLETE_PERCENT").text();
|
|
|
+ if(temp["percent"] === ""){
|
|
|
+ //console.log(temp);
|
|
|
+ $.notify("Błąd krytyczny. Brak uprawnień do komórki: `A_PROBLEM_COMPLETE_PERCENT` w tabeli `PROBLEMS`", "error");
|
|
|
+ loaded = true;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
temp["status"] = $(this).find("A_STATUS").text();
|
|
|
temp["worker"] = $(this).find("L_APPOITMENT_USER").text();
|
|
|
temp["period"] = $(this).find("L_APPOITMENT_PERIOD").text();
|
|
|
@@ -769,7 +797,8 @@ function getData() {
|
|
|
temp["childs"] = false;
|
|
|
var linkChilds = BASE_URL + "wfs-data.php/default_db/?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=p5_default_db:PROBLEMS&SRSNAME=EPSG:3003&Filter=<ogc:Filter><ogc:PropertyIsEqualTo><ogc:PropertyName>PARENT_ID</ogc:PropertyName><ogc:Literal>" + temp["id"] + "</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>";
|
|
|
$.get(linkChilds, function(data) {
|
|
|
- if ($(data).find("ID").text() != '0') {
|
|
|
+ //console.log(data);
|
|
|
+ if ($(data).find("ID").text() != '') {
|
|
|
temp["childs"] = true;
|
|
|
}
|
|
|
state.push(temp);
|
|
|
@@ -799,15 +828,15 @@ function render() {
|
|
|
if (e['status'] != "OFF_HARD") {
|
|
|
result += "<span class=aCheck></span>";
|
|
|
} else {
|
|
|
- result += "<span class=aCheck style=background-color:green;></span>";
|
|
|
+ result += "<span class=aCheck style=background-color:#2ecc71;></span>";
|
|
|
}
|
|
|
} else {
|
|
|
result += "<span class=check></span>";
|
|
|
}
|
|
|
result += "<input type=text "+(e["childs"] ? "DISABLED" : "")+" class='form-control hours' value='"+e["period"]+"' style=width:40px;float:left;padding:0px;height:25px;>"
|
|
|
- result += "<textarea " + (USER != e["owner"] || e['status'] == "OFF_HARD" ? "DISABLED" : "") + " class=editable>" + e['desc'] + "</textarea>";
|
|
|
+ result += "<textarea " + (USER != e["owner"] || e['status'] == "OFF_HARD" ? "DISABLED" : "") + ' class="editable" style="font-size:small">' + e['desc'] + "</textarea>";
|
|
|
result += `<div class="dropdown" style=display:inline;>
|
|
|
- <span class="glyphicon glyphicon glyphicon-menu-hamburger" data-toggle="dropdown"></span>
|
|
|
+ <span class="glyphicon glyphicon glyphicon-menu-hamburger" style="vertical-align: top;" data-toggle="dropdown"></span>
|
|
|
<ul class="dropdown-menu dropdown-menu-right">
|
|
|
<li><a href=` + BASE_URL + `index.php?_route=UrlAction_TaskManager&ID_PROBLEM=` + e['id'] + `>Szczegóły</a></li>
|
|
|
<li><p style="cursor:pointer;padding:3px 20px;" class=delTask>Usuń</p></li>
|
|
|
@@ -824,6 +853,7 @@ function render() {
|
|
|
resultDone += "<div class=clearfix></div>";
|
|
|
$("#sortable").html(resultActive);
|
|
|
$("#doneList").html(resultDone);
|
|
|
+ $('.editable').autosize();
|
|
|
}
|
|
|
|
|
|
function loadStats(){
|
|
|
@@ -856,7 +886,10 @@ function renderTaskManager() {
|
|
|
// $("#sortable").append("<li><span class='glyphicon glyphicon-option-vertical ico'></span><span class=check data-step=0></span> <div class=editable contentEditable='true'>Stworzyć tasklistę, dodać przesuwaunie i flagowanie</div></li>");
|
|
|
// $("#sortable").append("<li><span class='glyphicon glyphicon-option-vertical ico'></span><span class=check data-step=0></span> <div class=editable contentEditable='true'>Dodać po lewej stronie formularz</div></li>");
|
|
|
// $("#sortable").append("<li><span class='glyphicon glyphicon-option-vertical ico'></span><span class=check data-step=0></span> <div class=editable contentEditable='true'>Połączyć z API</div></li>");
|
|
|
- $(".taskList").append("<div id=add><span class='glyphicon glyphicon-plus addIco'></span> <textarea class=eInput id=datepicker placeholder='Dodaj zadanie'></textarea><div class=clearfix></div></div>");
|
|
|
+ $(".taskList").append('<div id="add" style="font-size:small">' +
|
|
|
+ '<span class="glyphicon glyphicon-plus addIco" style="padding-top:3px"></span> ' +
|
|
|
+ '<textarea class="eInput" style="font-size:small" id="datepicker" placeholder="Dodaj zadanie"></textarea>' +
|
|
|
+ '<div class="clearfix"></div>' + '</div>');
|
|
|
picker = $("<input/>", {
|
|
|
type: 'text',
|
|
|
style: 'width:0px;height:0px;outline:none;overflow:0;border:0;margin:0px;padding:0px;',
|
|
|
@@ -873,7 +906,7 @@ function renderTaskManager() {
|
|
|
$(".taskList").append("<div id=showMore >Pokaż wykonane zadania <span class='glyphicon glyphicon-chevron-down'></span></div>");
|
|
|
$(".taskList").append("<ul id='doneList'></ul>");
|
|
|
var link;
|
|
|
- $('.editable').autosize();
|
|
|
+
|
|
|
$("#doneList").hide();
|
|
|
updateProgress();
|
|
|
$(picker).on("dp.change", function(e) {
|