|
|
|
@ -15,23 +15,22 @@ function getUrlParameter(sParam) {
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const formatNumber = (angka) => { |
|
|
|
|
var number_string = angka.replace(/[^,\d]/g, '').toString(), |
|
|
|
|
split = number_string.split(','), |
|
|
|
|
sisa = split[0].length % 3, |
|
|
|
|
rupiah = split[0].substr(0, sisa), |
|
|
|
|
ribuan = split[0].substr(sisa).match(/\d{3}/gi); |
|
|
|
|
var separator = ""; |
|
|
|
|
if(ribuan){ |
|
|
|
|
separator = sisa ? '.' : ''; |
|
|
|
|
rupiah += separator + ribuan.join('.'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
rupiah = split[1] != undefined ? rupiah + ',' + split[1] : rupiah; |
|
|
|
|
return rupiah |
|
|
|
|
var number_string = angka.replace(/[^,\d]/g, '').toString(), |
|
|
|
|
split = number_string.split(','), |
|
|
|
|
sisa = split[0].length % 3, |
|
|
|
|
rupiah = split[0].substr(0, sisa), |
|
|
|
|
ribuan = split[0].substr(sisa).match(/\d{3}/gi); |
|
|
|
|
var separator = ""; |
|
|
|
|
if (ribuan) { |
|
|
|
|
separator = sisa ? '.' : ''; |
|
|
|
|
rupiah += separator + ribuan.join('.'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
rupiah = split[1] != undefined ? rupiah + ',' + split[1] : rupiah; |
|
|
|
|
return rupiah |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function getCodeLinkByType(type) |
|
|
|
|
{ |
|
|
|
|
function getCodeLinkByType(type) { |
|
|
|
|
type = parseInt(type); |
|
|
|
|
switch (type) { |
|
|
|
|
case 1: |
|
|
|
@ -49,7 +48,7 @@ function getCodeLinkByType(type)
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var getInput = function(node){ |
|
|
|
|
var getInput = function (node) { |
|
|
|
|
return node.querySelector("input"); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -103,7 +102,7 @@ gantt.config.editor_types.progressCustom = {
|
|
|
|
|
hide: function () { |
|
|
|
|
}, |
|
|
|
|
set_value: function (value, id, column, node) { |
|
|
|
|
value = value*100 |
|
|
|
|
value = value * 100 |
|
|
|
|
getInput(node).value = value; |
|
|
|
|
}, |
|
|
|
|
get_value: function (id, column, node) { |
|
|
|
@ -131,12 +130,12 @@ gantt.config.editor_types.progressCustom = {
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
function initializationProject(){ |
|
|
|
|
function initializationProject() { |
|
|
|
|
let projectId = getUrlParameter("proyek_id"); |
|
|
|
|
if(projectId && projectId > 0){ |
|
|
|
|
if (projectId && projectId > 0) { |
|
|
|
|
$.ajax({ |
|
|
|
|
url: `${base_url}project/edit/${projectId}`, |
|
|
|
|
type:"GET", |
|
|
|
|
type: "GET", |
|
|
|
|
success: function (result) { |
|
|
|
|
let data = result.data; |
|
|
|
|
let projectName = data.nama; |
|
|
|
@ -148,18 +147,18 @@ function initializationProject(){
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function getSatuan(){ |
|
|
|
|
function getSatuan() { |
|
|
|
|
$.ajax({ |
|
|
|
|
url: `${base_url}satuan/list`, |
|
|
|
|
type:"GET", |
|
|
|
|
type: "GET", |
|
|
|
|
success: function (result) { |
|
|
|
|
let satuanList = []; |
|
|
|
|
let resSatuan = result.data || [] |
|
|
|
|
resSatuan.map((val, index) => { |
|
|
|
|
let satuan = { |
|
|
|
|
key:val.id, |
|
|
|
|
label:val.name, |
|
|
|
|
text:val.name |
|
|
|
|
key: val.id, |
|
|
|
|
label: val.name, |
|
|
|
|
text: val.name |
|
|
|
|
} |
|
|
|
|
satuanList.push(satuan) |
|
|
|
|
}); |
|
|
|
@ -192,7 +191,7 @@ function getSatuan(){
|
|
|
|
|
allowClear: true |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if(satuanList.length > 0){ |
|
|
|
|
if (satuanList.length > 0) { |
|
|
|
|
gantt.updateCollection("satuan", satuanList); |
|
|
|
|
gantt.refreshData(); |
|
|
|
|
gantt.render(); |
|
|
|
@ -204,11 +203,10 @@ function getSatuan(){
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function updateActivity(id) |
|
|
|
|
{ |
|
|
|
|
function updateActivity(id) { |
|
|
|
|
$.ajax({ |
|
|
|
|
url: `${base_url}task/get-update/${id}`, |
|
|
|
|
type:"GET", |
|
|
|
|
type: "GET", |
|
|
|
|
success: function (result) { |
|
|
|
|
let data = result.data; |
|
|
|
|
gantt.getTask(id).assign_hr = data.assign_hr; |
|
|
|
@ -230,18 +228,17 @@ function updateActivity(id)
|
|
|
|
|
|
|
|
|
|
/* Fungsi format ribuan label*/ |
|
|
|
|
function formatRupiah(n) { |
|
|
|
|
var parts=n.toString().split("."); |
|
|
|
|
var parts = n.toString().split("."); |
|
|
|
|
return parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ".") + (parts[1] ? "," + parts[1] : ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Fungsi format ribuan inputan*/ |
|
|
|
|
function formatRibuanInput(angka, prefix) |
|
|
|
|
{ |
|
|
|
|
function formatRibuanInput(angka, prefix) { |
|
|
|
|
var number_string = angka.replace(/[^,\d]/g, '').toString(), |
|
|
|
|
split = number_string.split(','), |
|
|
|
|
sisa = split[0].length % 3, |
|
|
|
|
rupiah = split[0].substr(0, sisa), |
|
|
|
|
ribuan = split[0].substr(sisa).match(/\d{3}/gi); |
|
|
|
|
split = number_string.split(','), |
|
|
|
|
sisa = split[0].length % 3, |
|
|
|
|
rupiah = split[0].substr(0, sisa), |
|
|
|
|
ribuan = split[0].substr(sisa).match(/\d{3}/gi); |
|
|
|
|
|
|
|
|
|
if (ribuan) { |
|
|
|
|
separator = sisa ? '.' : ''; |
|
|
|
@ -253,13 +250,13 @@ function formatRibuanInput(angka, prefix)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Fungsi replace titik, untuk save ke DB*/ |
|
|
|
|
function formatReplaceTitikRibuan(param){ |
|
|
|
|
function formatReplaceTitikRibuan(param) { |
|
|
|
|
let myStr = param; |
|
|
|
|
let newStr = myStr.replace(/\./g, ''); |
|
|
|
|
return newStr; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function formatDate(params){ |
|
|
|
|
function formatDate(params) { |
|
|
|
|
let today = new Date(params); |
|
|
|
|
let yyyy = today.getFullYear(); |
|
|
|
|
let mm = today.getMonth() + 1; // Months start at 0!
|
|
|
|
@ -273,55 +270,54 @@ function formatDate(params){
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function roundToTwo(num) { |
|
|
|
|
return +(Math.round(num + "e+2") + "e-2"); |
|
|
|
|
return +(Math.round(num + "e+2") + "e-2"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function initialProperty() |
|
|
|
|
{ |
|
|
|
|
function initialProperty() { |
|
|
|
|
$.ajax({ |
|
|
|
|
url: `${base_url}user-to-version-gantt/get-by-gantt/${ganttId}`, |
|
|
|
|
type:"GET", |
|
|
|
|
type: "GET", |
|
|
|
|
success: function (result) { |
|
|
|
|
let data = result.data; |
|
|
|
|
if(data.status && data.status=="not have"){ |
|
|
|
|
if (data.status && data.status == "not have") { |
|
|
|
|
toggleCollapseTasks(); |
|
|
|
|
}else{ |
|
|
|
|
if(data.id){ |
|
|
|
|
} else { |
|
|
|
|
if (data.id) { |
|
|
|
|
userToVersionGanttId = data.id |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(data.critical_path){ |
|
|
|
|
if (data.critical_path) { |
|
|
|
|
gantt.config.highlight_critical_path = true; |
|
|
|
|
$("#critalPathBox").prop("checked", true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(data.auto_schedule){ |
|
|
|
|
if (data.auto_schedule) { |
|
|
|
|
gantt.config.auto_schedule = true; |
|
|
|
|
$("#autoSchedule").prop("checked", true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(data.committed_cost){ |
|
|
|
|
$("#committedCostBox").val(data.committed_cost); |
|
|
|
|
} |
|
|
|
|
if (data.committed_cost) { |
|
|
|
|
$("#committedCostBox").val(data.committed_cost); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(data.cost_to_complete){ |
|
|
|
|
$("#costToCompleteBox").val(data.cost_to_complete); |
|
|
|
|
} |
|
|
|
|
if (data.cost_to_complete) { |
|
|
|
|
$("#costToCompleteBox").val(data.cost_to_complete); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(data.zoom){ |
|
|
|
|
if (data.zoom) { |
|
|
|
|
gantt.ext.zoom.setLevel(data.zoom); |
|
|
|
|
$('input[value="'+data.zoom+'"]').prop("checked", true); |
|
|
|
|
$('input[value="' + data.zoom + '"]').prop("checked", true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(data.task_open){ |
|
|
|
|
gantt.eachTask(function(task){ |
|
|
|
|
if (data.task_open) { |
|
|
|
|
gantt.eachTask(function (task) { |
|
|
|
|
task.$open = true; |
|
|
|
|
}); |
|
|
|
|
toggleTasks = "Collapse"; |
|
|
|
|
$("#gantt_toggle_task_btn").prop('title', 'Collapse Activities'); |
|
|
|
|
$("#gantt_toggle_task_btn").children().removeClass('fa-expand-alt'); |
|
|
|
|
$("#gantt_toggle_task_btn").children().addClass('fa-compress-alt'); |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
toggleCollapseTasks(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -334,18 +330,17 @@ function initialProperty()
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function initializationColumn() |
|
|
|
|
{ |
|
|
|
|
function initializationColumn() { |
|
|
|
|
$.ajax({ |
|
|
|
|
url: `${base_url}gantt-show-hide/get-by-gantt/${ganttId}`, |
|
|
|
|
type:"GET", |
|
|
|
|
type: "GET", |
|
|
|
|
success: function (result) { |
|
|
|
|
let data = result.data; |
|
|
|
|
if(data.status=="not yet have"){ |
|
|
|
|
if (data.status == "not yet have") { |
|
|
|
|
addShowHideColumn(); |
|
|
|
|
}else if(data.status=="not have access"){ |
|
|
|
|
} else if (data.status == "not have access") { |
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
setUpForShowHideColumn(data); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -355,8 +350,8 @@ function initializationColumn()
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function setGanttOpen(){ |
|
|
|
|
let ganttOpen = []; |
|
|
|
|
function setGanttOpen() { |
|
|
|
|
let ganttOpen = []; |
|
|
|
|
gantt.eachTask(function (task) { |
|
|
|
|
const existingIndex = ganttOpen.findIndex(item => item.id === task.id); |
|
|
|
|
if (existingIndex !== -1) { |
|
|
|
@ -371,73 +366,73 @@ function setGanttOpen(){
|
|
|
|
|
localStorage.setItem('ganttOpen', JSON.stringify(ganttOpen)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function getGanttOpen(){ |
|
|
|
|
let ganttOpen = localStorage.getItem('ganttOpen'); |
|
|
|
|
if (ganttOpen) { |
|
|
|
|
// Parse the stored data into a JavaScript object
|
|
|
|
|
ganttOpen = JSON.parse(ganttOpen); |
|
|
|
|
gantt.eachTask(function (task) { |
|
|
|
|
const index = ganttOpen.findIndex(item => item.id == task.id); |
|
|
|
|
if (index !== -1) { |
|
|
|
|
task.$open = ganttOpen[index].open; |
|
|
|
|
} else { |
|
|
|
|
task.$open = false;
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
function getGanttOpen() { |
|
|
|
|
let ganttOpen = localStorage.getItem('ganttOpen'); |
|
|
|
|
if (ganttOpen) { |
|
|
|
|
// Parse the stored data into a JavaScript object
|
|
|
|
|
ganttOpen = JSON.parse(ganttOpen); |
|
|
|
|
gantt.eachTask(function (task) { |
|
|
|
|
const index = ganttOpen.findIndex(item => item.id == task.id); |
|
|
|
|
if (index !== -1) { |
|
|
|
|
task.$open = ganttOpen[index].open; |
|
|
|
|
} else { |
|
|
|
|
task.$open = false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$(document).ready(function () { |
|
|
|
|
$("#critalPathBox").on("change", function (){ |
|
|
|
|
$("#critalPathBox").on("change", function () { |
|
|
|
|
let checked = $(this).is(":checked"); |
|
|
|
|
if(checked){ |
|
|
|
|
if (checked) { |
|
|
|
|
gantt.config.highlight_critical_path = true; |
|
|
|
|
updateProperty({critical_path:true}) |
|
|
|
|
}else{ |
|
|
|
|
updateProperty({ critical_path: true }) |
|
|
|
|
} else { |
|
|
|
|
gantt.config.highlight_critical_path = false; |
|
|
|
|
updateProperty({critical_path:false}) |
|
|
|
|
updateProperty({ critical_path: false }) |
|
|
|
|
} |
|
|
|
|
gantt.render(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$("#autoSchedule").on("change", function (){ |
|
|
|
|
$("#autoSchedule").on("change", function () { |
|
|
|
|
let checked = $(this).is(":checked"); |
|
|
|
|
if(checked){ |
|
|
|
|
if (checked) { |
|
|
|
|
gantt.config.auto_schedule = true; |
|
|
|
|
updateProperty({auto_schedule:true}) |
|
|
|
|
}else{ |
|
|
|
|
updateProperty({ auto_schedule: true }) |
|
|
|
|
} else { |
|
|
|
|
gantt.config.auto_schedule = false; |
|
|
|
|
updateProperty({auto_schedule:false}) |
|
|
|
|
updateProperty({ auto_schedule: false }) |
|
|
|
|
} |
|
|
|
|
gantt.render(); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
function linkLagEditor(){ |
|
|
|
|
function linkLagEditor() { |
|
|
|
|
|
|
|
|
|
function endPopup(){ |
|
|
|
|
function endPopup() { |
|
|
|
|
modal = null; |
|
|
|
|
editLinkId = null; |
|
|
|
|
} |
|
|
|
|
function cancelEditLink(){ |
|
|
|
|
function cancelEditLink() { |
|
|
|
|
endPopup() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function deleteLink(){ |
|
|
|
|
function deleteLink() { |
|
|
|
|
gantt.deleteLink(editLinkId); |
|
|
|
|
endPopup() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function saveLink(){ |
|
|
|
|
function saveLink() { |
|
|
|
|
var link = gantt.getLink(editLinkId); |
|
|
|
|
|
|
|
|
|
var lagValue = modal.querySelector(".lag-input").value; |
|
|
|
|
if(!isNaN(parseInt(lagValue, 10))){ |
|
|
|
|
if (!isNaN(parseInt(lagValue, 10))) { |
|
|
|
|
link.lag = parseInt(lagValue, 10); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
gantt.updateLink(link.id); |
|
|
|
|
if(gantt.autoSchedule){ |
|
|
|
|
if (gantt.autoSchedule) { |
|
|
|
|
gantt.autoSchedule(link.source); |
|
|
|
|
} |
|
|
|
|
endPopup(); |
|
|
|
@ -447,11 +442,11 @@ function linkLagEditor(){
|
|
|
|
|
|
|
|
|
|
var modal; |
|
|
|
|
var editLinkId; |
|
|
|
|
gantt.attachEvent("onLinkDblClick", function(id,e){ |
|
|
|
|
gantt.attachEvent("onLinkDblClick", function (id, e) { |
|
|
|
|
editLinkId = id; |
|
|
|
|
var link = gantt.getLink(id); |
|
|
|
|
var linkTitle; |
|
|
|
|
switch(link.type){ |
|
|
|
|
switch (link.type) { |
|
|
|
|
case gantt.config.links.finish_to_start: |
|
|
|
|
linkTitle = "FS"; |
|
|
|
|
break; |
|
|
|
@ -471,17 +466,17 @@ function linkLagEditor(){
|
|
|
|
|
modal = gantt.modalbox({ |
|
|
|
|
title: linkTitle, |
|
|
|
|
text: "<div>" + |
|
|
|
|
"<label>Lag <input type='number' class='lag-input' /></label>" + |
|
|
|
|
"</div>", |
|
|
|
|
"<label>Lag <input type='number' class='lag-input' /></label>" + |
|
|
|
|
"</div>", |
|
|
|
|
buttons: [ |
|
|
|
|
{label:"Save", css:"link-save-btn", value:"save"}, |
|
|
|
|
{label:"Cancel", css:"link-cancel-btn", value:"cancel"}, |
|
|
|
|
{label:"Delete", css:"link-delete-btn", value:"delete"} |
|
|
|
|
{ label: "Save", css: "link-save-btn", value: "save" }, |
|
|
|
|
{ label: "Cancel", css: "link-cancel-btn", value: "cancel" }, |
|
|
|
|
{ label: "Delete", css: "link-delete-btn", value: "delete" } |
|
|
|
|
], |
|
|
|
|
width: "500px", |
|
|
|
|
type: "popup-css-class-here", |
|
|
|
|
callback: function(result){ |
|
|
|
|
switch(result){ |
|
|
|
|
callback: function (result) { |
|
|
|
|
switch (result) { |
|
|
|
|
case "save": |
|
|
|
|
saveLink(); |
|
|
|
|
break; |
|
|
|
@ -504,24 +499,22 @@ function linkLagEditor(){
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function addShowHideColumn() |
|
|
|
|
{ |
|
|
|
|
function addShowHideColumn() { |
|
|
|
|
let allColumn = []; |
|
|
|
|
allColumns.forEach(function(column){ |
|
|
|
|
allColumns.forEach(function (column) { |
|
|
|
|
allColumn.push(column.name); |
|
|
|
|
}); |
|
|
|
|
submitShowHideColumn(allColumn); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function submitShowHideColumn(allColumn) |
|
|
|
|
{ |
|
|
|
|
function submitShowHideColumn(allColumn) { |
|
|
|
|
let payload = { |
|
|
|
|
version_gantt_id:ganttId, |
|
|
|
|
columns:allColumn |
|
|
|
|
version_gantt_id: ganttId, |
|
|
|
|
columns: allColumn |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
data: JSON.stringify(payload), |
|
|
|
|
data: JSON.stringify(payload), |
|
|
|
|
url: `${base_url}gantt-show-hide/add`, |
|
|
|
|
type: "POST", |
|
|
|
|
processData: false, |
|
|
|
@ -535,8 +528,7 @@ function submitShowHideColumn(allColumn)
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function setUpForShowHideColumn(data) |
|
|
|
|
{ |
|
|
|
|
function setUpForShowHideColumn(data) { |
|
|
|
|
let columns = data || [] |
|
|
|
|
|
|
|
|
|
let configColumn = {} |
|
|
|
@ -550,14 +542,13 @@ function setUpForShowHideColumn(data)
|
|
|
|
|
gantt.render(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function updateShowHideColumn(data) |
|
|
|
|
{ |
|
|
|
|
function updateShowHideColumn(data) { |
|
|
|
|
let payload = { |
|
|
|
|
columns:data |
|
|
|
|
columns: data |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
data: JSON.stringify(payload), |
|
|
|
|
data: JSON.stringify(payload), |
|
|
|
|
url: `${base_url}gantt-show-hide/update/${ganttId}`, |
|
|
|
|
type: "POST", |
|
|
|
|
processData: false, |
|
|
|
@ -582,7 +573,7 @@ function colAjaxReq(type) {
|
|
|
|
|
isFound = ganttColumnsByType.find(obj => { |
|
|
|
|
return obj.column_name == val.name; |
|
|
|
|
}); |
|
|
|
|
if(isFound) |
|
|
|
|
if (isFound) |
|
|
|
|
return val; |
|
|
|
|
}); |
|
|
|
|
gantt.config.columns = x.filter(item => item); |
|
|
|
@ -592,14 +583,14 @@ function colAjaxReq(type) {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async function reRenderColumns(type){ |
|
|
|
|
async function reRenderColumns(type) { |
|
|
|
|
await colAjaxReq(type); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function updateProperty(payload){ |
|
|
|
|
if(userToVersionGanttId > 0 && readOnly && parseInt(readOnly)==0){ |
|
|
|
|
function updateProperty(payload) { |
|
|
|
|
if (userToVersionGanttId > 0 && readOnly && parseInt(readOnly) == 0) { |
|
|
|
|
$.ajax({ |
|
|
|
|
data: JSON.stringify(payload), |
|
|
|
|
data: JSON.stringify(payload), |
|
|
|
|
url: `${base_url}user-to-version-gantt/update/${userToVersionGanttId}`, |
|
|
|
|
type: "PUT", |
|
|
|
|
processData: false, |
|
|
|
@ -612,7 +603,7 @@ function updateProperty(payload){
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function costPlanningChange(e){ |
|
|
|
|
function costPlanningChange(e) { |
|
|
|
|
let value = e.value; |
|
|
|
|
value = replaceAll(value, ".", "") |
|
|
|
|
value = replaceAll(value, ",", ".") |
|
|
|
@ -625,18 +616,18 @@ function escapeRegExp(string) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function replaceAll(str, find, replace) { |
|
|
|
|
if(str){ |
|
|
|
|
if (str) { |
|
|
|
|
return str.replace(new RegExp(escapeRegExp(find), 'g'), replace); |
|
|
|
|
} |
|
|
|
|
return str |
|
|
|
|
} |
|
|
|
|
function expandTask(){ |
|
|
|
|
gantt.eachTask(function(task){ |
|
|
|
|
task.$open = true; |
|
|
|
|
}); |
|
|
|
|
toggleTasks = "Collapse"; |
|
|
|
|
$("#gantt_toggle_task_btn").prop('title', 'Collapse Activities'); |
|
|
|
|
$("#gantt_toggle_task_btn").children().removeClass('fa-expand-alt'); |
|
|
|
|
$("#gantt_toggle_task_btn").children().addClass('fa-compress-alt'); |
|
|
|
|
gantt.render(); |
|
|
|
|
function expandTask() { |
|
|
|
|
gantt.eachTask(function (task) { |
|
|
|
|
task.$open = true; |
|
|
|
|
}); |
|
|
|
|
toggleTasks = "Collapse"; |
|
|
|
|
$("#gantt_toggle_task_btn").prop('title', 'Collapse Activities'); |
|
|
|
|
$("#gantt_toggle_task_btn").children().removeClass('fa-expand-alt'); |
|
|
|
|
$("#gantt_toggle_task_btn").children().addClass('fa-compress-alt'); |
|
|
|
|
gantt.render(); |
|
|
|
|
} |
|
|
|
|