diff --git a/module/product/model.php b/module/product/model.php index 8179f425eb..b990f21d1e 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -236,6 +236,11 @@ class productModel extends model $product = $this->dao->findById($productID)->from(TABLE_PRODUCT)->fetch(); if(!$product) return false; + if($product->shadow) $product->name = $this->dao->select('t2.name')->from(TABLE_PROJECTPRODUCT)->alias('t1') + ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id') + ->where('t1.product')->eq($productID) + ->fetch('name'); + return $this->loadModel('file')->replaceImgURL($product, 'desc'); } diff --git a/module/testtask/control.php b/module/testtask/control.php index 053120b107..e133875f27 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -57,13 +57,13 @@ class testtask extends control } else { - $products = $this->product->getPairs(); + $products = $this->product->getPairs('', 0, '', true); } if(empty($products) and !helper::isAjaxRequest()) helper::end($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$tab&activeMenu=testtask&objectID=$objectID"))); } else { - $products = $this->product->getPairs(); + $products = $this->product->getPairs('', 0, '', true); } $this->view->products = $this->products = $products; } diff --git a/module/testtask/model.php b/module/testtask/model.php index 7468f426b1..49cd840323 100755 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -77,7 +77,7 @@ class testtaskModel extends model $branch = $scopeAndStatus[0] == 'all' ? 'all' : $branch; $executionNameField = $this->config->systemMode == 'new' ? "IF(t5.id IS NOT NULL, CONCAT(t5.name, ' / ', t3.name), t3.name)" : 't3.name'; - return $this->dao->select("t1.*, t2.name AS productName, $executionNameField AS executionName, t4.name AS buildName, t4.branch AS branch") + return $this->dao->select("t1.*, IF(t2.shadow = 1, t5.name, t2.name) AS productName, $executionNameField AS executionName, t4.name AS buildName, t4.branch AS branch") ->from(TABLE_TESTTASK)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') ->leftJoin(TABLE_EXECUTION)->alias('t3')->on('t1.execution = t3.id')