|
|
@ -210,113 +210,113 @@ function createColumnsConfig(selectedColumns){ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var allColumns = [ |
|
|
|
var allColumns = [ |
|
|
|
{ name: "kode_sortname", label: "Kode / Sortname",align: "center", min_width: 120, resize: true }, |
|
|
|
// { name: "kode_sortname", label: "Kode / Sortname",align: "center", min_width: 120, resize: true },
|
|
|
|
{ name: "text", label: "Activity", tree: true, min_width: 150, resize: true }, |
|
|
|
{ name: "text", label: "Activity", tree: true, min_width: 150, resize: true }, |
|
|
|
{ name: "start_date", label: "Start Date", align: "center", min_width: 80, resize: true }, |
|
|
|
// { name: "start_date", label: "Start Date", align: "center", min_width: 80, resize: true },
|
|
|
|
{ name: "end_date", label: "Finish Date", align: "center", min_width: 80, resize: true }, |
|
|
|
// { name: "end_date", label: "Finish Date", align: "center", min_width: 80, resize: true },
|
|
|
|
{ name: "duration", label: "Duration", align: "center", min_width: 50, resize: true }, |
|
|
|
// { name: "duration", label: "Duration", align: "center", min_width: 50, resize: true },
|
|
|
|
{ name: "rencana_biaya", label: "Cost Planning", align: "center", min_width: 100, resize: true, template: function (text) { |
|
|
|
// { name: "rencana_biaya", label: "Cost Planning", align: "center", min_width: 100, resize: true, template: function (text) {
|
|
|
|
if(!text.rencana_biaya){ |
|
|
|
// if(!text.rencana_biaya){
|
|
|
|
return |
|
|
|
// return
|
|
|
|
} |
|
|
|
// }
|
|
|
|
let rencana_biaya = text.rencana_biaya |
|
|
|
// let rencana_biaya = text.rencana_biaya
|
|
|
|
return "Rp. "+ formatRupiah(rencana_biaya) |
|
|
|
// return "Rp. "+ formatRupiah(rencana_biaya)
|
|
|
|
} }, |
|
|
|
// } },
|
|
|
|
{ name: "cost_actual", label: "Cost Actual", align: "center", min_width: 100, template: function (text) { |
|
|
|
// { name: "cost_actual", label: "Cost Actual", align: "center", min_width: 100, template: function (text) {
|
|
|
|
if(!text.biaya_actual){ |
|
|
|
// if(!text.biaya_actual){
|
|
|
|
return |
|
|
|
// return
|
|
|
|
} |
|
|
|
// }
|
|
|
|
let biaya_actual = text.biaya_actual |
|
|
|
// let biaya_actual = text.biaya_actual
|
|
|
|
return "Rp. "+ formatRupiah(biaya_actual) |
|
|
|
// return "Rp. "+ formatRupiah(biaya_actual)
|
|
|
|
} }, |
|
|
|
// } },
|
|
|
|
{ name: "assign_hr", label: "Assign To", align: "center", min_width: 150, template: function (text) { |
|
|
|
// { name: "assign_hr", label: "Assign To", align: "center", min_width: 150, template: function (text) {
|
|
|
|
if(text.type=="project" || text.type=="milestone"){ |
|
|
|
// if(text.type=="project" || text.type=="milestone"){
|
|
|
|
return; |
|
|
|
// return;
|
|
|
|
} |
|
|
|
// }
|
|
|
|
let html = ``; |
|
|
|
// let html = ``;
|
|
|
|
var assign_hr = text.assign_hr |
|
|
|
// var assign_hr = text.assign_hr
|
|
|
|
if(!assign_hr || !assign_hr.length){ |
|
|
|
// if(!assign_hr || !assign_hr.length){
|
|
|
|
html = `<span class="badge badge-pill badge-danger">Unassigned</span>`; |
|
|
|
// html = `<span class="badge badge-pill badge-danger">Unassigned</span>`;
|
|
|
|
}else{ |
|
|
|
// }else{
|
|
|
|
if(assign_hr.length==1){ |
|
|
|
// if(assign_hr.length==1){
|
|
|
|
html = `<span class="text-capitalize badge badge-pill badge-primary">${assign_hr[0]}</span>`; |
|
|
|
// html = `<span class="text-capitalize badge badge-pill badge-primary">${assign_hr[0]}</span>`;
|
|
|
|
}else{ |
|
|
|
// }else{
|
|
|
|
assign_hr.forEach(function(val, index) { |
|
|
|
// assign_hr.forEach(function(val, index) {
|
|
|
|
html += `<span class="text-capitalize badge badge-primary mr-1">${val.substr(0, 1)}</span>`; |
|
|
|
// html += `<span class="text-capitalize badge badge-primary mr-1">${val.substr(0, 1)}</span>`;
|
|
|
|
}); |
|
|
|
// });
|
|
|
|
} |
|
|
|
// }
|
|
|
|
} |
|
|
|
// }
|
|
|
|
return `<div class="d-flex justify-content-center align-items-center" data-toggle="modal" data-target="#modal-hr" style="min-width:100%;height:100%;">
|
|
|
|
// return `<div class="d-flex justify-content-center align-items-center" data-toggle="modal" data-target="#modal-hr" style="min-width:100%;height:100%;">
|
|
|
|
${html} |
|
|
|
// ${html}
|
|
|
|
</div>` |
|
|
|
// </div>`
|
|
|
|
} |
|
|
|
// }
|
|
|
|
}, |
|
|
|
// },
|
|
|
|
{ name: "material", label: "Material", align: "center", min_width: 150, resize: true, template: function (text) { |
|
|
|
// { name: "material", label: "Material", align: "center", min_width: 150, resize: true, template: function (text) {
|
|
|
|
if(text.type=="project" || text.type=="milestone"){ |
|
|
|
// if(text.type=="project" || text.type=="milestone"){
|
|
|
|
return; |
|
|
|
// return;
|
|
|
|
} |
|
|
|
// }
|
|
|
|
let html = ``; |
|
|
|
// let html = ``;
|
|
|
|
var assign_material = text.assign_material |
|
|
|
// var assign_material = text.assign_material
|
|
|
|
|
|
|
|
|
|
|
|
if(!assign_material || !assign_material.length){ |
|
|
|
// if(!assign_material || !assign_material.length){
|
|
|
|
html = `<span class="badge badge-pill badge-danger">Unassigned</span>`; |
|
|
|
// html = `<span class="badge badge-pill badge-danger">Unassigned</span>`;
|
|
|
|
}else{ |
|
|
|
// }else{
|
|
|
|
if(assign_material.length > 0 ){ |
|
|
|
// if(assign_material.length > 0 ){
|
|
|
|
html = `<span class="text-capitalize badge badge-pill badge-primary">Assigned</span>`; |
|
|
|
// html = `<span class="text-capitalize badge badge-pill badge-primary">Assigned</span>`;
|
|
|
|
} |
|
|
|
// }
|
|
|
|
} |
|
|
|
// }
|
|
|
|
return `<div class="d-flex justify-content-center align-items-center" data-toggle="modal" data-target="#modal-material" style="min-width:100%;height:100%;">
|
|
|
|
// return `<div class="d-flex justify-content-center align-items-center" data-toggle="modal" data-target="#modal-material" style="min-width:100%;height:100%;">
|
|
|
|
${html} |
|
|
|
// ${html}
|
|
|
|
</div>` |
|
|
|
// </div>`
|
|
|
|
} }, |
|
|
|
// } },
|
|
|
|
{ name: "bobot_planning", label: "Bobot Activity (%)", align: "center", resize: true, min_width: 115, template: function (text) { |
|
|
|
// { name: "bobot_planning", label: "Bobot Activity (%)", align: "center", resize: true, min_width: 115, template: function (text) {
|
|
|
|
if(!text.bobot_planning){ |
|
|
|
// if(!text.bobot_planning){
|
|
|
|
return |
|
|
|
// return
|
|
|
|
} |
|
|
|
// }
|
|
|
|
let bobot_planning = parseFloat(text.bobot_planning); |
|
|
|
// let bobot_planning = parseFloat(text.bobot_planning);
|
|
|
|
return roundToTwo(bobot_planning); |
|
|
|
// return roundToTwo(bobot_planning);
|
|
|
|
} }, |
|
|
|
// } },
|
|
|
|
{ name: "progress", label: "Actual Progress (%)", align: "center", min_width: 125, template: function (text) { |
|
|
|
// { name: "progress", label: "Actual Progress (%)", align: "center", min_width: 125, template: function (text) {
|
|
|
|
let progress = text.progress |
|
|
|
// let progress = text.progress
|
|
|
|
progress = progress*100 |
|
|
|
// progress = progress*100
|
|
|
|
return progress; |
|
|
|
// return progress;
|
|
|
|
}, resize: true }, |
|
|
|
// }, resize: true },
|
|
|
|
{ name:"progress_actual", label: "Total Actual Progress (%)", align: "center", min_width: 150, template: function (text) { |
|
|
|
// { name:"progress_actual", label: "Total Actual Progress (%)", align: "center", min_width: 150, template: function (text) {
|
|
|
|
let progress = text.progress |
|
|
|
// let progress = text.progress
|
|
|
|
progress = progress*100 |
|
|
|
// progress = progress*100
|
|
|
|
let bobot = text.bobot_planning |
|
|
|
// let bobot = text.bobot_planning
|
|
|
|
let actual = (progress*bobot) / 100 |
|
|
|
// let actual = (progress*bobot) / 100
|
|
|
|
return roundToTwo(actual); |
|
|
|
// return roundToTwo(actual);
|
|
|
|
}, resize: true }, |
|
|
|
// }, resize: true },
|
|
|
|
{ name: "jumlah_pekerjaan", label: "Volume Plan", align: "center", min_width: 100, resize: true}, |
|
|
|
// { name: "jumlah_pekerjaan", label: "Volume Plan", align: "center", min_width: 100, resize: true},
|
|
|
|
{ name: "jobs_done", label: "Volume Actual", align: "center", min_width: 100, resize: true, template: function (text) { |
|
|
|
// { name: "jobs_done", label: "Volume Actual", align: "center", min_width: 100, resize: true, template: function (text) {
|
|
|
|
if(text.type=="project" || text.type=="milestone"){ |
|
|
|
// if(text.type=="project" || text.type=="milestone"){
|
|
|
|
return; |
|
|
|
// return;
|
|
|
|
} |
|
|
|
// }
|
|
|
|
let html = text.jobs_done ? text.jobs_done : 0; |
|
|
|
// let html = text.jobs_done ? text.jobs_done : 0;
|
|
|
|
return `<div class="d-flex justify-content-center align-items-center" data-toggle="modal" data-target="#modal_report_activity" style="min-width:100%;height:100%;">
|
|
|
|
// return `<div class="d-flex justify-content-center align-items-center" data-toggle="modal" data-target="#modal_report_activity" style="min-width:100%;height:100%;">
|
|
|
|
${html} |
|
|
|
// ${html}
|
|
|
|
</div>` |
|
|
|
// </div>`
|
|
|
|
} }, |
|
|
|
// } },
|
|
|
|
{ name: "updated_by", label: "Last Updated By", align: "center", min_width: 100, resize: true } |
|
|
|
// { name: "updated_by", label: "Last Updated By", align: "center", min_width: 100, resize: true }
|
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
gantt.config.columns = createColumnsConfig({ |
|
|
|
gantt.config.columns = createColumnsConfig({ |
|
|
|
kode_sortname: true, |
|
|
|
kode_sortname: false, |
|
|
|
text: true, |
|
|
|
text: true, |
|
|
|
start_date: true, |
|
|
|
start_date: false, |
|
|
|
end_date: true, |
|
|
|
end_date: false, |
|
|
|
duration: true, |
|
|
|
duration: false, |
|
|
|
rencana_biaya: true, |
|
|
|
rencana_biaya: false, |
|
|
|
cost_actual: true, |
|
|
|
cost_actual: false, |
|
|
|
assign_hr: true, |
|
|
|
assign_hr: false, |
|
|
|
material: true, |
|
|
|
material: false, |
|
|
|
bobot_planning: true, |
|
|
|
bobot_planning: false, |
|
|
|
progress: true, |
|
|
|
progress: false, |
|
|
|
progress_actual: true, |
|
|
|
progress_actual: false, |
|
|
|
jumlah_pekerjaan: true, |
|
|
|
jumlah_pekerjaan: false, |
|
|
|
jobs_done:true, |
|
|
|
jobs_done: false, |
|
|
|
updated_by: true |
|
|
|
updated_by: false |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
gantt.config.reorder_grid_columns = true; |
|
|
|
gantt.config.reorder_grid_columns = true; |
|
|
@ -450,19 +450,11 @@ var zoomConfig = { |
|
|
|
scale_height: 50, |
|
|
|
scale_height: 50, |
|
|
|
min_column_width:50, |
|
|
|
min_column_width:50, |
|
|
|
scales:[ |
|
|
|
scales:[ |
|
|
|
// {unit: "week", step: 1, format: function (date) {
|
|
|
|
|
|
|
|
// var dateToStr = gantt.date.date_to_str("%d %M");
|
|
|
|
|
|
|
|
// var endDate = gantt.date.add(date, -6, "day");
|
|
|
|
|
|
|
|
// var weekNum = gantt.date.date_to_str("%W")(date);
|
|
|
|
|
|
|
|
// var year = gantt.date.date_to_str("%Y")(date);
|
|
|
|
|
|
|
|
// return "#" + weekNum + ", " + dateToStr(date) + " - " + dateToStr(endDate) + " " + year;
|
|
|
|
|
|
|
|
// }},
|
|
|
|
|
|
|
|
{unit: "week", step: 1, format: function (date) { |
|
|
|
{unit: "week", step: 1, format: function (date) { |
|
|
|
var weekNum = gantt.date.date_to_str("%W")(date); |
|
|
|
var weekNum = gantt.date.date_to_str("%W")(date); |
|
|
|
return "W#" + weekNum; |
|
|
|
return "W#" + weekNum; |
|
|
|
}}, |
|
|
|
}}, |
|
|
|
{unit: "month", format: "%F, %Y"}, |
|
|
|
{unit: "month", format: "%F, %Y"}, |
|
|
|
// {unit: "day", step: 1, format: "%j %D"}
|
|
|
|
|
|
|
|
] |
|
|
|
] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
@ -471,42 +463,12 @@ var zoomConfig = { |
|
|
|
min_column_width:120, |
|
|
|
min_column_width:120, |
|
|
|
scales:[ |
|
|
|
scales:[ |
|
|
|
{unit: "month", format: "%F, %Y"}, |
|
|
|
{unit: "month", format: "%F, %Y"}, |
|
|
|
// {unit: "week", format: "Week #%W"},
|
|
|
|
|
|
|
|
// {unit: "day", step: 1, format: "%j %D"}
|
|
|
|
|
|
|
|
] |
|
|
|
] |
|
|
|
}, |
|
|
|
}, |
|
|
|
// {
|
|
|
|
|
|
|
|
// name:"quarter",
|
|
|
|
|
|
|
|
// height: 50,
|
|
|
|
|
|
|
|
// min_column_width:90,
|
|
|
|
|
|
|
|
// scales:[
|
|
|
|
|
|
|
|
// {unit: "month", step: 1, format: "%M"},
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// unit: "quarter", step: 1, format: function (date) {
|
|
|
|
|
|
|
|
// var dateToStr = gantt.date.date_to_str("%M");
|
|
|
|
|
|
|
|
// var endDate = gantt.date.add(gantt.date.add(date, 3, "month"), -1, "day");
|
|
|
|
|
|
|
|
// return dateToStr(date) + " - " + dateToStr(endDate);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// ]
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// name:"year",
|
|
|
|
|
|
|
|
// scale_height: 50,
|
|
|
|
|
|
|
|
// min_column_width: 30,
|
|
|
|
|
|
|
|
// scales:[
|
|
|
|
|
|
|
|
// {unit: "year", step: 1, format: "%Y"}
|
|
|
|
|
|
|
|
// ]
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
] |
|
|
|
] |
|
|
|
}; |
|
|
|
}; |
|
|
|
gantt.ext.zoom.init(zoomConfig); |
|
|
|
gantt.ext.zoom.init(zoomConfig); |
|
|
|
gantt.ext.zoom.setLevel("month"); |
|
|
|
gantt.ext.zoom.setLevel("week"); |
|
|
|
|
|
|
|
|
|
|
|
// trigger when zoomIn and zoomOut clicked
|
|
|
|
|
|
|
|
gantt.ext.zoom.attachEvent("onAfterZoom", function(level, config){ |
|
|
|
|
|
|
|
document.querySelector(".gantt_radio[value='" +config.name+ "']").checked = true; |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function zoomIn(){ |
|
|
|
function zoomIn(){ |
|
|
|
gantt.ext.zoom.zoomIn(); |
|
|
|
gantt.ext.zoom.zoomIn(); |
|
|
|