* Adjust the code.
This commit is contained in:
@@ -1775,29 +1775,6 @@ class projectModel extends model
|
||||
$existedProducts[$productID] = true;
|
||||
}
|
||||
|
||||
/* Link the stories of the plans to the project. */
|
||||
foreach($plans as $productID => $planID)
|
||||
{
|
||||
$planStories = $planProducts = array();
|
||||
$planStory = $this->loadModel('story')->getPlanStories($planID);
|
||||
$count = 0;
|
||||
if(!empty($planStory))
|
||||
{
|
||||
foreach($planStory as $id => $story)
|
||||
{
|
||||
if($story->status == 'draft')
|
||||
{
|
||||
$count++;
|
||||
unset($planStory[$id]);
|
||||
continue;
|
||||
}
|
||||
$planProducts[$story->id] = $story->product;
|
||||
}
|
||||
$planStories = array_keys($planStory);
|
||||
$this->linkStory($projectID, $planStories, $planProducts);
|
||||
}
|
||||
}
|
||||
|
||||
/* Delete the execution linked products that is not linked with the project. */
|
||||
$executions = $this->dao->select('id')->from(TABLE_PROJECT)->where('project')->eq((int)$projectID)->fetchPairs('id');
|
||||
$this->dao->delete()->from(TABLE_PROJECTPRODUCT)->where('project')->in($executions)->andWhere('product')->notin($products)->exec();
|
||||
@@ -2103,26 +2080,6 @@ class projectModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* project link plan.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @param int $planID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
// public function linkPlan($projectID, $planID)
|
||||
// {
|
||||
// $plan = $this->dao->select('*')->from(TABLE_PRODUCTPLAN)->where('id')->eq($planID)->fetch();
|
||||
//
|
||||
// $data = new stdclass();
|
||||
// $data->project = $projectID;
|
||||
// $data->product = $plan->product;
|
||||
// $data->branch = $plan->branch;
|
||||
// $data->plan = $plan->id;
|
||||
// $this->dao->replace(TABLE_PROJECTPRODUCT)->data($data)->exec();
|
||||
// }
|
||||
|
||||
/**
|
||||
* Link story.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user