diff --git a/module/bug/control.php b/module/bug/control.php
index 2ec9e5621a..9429fc46e0 100644
--- a/module/bug/control.php
+++ b/module/bug/control.php
@@ -1871,6 +1871,7 @@ class bug extends control
* @param string $module
* @param string $method
* @param string $extra
+ * @param string $from
* @access public
* @return void
*/
diff --git a/module/bug/model.php b/module/bug/model.php
index 60c59bd741..66a68612ff 100644
--- a/module/bug/model.php
+++ b/module/bug/model.php
@@ -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()
diff --git a/module/bug/view/ajaxgetdropmenu.html.php b/module/bug/view/ajaxgetdropmenu.html.php
index f33d53c8d8..885f778050 100644
--- a/module/bug/view/ajaxgetdropmenu.html.php
+++ b/module/bug/view/ajaxgetdropmenu.html.php
@@ -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}'");
}
?>
diff --git a/module/execution/control.php b/module/execution/control.php
index eefcebe26a..47a1c84dbe 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -836,6 +836,7 @@ class execution extends control
* Browse bugs of a execution.
*
* @param int $executionID
+ * @param int $productID
* @param string $orderBy
* @param int $build
* @param string $type
@@ -846,11 +847,12 @@ class execution extends control
* @access public
* @return void
*/
- public function bug($executionID = 0, $orderBy = 'status,id_desc', $build = 0, $type = 'all', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
+ public function bug($executionID = 0, $productID = 0, $orderBy = 'status,id_desc', $build = 0, $type = 'all', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Load these two models. */
$this->loadModel('bug');
$this->loadModel('user');
+ $this->loadModel('product');
/* Save session. */
$this->session->set('bugList', $this->app->getURI(true), 'execution');
@@ -860,9 +862,12 @@ class execution extends control
$execution = $this->commonAction($executionID);
$executionID = $execution->id;
$products = $this->execution->getProducts($execution->id);
- $productID = key($products); // Get the first product for creating bug.
$branchID = isset($products[$productID]) ? $products[$productID]->branch : 0;
+ $productPairs = array('0' => $this->lang->product->all);
+ foreach($products as $product) $productPairs[$product->id] = $product->name;
+ $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'execution', 'bug', '', $branchID);
+
/* Header and position. */
$title = $execution->name . $this->lang->colon . $this->lang->execution->bug;
$position[] = html::a($this->createLink('execution', 'browse', "executionID=$executionID"), $execution->name);
@@ -872,7 +877,7 @@ class execution extends control
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$sort = $this->loadModel('common')->appendOrder($orderBy);
- $bugs = $this->bug->getExecutionBugs($executionID, $build, $type, $param, $sort, '', $pager);
+ $bugs = $this->bug->getExecutionBugs($executionID, $productID, $build, $type, $param, $sort, '', $pager);
$users = $this->user->getPairs('noletter');
/* team member pairs. */
@@ -884,7 +889,7 @@ class execution extends control
}
/* Build the search form. */
- $actionURL = $this->createLink('execution', 'bug', "executionID=$executionID&orderBy=$orderBy&build=$build&type=bysearch&queryID=myQueryID");
+ $actionURL = $this->createLink('execution', 'bug', "executionID=$executionID&productID=$productID&orderBy=$orderBy&build=$build&type=bysearch&queryID=myQueryID");
$this->execution->buildBugSearchForm($products, $queryID, $actionURL);
/* Assign. */
diff --git a/module/execution/view/bug.html.php b/module/execution/view/bug.html.php
index 1b949f4e1a..7029cc9ab7 100644
--- a/module/execution/view/bug.html.php
+++ b/module/execution/view/bug.html.php
@@ -11,12 +11,16 @@
*/
?>
+