Browse Source

Merge pull request 'update disable function updatelinkslag' (#34) from dev-ibnu into staging

Reviewed-on: ordo/adw-gantt#34
pull/1/head
ibnu 1 year ago
parent
commit
b1bf4761ef
  1. 10
      edit-mode/function/function.js
  2. 4
      edit-mode/function/restActivityLink.js
  3. 2
      edit-mode/index.html

10
edit-mode/function/function.js

@ -719,22 +719,22 @@ function sendStorage(){
function updateLinksLag(data) {
data.data.forEach(task => {
data.links.forEach(link => {
if (link.target == task.id) {
if (link.target == task.id && task.actual_start != null) {
let predecessor = data.data.find(item => item.id == link.source);
if (predecessor) {
let lag;
if (isBaselineSet) {
switch (link.type) {
case "0":
case "0": // FS
lag = gantt.calculateDuration(new Date(predecessor.end_date), new Date(task.start_date));
break;
case "1":
case "1": // SS
lag = gantt.calculateDuration(new Date(predecessor.start_date), new Date(task.start_date));
break;
case "2":
case "2": // FF
lag = gantt.calculateDuration(new Date(predecessor.end_date), new Date(task.end_date));
break;
case "3":
case "3": // SF
lag = gantt.calculateDuration(new Date(predecessor.start_date), new Date(task.end_date));
break;
default:

4
edit-mode/function/restActivityLink.js

@ -38,7 +38,7 @@ gantt.ajax.get({
})
});
gantt.silent(function () {
updateLinksLag(data);
// updateLinksLag(data);
gantt.parse(data);
getGanttOpen();
gantt.parse(data);
@ -91,7 +91,7 @@ function refresData(id) {
})
});
gantt.silent(function () {
updateLinksLag(data);
// updateLinksLag(data);
gantt.parse(data);
getGanttOpen();
gantt.parse(data);

2
edit-mode/index.html

@ -383,7 +383,7 @@
<th scope="col">QTY</th>
<th scope="col">UOM</th>
<th scope="col">Price</th>
<th scope="col">Planning Date</th>
<th scope="col">Will Be Used At</th>
<th scope="col">Actions</th>
</tr>
</thead>

Loading…
Cancel
Save