Browse Source

update header alert

pull/1/head
wahyun 9 months ago
parent
commit
385a508358
  1. 24
      edit-mode/function/ganttConfig.js

24
edit-mode/function/ganttConfig.js

@ -114,13 +114,13 @@ var colHeader = '<div class="gantt_grid_head_cell"><i style="margin-right:5px;"
colContent = function (task) { colContent = function (task) {
var hasChild = gantt.hasChild(task.id); var hasChild = gantt.hasChild(task.id);
var optionsContent = '<div class="align-left">'; var optionsContent = '<div class="align-left">';
optionsContent += '<i title="Add Activity" class="fa gantt_button_grid gantt_grid_add fa-plus icon-action f-blue-sky" onclick="clickGridButton(' + task.id + ', \'add\')"></i> '; optionsContent += '<i title="Add Activity ' + task.name + '" class="fa gantt_button_grid gantt_grid_add fa-plus icon-action f-blue-sky" onclick="clickGridButton(' + task.id + ', \'' + task.name + '\', \'add\')"></i> ';
optionsContent += '<i title="Delete Activity" class="fa gantt_button_grid gantt_grid_delete fa-times icon-action f-red" onclick="clickGridButton(' + task.id + ', \'delete\')"></i> '; optionsContent += '<i title="Delete Activity ' + task.name + '" class="fa gantt_button_grid gantt_grid_delete fa-times icon-action f-red" onclick="clickGridButton(' + task.id + ', \'' + task.name + '\', \'delete\')"></i> ';
optionsContent += '<i title="Set Baseline Activity" class="fa gantt_button_grid gantt_grid_delete fa-grip-lines icon-action f-blue-sky" onclick="clickGridButton(' + task.id + ', \'set-baseline-activity\')"></i> '; optionsContent += '<i title="Set Baseline Activity ' + task.name + '" class="fa gantt_button_grid gantt_grid_delete fa-grip-lines icon-action f-blue-sky" onclick="clickGridButton(' + task.id + ', \'' + task.name + '\', \'set-baseline-activity\')"></i> ';
optionsContent += '<i title="Add Milestone" class="fa gantt_button_grid gantt_grid_add fab fa-jira icon-action f-black" onclick="addMilestone(' + task.id + ')"></i> '; optionsContent += '<i title="Add Milestone ' + task.name + '" class="fa gantt_button_grid gantt_grid_add fab fa-jira icon-action f-black" onclick="addMilestone(' + task.id + ')"></i> ';
optionsContent += !hasChild ? '<i title="Upload Document" class="fa gantt_button_grid gantt_grid_delete fa-file icon-action f-orange" onclick="clickGridButton(' + task.id + ', \'upload\')"></i> ' : ''; optionsContent += !hasChild ? '<i title="Upload Document ' + task.name + '" class="fa gantt_button_grid gantt_grid_delete fa-file icon-action f-orange" onclick="clickGridButton(' + task.id + ', \'' + task.name + '\', \'upload\')"></i> ' : '';
optionsContent += !hasChild ? '<i title="Show Comments" class="fa gantt_button_grid gantt_grid_delete fa-comment icon-action f-black" onclick="clickGridButton(' + task.id + ', \'comment\')"></i> ' : ''; optionsContent += !hasChild ? '<i title="Show Comments ' + task.name + '" class="fa gantt_button_grid gantt_grid_delete fa-comment icon-action f-black" onclick="clickGridButton(' + task.id + ', \'' + task.name + '\', \'comment\')"></i> ' : '';
optionsContent += !hasChild ? '<i title="Activity Location" class="fa fas gantt_button_grid gantt_grid_delete fa-map-marked icon-action f-green" onclick="openActivityMap(' + task.id + ')"></i> ' : ''; optionsContent += !hasChild ? '<i title="Activity Location ' + task.name + '" class="fa fas gantt_button_grid gantt_grid_delete fa-map-marked icon-action f-green" onclick="openActivityMap(' + task.id + ')"></i> ' : '';
optionsContent += '</div>'; optionsContent += '</div>';
return (optionsContent); return (optionsContent);
}; };
@ -238,7 +238,7 @@ function addWithParent(id) {
no = no + 1; no = no + 1;
} }
function clickGridButton(id, action) { function clickGridButton(id, name, action) {
switch (action) { switch (action) {
case "edit": case "edit":
gantt.showLightbox(id); gantt.showLightbox(id);
@ -257,7 +257,7 @@ function clickGridButton(id, action) {
}); });
break; break;
case "set-baseline-activity": case "set-baseline-activity":
setBaselineActivity(id); setBaselineActivity(id, name);
break; break;
case "upload": case "upload":
showDocuments(id); showDocuments(id);
@ -347,10 +347,7 @@ var allColumns = [
{ {
name: "bobot_planning", label: "Bobot (%)", align: "center", editor: editor.bobot_planning, resize: true, min_width: 115, template: function (text) { name: "bobot_planning", label: "Bobot (%)", align: "center", editor: editor.bobot_planning, resize: true, min_width: 115, template: function (text) {
let bobot = parseFloat(text.bobot_planning); let bobot = parseFloat(text.bobot_planning);
console.log("bobot roundToTwo ", roundToTwo(bobot));
console.log("bobot toFixed ", bobot.toFixed(2));
if (bobot.toFixed(2) > 100) { if (bobot.toFixed(2) > 100) {
gantt.alert("Bobot tidak boleh lebih dari 100%!"); gantt.alert("Bobot tidak boleh lebih dari 100%!");
return; return;
} }
@ -512,9 +509,6 @@ var allColumns = [
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
console.log("progress roundToTwo ", roundToTwo(progress));
console.log("progress toFixed ", progress.toFixed(2));
if (progress.toFixed(2) > 100) { if (progress.toFixed(2) > 100) {
gantt.alert("Progress tidak boleh lebih dari 100%!"); gantt.alert("Progress tidak boleh lebih dari 100%!");
return; return;

Loading…
Cancel
Save