Browse Source

Fix duration & HR Activity Role

pull/1/head
Wahyu Ramadhan 2 years ago
parent
commit
67a060971f
  1. 14
      edit-mode/function/humanResource.js
  2. 2
      edit-mode/function/restActivityLink.js

14
edit-mode/function/humanResource.js

@ -129,7 +129,7 @@ $(document).ready(function () {
// console.log("cek item", item) // console.log("cek item", item)
return { return {
text: item.name, text: item.name,
id: item.id, id: item.id + "|" + item.proyek_role,
proyek_role: item.proyek_role proyek_role: item.proyek_role
} }
}) })
@ -157,9 +157,15 @@ $(document).ready(function () {
$('#btn-assign-hr').prop("disabled", true); $('#btn-assign-hr').prop("disabled", true);
// var formData = new FormData(this); // var formData = new FormData(this);
let user_id = $("#select-hr").val(); let users = $("#select-hr").val();
let user_role = $("#hr_role").val(); let user_id = [];
if (!user_id || user_id < 0) { let user_role = [];
users.map((item)=>{
let text = item.split('|');
user_id.push(text[0]);
user_role.push(text[1]);
})
if (!users || users < 0) {
gantt.alert("Please choose user to assign!"); gantt.alert("Please choose user to assign!");
$('#btn-assign-hr').html('Assign'); $('#btn-assign-hr').html('Assign');
$('#btn-assign-hr').prop("disabled", false); $('#btn-assign-hr').prop("disabled", false);

2
edit-mode/function/restActivityLink.js

@ -117,7 +117,9 @@ var dp = gantt.createDataProcessor(function(entity, action, data, id) {
}); });
} }
data['sortorder'] = data['target']; data['sortorder'] = data['target'];
if(!data['rencana_biaya']){
data['duration'] += 1; data['duration'] += 1;
}
return gantt.ajax.put({ return gantt.ajax.put({
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",

Loading…
Cancel
Save