* finish the task #641.

This commit is contained in:
shiyangyangwork@yahoo.cn
2011-12-16 06:14:16 +00:00
parent 96c118f062
commit df559ac8b2
+8
View File
@@ -726,6 +726,14 @@ class projectModel extends model
$this->dao->delete()->from(TABLE_PROJECTSTORY)->where('project')->eq($projectID)->andWhere('story')->eq($storyID)->limit(1)->exec();
$this->loadModel('story')->setStage($storyID);
$this->loadModel('action')->create('story', $storyID, 'unlinkedfromproject', '', $projectID);
$tasks = $this->dao->select('id')->from(TABLE_TASK)->where('story')->eq($storyID)->andWhere('project')->eq($projectID)->andWhere('status')->in('wait,doing')->fetchPairs('id');
$this->dao->update(TABLE_TASK)->set('status')->eq('cancel')->where('id')->in($tasks)->exec();
foreach($tasks as $taskID)
{
$changes = $this->loadModel('task')->cancel($taskID);
$actionID = $this->loadModel('action')->create('task', $taskID, 'Canceled');
$this->action->logHistory($actionID, $changes);
}
}
/**