Merge branch 'sprint/gantt_upgrade' of https://gitlab.zcorp.cc/easycorp/zentaopms into sprint/gantt_upgrade

This commit is contained in:
lanzongjun
2022-08-03 09:28:53 +08:00
4 changed files with 49 additions and 3 deletions
+22 -1
View File
@@ -239,7 +239,7 @@ class programplan extends control
}
/**
* Save task drag action.
* Save task drag position.
*
* @access public
* @return void
@@ -262,4 +262,25 @@ class programplan extends control
return $this->send(array('result' => 'success'));
}
}
/**
* Save task drag action.
*
* @access public
* @return void
*/
public function ajaxSaveGanttMove()
{
if($_POST)
{
$data = fixer::input('post')->get();
$IdList = explode('-', $data->id);
$executionID = $IdList[0];
$taskID = $IdList[1];
return 1231231;
}
return $this->send();
}
}
+25 -2
View File
@@ -457,7 +457,8 @@ $(function()
gantt.serverList("userList", <?php echo json_encode($userList);?>);
gantt.config.readonly = false;
gantt.config.order_branch = true;
gantt.config.details_on_dblclick = false;
gantt.config.order_branch = 'marker';
gantt.config.details_on_dblclick = false;
gantt.config.drag_progress = false;
gantt.config.drag_links = false;
@@ -540,7 +541,7 @@ $(function()
{
if(module == 'review' && method == 'assess')
{
gantt.config.layout = layout;
gantt.config.layout = layout;
gantt.init('ganttView');
}
gantt.expand();
@@ -614,6 +615,28 @@ $(function()
if(!isNaN(taskID) && taskID > 0) taskModalTrigger.show({url: createLink('task', 'view', 'taskID=' + taskID, 'html', true)});
});
gantt.attachEvent("onBeforeRowDragEnd", function(id, parent, tindex)
{
var task = gantt.getTask(id);
var link = createLink('programplan', 'ajaxSaveGanttMove');
//prevent moving to another position.
if(task.parent != parent || id.indexOf('-') == -1) return false;
$.ajax({
url: link,
dataType: "json",
data: {id: id, type: task.type, order: tindex},
type: "post",
success: function(result)
{
var target = result;
}
});
return true;
});
// Make folder can open or close by click
$('#ganttView').on('click', '.gantt_close,.gantt_open', function()
{