* Hide bug plan in waterfall project.

This commit is contained in:
sunguangming
2022-09-29 16:05:03 +08:00
parent b2dd00458a
commit 4f58d80d64
8 changed files with 59 additions and 15 deletions
+11 -3
View File
@@ -980,15 +980,22 @@ class execution extends control
$type = strtolower($type);
$queryID = ($type == 'bysearch') ? (int)$param : 0;
$execution = $this->commonAction($executionID);
$project = $this->loadModel('project')->getByID($execution->project);
$executionID = $execution->id;
$products = $this->product->getProducts($execution->id);
$hasProduct = $this->dao->findByID($execution->project)->from(TABLE_PROJECT)->fetch('hasProduct');
if($execution->project and !$hasProduct) unset($this->config->bug->search['fields']['product']);
if($execution->project and !$project->hasProduct)
{
unset($this->config->bug->search['fields']['product']);
if($project->model != 'scrum')
{
unset($this->config->bug->search['fields']['plan']);
}
}
$productPairs = array('0' => $this->lang->product->all);
foreach($products as $productData) $productPairs[$productData->id] = $productData->name;
if($hasProduct) $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'execution', 'bug', $executionID, $branch);
if($project->hasProduct) $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'execution', 'bug', $executionID, $branch);
/* Header and position. */
$title = $execution->name . $this->lang->colon . $this->lang->execution->bug;
@@ -1084,6 +1091,7 @@ class execution extends control
$this->view->orderBy = $orderBy;
$this->view->users = $users;
$this->view->productID = $productID;
$this->view->project = $project;
$this->view->branchID = empty($this->view->build->branch) ? $branch : $this->view->build->branch;
$this->view->memberPairs = $memberPairs;
$this->view->type = $type;