add cp gantt task move

This commit is contained in:
lanzongjun
2022-08-12 16:15:08 +08:00
parent d6c7e4e50d
commit 9fa80dcd94
6 changed files with 10 additions and 26 deletions
+9 -1
View File
@@ -3936,6 +3936,9 @@ class taskModel extends model
$this->app->loadLang('project');
$post = fixer::input('post')->get();
$post->endDate = date('Y-m-d', strtotime('-1 day', strtotime($post->endDate)));
$changeTable = $objectType == 'task' ? TABLE_TASK : TABLE_PROJECT;
$actionType = $objectType == 'task' ? 'task' : 'execution';
$oldObject = $this->dao->select('*')->from($changeTable)->where('id')->eq($objectID)->fetch();
if($objectType == 'task')
{
$objectData = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($objectID)->fetch();
@@ -4019,7 +4022,12 @@ class taskModel extends model
{
return false;
}
$newObject = $this->dao->select('*')->from($changeTable)->where('id')->eq($objectID)->fetch();
$changes = common::createChanges($oldObject, $newObject);
$actionID = $this->loadModel('action')->create($actionType, $objectID, 'edited');
if(!empty($changes)) $this->loadModel('action')->logHistory($actionID, $changes);
return true;
}