* Change childTasks variable name to children.

This commit is contained in:
hufangzhou
2023-05-10 20:16:44 +08:00
parent 5e88003930
commit 45f4c834b8
2 changed files with 13 additions and 13 deletions
+5 -5
View File
@@ -183,8 +183,8 @@ class taskModel extends model
if(!dao::isError()) $this->score->create('ajax', 'batchCreate'); // Updating scores for the first batch creation operation.
/* 拆分任务后更新其他数据。 Process other data after split task. */
$childTasks = !empty($parentID) ? implode(',', $taskIdList) : '';
if($parentID) $this->afterSplitTask($oldParentTask, $childTasks);
$children = !empty($parentID) ? implode(',', $taskIdList) : '';
if($parentID) $this->afterSplitTask($oldParentTask, $children);
/* 更新当前执行下的任务泳道。 Update the task lane under current execution. */
if(!isset($output['laneID']) or !isset($output['columnID'])) $this->kanban->updateLane($execution->id, 'task');
@@ -3774,11 +3774,11 @@ class taskModel extends model
* Process other data after split task.
*
* @param object $oldParentTask
* @param string $childTasks
* @param string $children
* @access public
* @return bool
*/
public function afterSplitTask(object $oldParentTask, string $childTasks = ''): bool
public function afterSplitTask(object $oldParentTask, string $children = ''): bool
{
$parentID = (int)$oldParentTask->id;
@@ -3798,7 +3798,7 @@ class taskModel extends model
/* 记录父任务日志。 */
$newParentTask = $this->dao->findById($parentID)->from(TABLE_TASK)->fetch();
$changes = common::createChanges($oldParentTask, $newParentTask);
$actionID = $this->action->create('task', $parentID, 'createChildren', '', trim($childTasks, ','));
$actionID = $this->action->create('task', $parentID, 'createChildren', '', trim($children, ','));
if(!empty($changes)) $this->action->logHistory($actionID, $changes);
return true;
+8 -8
View File
@@ -1931,24 +1931,24 @@ class taskTest
* Process other data after split task.
*
* @param int $oldParentTaskID
* @param string $childTasks
* @param string $children
* @param string $testObject children|parent|parentAction
* @access public
* @return object|string
*/
public function afterSplitTaskTest(int $oldParentTaskID = 0, string $childTasks = '', string $testObject = 'parent'): object|string
public function afterSplitTaskTest(int $oldParentTaskID = 0, string $children = '', string $testObject = 'parent'): object|string
{
global $tester;
$_SERVER['HTTP_HOST'] = $tester->config->db->host;
$oldParentTask = $tester->dao->select('*')->from(TABLE_TASK)->where('id')->eq($oldParentTaskID)->fetch();
$this->objectModel->afterSplitTask($oldParentTask, $childTasks);
$this->objectModel->afterSplitTask($oldParentTask, $children);
$tasks['children'] = $tester->dao->select('id')->from(TABLE_TASK)->where('parent')->eq($oldParentTask->id)->fetchPairs('id');
$tasks['parent'] = $tester->dao->select('*')->from(TABLE_TASK)->where('id')->eq($oldParentTask->id)->fetch();
$tasks['parentAction'] = $tester->dao->select('id as actionID')->from(TABLE_ACTION)->where('objectID')->eq($oldParentTask->id)->andWhere('objectType')->eq('task')->fetch();
$tasks['parentEstStarted'] = $tasks['parent']->estStarted;
$tasks['parentDeadline'] = $tasks['parent']->deadline;
$tasks['children'] = $tester->dao->select('id')->from(TABLE_TASK)->where('parent')->eq($oldParentTask->id)->fetchPairs('id');
$tasks['parent'] = $tester->dao->select('*')->from(TABLE_TASK)->where('id')->eq($oldParentTask->id)->fetch();
$tasks['parentAction'] = $tester->dao->select('id as actionID')->from(TABLE_ACTION)->where('objectID')->eq($oldParentTask->id)->andWhere('objectType')->eq('task')->fetch();
$tasks['parentEstStarted'] = $tasks['parent']->estStarted;
$tasks['parentDeadline'] = $tasks['parent']->deadline;
return $tasks[$testObject];
}