* Finish task#12961.
This commit is contained in:
+12
-15
@@ -410,9 +410,19 @@ class taskModel extends model
|
||||
$clonedTask->parent = $parentID;
|
||||
$this->dao->insert(TABLE_TASK)->data($clonedTask)->autoCheck()->exec();
|
||||
|
||||
/* Update task estimate log. */
|
||||
$clonedTaskID = $this->dao->lastInsertID();
|
||||
$this->updateTaskID($clonedTaskID, $oldParentTask->id);
|
||||
|
||||
/* Update the table by judging the beginning of the version number. */
|
||||
if(preg_match('/^\d/', $this->config->version))
|
||||
{
|
||||
/* ZenTao Pms update TABLE_TASKESTIMATE. */
|
||||
$this->dao->update(TABLE_TASKESTIMATE)->set('task')->eq($clonedTaskID)->where('task')->eq($oldParentTask->id)->exec();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* ZenTao Pro and ZenTao Biz update TABLE_EFFORT. */
|
||||
$this->dao->update(TABLE_EFFORT)->set('objectID')->eq($clonedTaskID)->where('objectID')->eq($oldParentTask->id)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
$this->updateParentStatus($taskID);
|
||||
@@ -499,19 +509,6 @@ class taskModel extends model
|
||||
return !dao::isError();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update task ID in TABLE_TASKESTIMATE.
|
||||
*
|
||||
* @param int $newID
|
||||
* @param int $oldID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function updateTaskID($newID, $oldID)
|
||||
{
|
||||
$this->dao->update(TABLE_TASKESTIMATE)->set('task')->eq($newID)->where('task')->eq($oldID)->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update parent status by taskID.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user