* Finish task#37284.

This commit is contained in:
leiyong
2021-04-09 05:16:19 +03:00
parent 49dd13be63
commit 3c72f70d36
8 changed files with 61 additions and 36 deletions
+1
View File
@@ -1871,6 +1871,7 @@ class bug extends control
* @param string $module
* @param string $method
* @param string $extra
* @param string $from
* @access public
* @return void
*/
+8 -8
View File
@@ -1401,6 +1401,7 @@ class bugModel extends model
* Get bugs of a project.
*
* @param int $projectID
* @param int $productID
* @param int $build
* @param string $type
* @param int $param
@@ -1410,14 +1411,12 @@ class bugModel extends model
* @access public
* @return array
*/
public function getProjectBugs($projectID, $build = 0, $type = '', $param = 0, $orderBy = 'id_desc', $excludeBugs = '', $pager = null)
public function getProjectBugs($projectID, $productID = 0, $build = 0, $type = '', $param = 0, $orderBy = 'id_desc', $excludeBugs = '', $pager = null)
{
$type = strtolower($type);
if($type == 'bysearch')
{
$queryID = (int)$param;
$products = $this->loadModel('project')->getProducts($projectID);
$queryID = (int)$param;
if($this->session->projectBugQuery == false) $this->session->set('projectBugQuery', ' 1 = 1');
if($queryID)
{
@@ -1450,6 +1449,7 @@ class bugModel extends model
$bugs = $this->dao->select('*')->from(TABLE_BUG)
->where('deleted')->eq(0)
->beginIF(empty($build))->andWhere('project')->eq($projectID)->fi()
->beginIF(!empty($productID))->andWhere('product')->eq($productID)->fi()
->beginIF($type == 'unresolved')->andWhere('status')->eq('active')->fi()
->beginIF($type == 'noclosed')->andWhere('status')->ne('closed')->fi()
->beginIF($build)->andWhere("CONCAT(',', openedBuild, ',') like '%,$build,%'")->fi()
@@ -1466,6 +1466,7 @@ class bugModel extends model
* Get bugs of a execution.
*
* @param int $executionID
* @param int $productID
* @param int $build
* @param string $type
* @param int $param
@@ -1475,14 +1476,12 @@ class bugModel extends model
* @access public
* @return array
*/
public function getExecutionBugs($executionID, $build = 0, $type = '', $param = 0, $orderBy = 'id_desc', $excludeBugs = '', $pager = null)
public function getExecutionBugs($executionID, $productID = 0, $build = 0, $type = '', $param = 0, $orderBy = 'id_desc', $excludeBugs = '', $pager = null)
{
$type = strtolower($type);
if($type == 'bysearch')
{
$queryID = (int)$param;
$products = $this->loadModel('execution')->getProducts($executionID);
$queryID = (int)$param;
if($this->session->executionBugQuery == false) $this->session->set('executionBugQuery', ' 1 = 1');
if($queryID)
{
@@ -1515,6 +1514,7 @@ class bugModel extends model
$bugs = $this->dao->select('*')->from(TABLE_BUG)
->where('deleted')->eq(0)
->beginIF(empty($build))->andWhere('execution')->eq($executionID)->fi()
->beginIF(!empty($productID))->andWhere('product')->eq($productID)->fi()
->beginIF($type == 'unresolved')->andWhere('status')->eq('active')->fi()
->beginIF($type == 'noclosed')->andWhere('status')->ne('closed')->fi()
->beginIF($build)->andWhere("CONCAT(',', openedBuild, ',') like '%,$build,%'")->fi()
+2 -2
View File
@@ -17,7 +17,7 @@ foreach($products as $product)
}
$productsPinYin = common::convert2Pinyin($productNames);
$linkHtml = $this->product->setParamsForLink($module, $link, $projectID, 0);
$productsHtml = html::a($linkHtml, $this->lang->bug->allProduct, '', "class='text-important' title='{$this->lang->bug->allProduct}' data-key='" . zget($productsPinYin, $this->lang->bug->allProduct, '') . "' data-group='project'");
$productsHtml = html::a($linkHtml, $this->lang->bug->allProduct, '', "class='text-important' title='{$this->lang->bug->allProduct}' data-key='" . zget($productsPinYin, $this->lang->bug->allProduct, '') . "' data-app='{$this->app->openApp}'");
foreach($products as $product)
{
@@ -26,7 +26,7 @@ foreach($products as $product)
$productName .= $product->line ? zget($lines, $product->line, '') . '/' . $product->name : $product->name;
$objectID = ($product->type != 'platform' && $module == 'branch' && $method == 'manage') ? $productID : $product->id;
$linkHtml = $this->product->setParamsForLink($module, $link, $projectID, $product->id);
$productsHtml .= html::a($linkHtml, $productName, '', "class='text-important $selected' title='{$productName}' data-key='" . zget($productsPinYin, $product->name, '') . "' data-group='project'");
$productsHtml .= html::a($linkHtml, $productName, '', "class='text-important $selected' title='{$productName}' data-key='" . zget($productsPinYin, $product->name, '') . "' data-app='{$this->app->openApp}'");
}
?>
<div class="table-row">