* Fix bug #13022.
This commit is contained in:
@@ -314,6 +314,24 @@ class productModel extends model
|
||||
return $pairs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get product pairs by project model.
|
||||
*
|
||||
* @param string $model all|scrum|waterfall
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getPairsByProjectModel($model)
|
||||
{
|
||||
return $this->dao->select('t3.id as id, t3.name as name')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product=t3.id')
|
||||
->where('t3.deleted')->eq(0)
|
||||
->beginIF(!$this->app->user->admin)->andWhere('t3.id')->in($this->app->user->view->products)->fi()
|
||||
->beginIF($model != 'all')->andWhere('t2.model')->eq($model)
|
||||
->fetchPairs('id', 'name');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get products by project.
|
||||
*
|
||||
|
||||
@@ -394,7 +394,7 @@ class todo extends control
|
||||
$this->view->from = $from;
|
||||
$this->view->projects = $projects;
|
||||
$this->view->executions = $this->loadModel('execution')->getPairs($this->session->project);
|
||||
$this->view->products = $this->loadModel('product')->getPairs();
|
||||
$this->view->products = $todo->type == 'opportunity' ? $this->loadModel('product')->getPairsByProjectModel('waterfall') : $this->loadModel('product')->getPairs();
|
||||
$this->view->projectProducts = $this->loadModel('product')->getProductPairsByProject($this->session->project);
|
||||
|
||||
$this->display();
|
||||
|
||||
Reference in New Issue
Block a user