* Adjust the scope of modules when searching for bugs.

This commit is contained in:
tianshujie
2022-04-25 01:27:24 +00:00
parent 4f1690ca0e
commit 42676bf558
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -195,7 +195,7 @@ class bug extends control
/* Build the search form. */
$actionURL = $this->createLink('bug', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID");
$this->config->bug->search['onMenuBar'] = 'yes';
$this->bug->buildSearchForm($productID, $this->products, $queryID, $actionURL);
$this->bug->buildSearchForm($productID, $this->products, $queryID, $actionURL, $branch);
$showModule = !empty($this->config->datatable->bugBrowse->showModule) ? $this->config->datatable->bugBrowse->showModule : '';
$productName = ($productID and isset($this->products[$productID])) ? $this->products[$productID] : $this->lang->product->allProduct;
+3 -2
View File
@@ -1415,10 +1415,11 @@ class bugModel extends model
* @param array $products
* @param int $queryID
* @param string $actionURL
* @param int $branch
* @access public
* @return void
*/
public function buildSearchForm($productID, $products, $queryID, $actionURL)
public function buildSearchForm($productID, $products, $queryID, $actionURL, $branch = 0)
{
$projectID = $this->lang->navGroup->bug == 'qa' ? 0 : $this->session->project;
$productParams = ($productID and isset($products[$productID])) ? array($productID => $products[$productID]) : $products;
@@ -1429,7 +1430,7 @@ class bugModel extends model
/* Get all modules. */
$modules = array();
$this->loadModel('tree');
if($productID) $modules = $this->tree->getOptionMenu($productID, 'bug', 0);
if($productID) $modules = $this->tree->getOptionMenu($productID, 'bug', 0, $branch);
if(!$productID)
{
foreach($products as $id => $productName) $modules += $this->tree->getOptionMenu($id, 'bug');