* finish task #40111

This commit is contained in:
zenggang
2021-07-14 14:44:48 +08:00
parent 49892661bf
commit c29583f980
4 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -1433,7 +1433,7 @@ class execution extends control
$position[] = $this->lang->execution->edit;
$allProducts = array(0 => '');
$executionProsucts = $this->execution->getProducts($execution->project);
$executionProsucts = $this->execution->getProducts($execution->project, true, 'noclosed');
foreach($executionProsucts as $product) $allProducts[$product->id] = $product->name;
$linkedProducts = $this->execution->getProducts($execution->id);
+2 -1
View File
@@ -1579,7 +1579,7 @@ class executionModel extends model
* @access public
* @return array
*/
public function getProducts($executionID, $withBranch = true)
public function getProducts($executionID, $withBranch = true, $status = 'all')
{
if(defined('TUTORIAL'))
{
@@ -1592,6 +1592,7 @@ class executionModel extends model
->on('t1.product = t2.id')
->where('t1.project')->eq((int)$executionID)
->andWhere('t2.deleted')->eq(0)
->beginIF(strpos($status, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi()
->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->products)->fi();
if(!$withBranch) return $query->fetchPairs('id', 'name');
return $query->fetchAll('id');