Browse Source

Merge pull request 'staging' (#31) from staging into master

Reviewed-on: ordo/adw-gantt#31
pull/1/head
ibnu 1 year ago
parent
commit
bf0665dacc
  1. 10
      edit-mode/function/expenseResource.js
  2. 29
      edit-mode/function/function.js
  3. 18
      edit-mode/function/materialResource.js
  4. 10
      edit-mode/function/reportActivity.js

10
edit-mode/function/expenseResource.js

@ -131,7 +131,15 @@ $(document).ready(function () {
cache: false cache: false
} }
}); });
// $('#required-date-req-expense').datepicker({
// format: 'dd-mm-yyyy', // Set the desired format
// autoclose: true // Close the datepicker when a date is selected
// });
//
// $('#required-date-plan-expense').datepicker({
// format: 'dd-mm-yyyy', // Set the desired format
// autoclose: true // Close the datepicker when a date is selected
// });
$("#form-assign-expense").on('submit', function (e) { $("#form-assign-expense").on('submit', function (e) {
e.preventDefault(); e.preventDefault();

29
edit-mode/function/function.js

@ -539,10 +539,10 @@ function setUpForShowHideColumn(data) {
configColumn[val.column_name] = val.show configColumn[val.column_name] = val.show
}); });
if (!isBaselineSet) { if (!isBaselineSet) {
configColumn.planned_start = undefined; // configColumn.planned_start = undefined;
configColumn.planned_end = undefined; // configColumn.planned_end = undefined;
configColumn.planned_duration = undefined; // configColumn.planned_duration = undefined;
configColumn.baseline_progress = undefined; // configColumn.baseline_progress = undefined;
} }
gantt.config.columns = createColumnsConfig(configColumn); gantt.config.columns = createColumnsConfig(configColumn);
@ -716,8 +716,25 @@ function updateLinksLag(data) {
if (link.target == task.id) { if (link.target == task.id) {
let predecessor = data.data.find(item => item.id == link.source); let predecessor = data.data.find(item => item.id == link.source);
if (predecessor) { if (predecessor) {
let lag = gantt.calculateDuration(new Date(predecessor.end_date), new Date(task.start_date)); let lag;
if (link.type == "0" && isBaselineSet) { if (isBaselineSet) {
switch (link.type) {
case "0":
lag = gantt.calculateDuration(new Date(predecessor.end_date), new Date(task.start_date));
break;
case "1":
lag = gantt.calculateDuration(new Date(predecessor.start_date), new Date(task.start_date));
break;
case "2":
lag = gantt.calculateDuration(new Date(predecessor.end_date), new Date(task.end_date));
break;
case "3":
lag = gantt.calculateDuration(new Date(predecessor.start_date), new Date(task.end_date));
break;
default:
// Handle an unknown link type if needed
break;
}
link.lag = lag; link.lag = lag;
} }
} }

18
edit-mode/function/materialResource.js

@ -164,13 +164,23 @@ $(document).ready(function () {
results: dataIntegrasiMaterial results: dataIntegrasiMaterial
}; };
}, error: function (jqXHR, textStatus, errorThrown) { }, error: function (jqXHR, textStatus, errorThrown) {
gantt.alert(`Status: ${textStatus}`); if (textStatus != "abort") {
gantt.alert(`Error thrown: ${errorThrown}`); gantt.alert(`Status: ${textStatus}`);
gantt.alert(`Error accessing URL: ${adwIntegrationUrl}/request-material/get-material-integration`); gantt.alert(`Error thrown: ${errorThrown}`);
gantt.alert(`Error accessing URL: ${adwIntegrationUrl}/request-material/get-material-integration`);
}
} }
} }
}); });
// $('#required-date-req-material').datepicker({
// format: 'dd-mm-yyyy', // Set the desired format
// autoclose: true // Close the datepicker when a date is selected
// });
//
// $('#required-date-plan-material').datepicker({
// format: 'dd-mm-yyyy', // Set the desired format
// autoclose: true // Close the datepicker when a date is selected
// });
$("#form-assign-material").on('submit', function (e) { $("#form-assign-material").on('submit', function (e) {
e.preventDefault(); e.preventDefault();

10
edit-mode/function/reportActivity.js

@ -62,7 +62,15 @@ $(document).ready(function () {
$('#ra_date_end_activity').prop('disabled', true); $('#ra_date_end_activity').prop('disabled', true);
} }
}); });
// $('#ra_date_start_activity').datepicker({
// format: 'dd-mm-yyyy', // Set the desired format
// autoclose: true // Close the datepicker when a date is selected
// });
//
// $('#ra_date_end_activity').datepicker({
// format: 'dd-mm-yyyy', // Set the desired format
// autoclose: true // Close the datepicker when a date is selected
// });
$("#ra_date_end_activity").on("change", function () { $("#ra_date_end_activity").on("change", function () {
let valEnd = $(this).val() let valEnd = $(this).val()
let valStart = $('#ra_date_start_activity').val() let valStart = $('#ra_date_start_activity').val()

Loading…
Cancel
Save