* Add some code.

This commit is contained in:
mayue
2022-08-02 17:36:44 +08:00
parent 27a91903f1
commit 6ebb39755a
2 changed files with 46 additions and 2 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();
}
}
+24 -1
View File
@@ -457,6 +457,7 @@ $(function()
gantt.serverList("userList", <?php echo json_encode($userList);?>);
gantt.config.readonly = false;
gantt.config.details_on_dblclick = false;
gantt.config.order_branch = true;
gantt.config.details_on_dblclick = false;
gantt.config.drag_progress = true;
@@ -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()
{