* adjust for php error.

This commit is contained in:
wangyidong
2020-05-05 09:28:23 +08:00
parent c3dcb85546
commit d369ccdab6
+21 -18
View File
@@ -106,27 +106,30 @@ class taskModel extends model
{
$testStoryIdList = array();
$this->loadModel('action');
foreach($this->post->testStory as $storyID)
if($this->post->testStory)
{
if($storyID) $testStoryIdList[$storyID] = $storyID;
}
$testStories = $this->dao->select('id,title')->from(TABLE_STORY)->where('id')->in($testStoryIdList)->fetchPairs('id', 'title');
foreach($this->post->testStory as $i => $storyID)
{
if(!isset($testStories[$storyID])) continue;
foreach($this->post->testStory as $storyID)
{
if($storyID) $testStoryIdList[$storyID] = $storyID;
}
$testStories = $this->dao->select('id,title')->from(TABLE_STORY)->where('id')->in($testStoryIdList)->fetchPairs('id', 'title');
foreach($this->post->testStory as $i => $storyID)
{
if(!isset($testStories[$storyID])) continue;
$task->parent = $taskID;
$task->story = $storyID;
$task->name = $this->lang->task->lblTestStory . " #{$storyID} " . zget($testStories, $storyID);
$task->pri = $this->post->testPri[$i];
$task->estStarted = $this->post->testEstStarted[$i];
$task->deadline = $this->post->testDeadline[$i];
$task->assignedTo = $this->post->testAssignedTo[$i];
$task->estimate = $this->post->testEstimate[$i];
$this->dao->insert(TABLE_TASK)->data($task)->exec();
$task->parent = $taskID;
$task->story = $storyID;
$task->name = $this->lang->task->lblTestStory . " #{$storyID} " . zget($testStories, $storyID);
$task->pri = $this->post->testPri[$i];
$task->estStarted = $this->post->testEstStarted[$i];
$task->deadline = $this->post->testDeadline[$i];
$task->assignedTo = $this->post->testAssignedTo[$i];
$task->estimate = $this->post->testEstimate[$i];
$this->dao->insert(TABLE_TASK)->data($task)->exec();
$childTaskID = $this->dao->lastInsertID();
$this->action->create('task', $childTaskID, 'Opened');
$childTaskID = $this->dao->lastInsertID();
$this->action->create('task', $childTaskID, 'Opened');
}
}
$this->computeWorkingHours($taskID);