|
|
@ -52,14 +52,18 @@ gantt.attachEvent("onBeforeTaskUpdate", function(id,new_item){ |
|
|
|
progress = progress*100 |
|
|
|
progress = progress*100 |
|
|
|
} |
|
|
|
} |
|
|
|
progress = progress/100; |
|
|
|
progress = progress/100; |
|
|
|
|
|
|
|
let task = gantt.getTask(id); |
|
|
|
|
|
|
|
let link = task.$target; |
|
|
|
|
|
|
|
// link.length > 0 -> successor
|
|
|
|
new_item['progress'] = progress; |
|
|
|
new_item['progress'] = progress; |
|
|
|
new_item['end_date'].setHours(23,59,59); |
|
|
|
new_item['duration'] = new_item['duration'] + (link.length == 0 ? 1 : 1); |
|
|
|
new_item['duration'] = gantt.calculateDuration({ |
|
|
|
new_item['end_date'] = gantt.calculateEndDate({ |
|
|
|
start_date: new_item['start_date'], |
|
|
|
start_date: new_item['start_date'], |
|
|
|
end_date: new_item['end_date'] |
|
|
|
duration: new_item['duration'] |
|
|
|
}); |
|
|
|
}) |
|
|
|
|
|
|
|
new_item['end_date'].setHours(23,59,59); |
|
|
|
if (editDurationTriggered) { |
|
|
|
if (editDurationTriggered) { |
|
|
|
let tempDuration = new_item['duration'] - 1; |
|
|
|
let tempDuration = new_item['duration'] - (link.length == 0 ? 1 : 1); |
|
|
|
new_item['end_date'] = gantt.calculateEndDate({ |
|
|
|
new_item['end_date'] = gantt.calculateEndDate({ |
|
|
|
start_date: new_item['start_date'], |
|
|
|
start_date: new_item['start_date'], |
|
|
|
duration: tempDuration |
|
|
|
duration: tempDuration |
|
|
|