This commit is contained in:
wangyidong
2021-04-15 14:45:35 +08:00
parent c4454bb6d9
commit 04a5041611
5 changed files with 27 additions and 19 deletions
+20 -14
View File
@@ -691,10 +691,8 @@ class bug extends control
$bugID = (int)$bugID;
$bug = $this->bug->getById($bugID, true);
if(!$bug) die(js::error($this->lang->notFound) . js::locate('back'));
if($bug->project) $this->session->project = $bug->project;
$this->view->products = $this->products = $this->product->getProductPairsByProject($this->session->project);
$this->session->set('storyList', '', 'product');
$this->session->set('storyList', '', 'product');
$this->bug->checkBugExecutionPriv($bug);
/* Update action. */
@@ -704,40 +702,39 @@ class bug extends control
if($this->app->openApp == 'project') $this->loadModel('project')->setMenu($bug->project);
if($this->app->openApp == 'execution') $this->loadModel('execution')->setMenu($bug->execution);
if($this->app->openApp == 'qa') $this->qa->setMenu($this->products, $bug->product, $bug->branch);
if($this->app->openApp == 'repo')
if($this->app->openApp == 'devops')
{
session_write_close();
$repos = $this->loadModel('repo')->getRepoPairs($this->session->project);
$repos = $this->loadModel('repo')->getRepoPairs($bug->project);
$this->repo->setMenu($repos);
$this->lang->bug->menu = $this->lang->repo->menu;
$this->lang->navGroup->bug = 'devops';
}
/* Get product info. */
$productID = $bug->product;
$productName = isset($this->products[$productID]) ? $this->products[$productID] : '';
$branches = $this->session->currentProductType == 'normal' ? array() : $this->loadModel('branch')->getPairs($bug->product);
$product = $this->loadModel('product')->getByID($productID);
$branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($bug->product);
$this->executeHooks($bugID);
/* Header and positon. */
$this->view->title = "BUG #$bug->id $bug->title - " . $productName;
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $productName);
$this->view->title = "BUG #$bug->id $bug->title - " . $product->name;
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $product->name);
$this->view->position[] = $this->lang->bug->view;
/* Assign. */
$this->view->productID = $productID;
$this->view->productName = $productName;
$this->view->branches = $branches;
$this->view->modulePath = $this->tree->getParents($bug->module);
$this->view->bugModule = empty($bug->module) ? '' : $this->tree->getById($bug->module);
$this->view->bug = $bug;
$this->view->from = $from;
$this->view->branchName = $this->session->currentProductType == 'normal' ? '' : zget($branches, $bug->branch, '');
$this->view->branchName = $product->type == 'normal' ? '' : zget($branches, $bug->branch, '');
$this->view->users = $this->user->getPairs('noletter');
$this->view->actions = $this->action->getList('bug', $bugID);
$this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch = 0, $params = '');
$this->view->preAndNext = $this->loadModel('common')->getPreAndNextObject('bug', $bugID);
$this->view->product = $this->loadModel('product')->getByID( $productID);
$this->view->product = $product;
$this->display();
}
@@ -810,6 +807,13 @@ class bug extends control
if($this->app->openApp == 'project') $this->loadModel('project')->setMenu($bug->project);
if($this->app->openApp == 'execution') $this->loadModel('execution')->setMenu($bug->execution);
if($this->app->openApp == 'qa') $this->qa->setMenu($this->products, $productID, $bug->branch);
if($this->app->openApp == 'devops')
{
session_write_close();
$repos = $this->loadModel('repo')->getRepoPairs($bug->project);
$this->repo->setMenu($repos);
$this->lang->navGroup->bug = 'devops';
}
/* Unset discarded types. */
foreach($this->config->bug->discardedTypes as $type)
@@ -828,6 +832,7 @@ class bug extends control
$this->view->position[] = $this->lang->bug->edit;
/* Assign. */
$product = $this->loadModel('product')->getByID($productID);
$allBuilds = $this->loadModel('build')->getProductBuildPairs($productID, $branch = 0, 'noempty');
if($executionID)
{
@@ -855,13 +860,14 @@ class bug extends control
$this->view->bug = $bug;
$this->view->productID = $productID;
$this->view->product = $product;
$this->view->productName = $this->products[$productID];
$this->view->plans = $this->loadModel('productplan')->getPairs($productID, $bug->branch);
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $bug->branch);
$this->view->currentModuleID = $currentModuleID;
$this->view->executions = $this->product->getExecutionPairsByProduct($bug->product, $bug->branch ? "0,{$bug->branch}" : 0, 'id_desc', $projectID);
$this->view->stories = $bug->execution ? $this->story->getExecutionStoryPairs($bug->execution) : $this->story->getProductStoryPairs($bug->product, $bug->branch);
$this->view->branches = $this->session->currentProductType == 'normal' ? array() : $this->loadModel('branch')->getPairs($bug->product);
$this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($bug->product);
$this->view->tasks = $this->task->getExecutionTaskPairs($bug->execution);
$this->view->testtasks = $this->loadModel('testtask')->getPairs($bug->product, $bug->execution, $bug->testtask);
$this->view->users = $this->user->getPairs('nodeleted', "$bug->assignedTo,$bug->resolvedBy,$bug->closedBy,$bug->openedBy");
+1
View File
@@ -310,6 +310,7 @@ function loadProductBuilds(productID)
{
branch = $('#branch').val();
if(typeof(branch) == 'undefined') branch = 0;
if(typeof(oldOpenedBuild) == 'undefined') oldOpenedBuild = 0;
link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch);
if(page == 'create')
+1 -1
View File
@@ -91,7 +91,7 @@ js::set('systemMode' , $config->systemMode);
<td>
<div class='input-group'>
<?php echo html::select('product', $products, $productID, "onchange='loadAll(this.value)' class='form-control chosen'");?>
<?php if($this->session->currentProductType != 'normal') echo html::select('branch', $branches, $bug->branch, "onchange='loadBranch();' class='form-control'");?>
<?php if($product->type != 'normal') echo html::select('branch', $branches, $bug->branch, "onchange='loadBranch();' class='form-control'");?>
</div>
</td>
</tr>
+4 -4
View File
@@ -92,7 +92,7 @@
echo "<div class='divider'></div>";
common::printIcon('bug', 'edit', $params, $bug);
common::printIcon('bug', 'create', $copyParams, $bug, 'button', 'copy');
common::printIcon('bug', 'create', $copyParams, $bug, 'button', 'copy', '', '', false, "data-app='qa'");
common::printIcon('bug', 'delete', $params, $bug, 'button', 'trash', 'hiddenwin');
?>
<?php endif;?>
@@ -112,11 +112,11 @@
<tbody>
<tr valign='middle'>
<th class='thWidth'><?php echo $lang->bug->product;?></th>
<td><?php if(!common::printLink('product', 'browse', "productID=$bug->product", $productName)) echo $productName;?></td>
<td><?php if(!common::printLink('product', 'browse', "productID=$bug->product", $product->name)) echo $product->name;?></td>
</tr>
<?php if($this->session->currentProductType != 'normal'):?>
<?php if($product->type != 'normal'):?>
<tr>
<th><?php echo sprintf($lang->product->branch, $lang->product->branchName[$this->session->currentProductType]);?></th>
<th><?php echo sprintf($lang->product->branch, $lang->product->branchName[$product->name]);?></th>
<td><?php if(!common::printLink('bug', 'browse', "productID=$bug->product&branch=$bug->branch", $branchName)) echo $branchName;?></td>
</tr>
<?php endif;?>
+1
View File
@@ -3,6 +3,7 @@ $lang->repo->common = '代码';
$lang->repo->browse = '浏览';
$lang->repo->viewRevision = '查看修订';
$lang->repo->product = '所属产品';
$lang->repo->execution = '所属' . $lang->executionCommon;
$lang->repo->create = '创建';
$lang->repo->maintain = '版本库列表';
$lang->repo->edit = '编辑';