* Fix sonar.
This commit is contained in:
+10
-5
@@ -587,7 +587,8 @@ class bug extends control
|
||||
$showFields = trim($showFields, ',');
|
||||
}
|
||||
|
||||
$projectID = $this->lang->navGroup->bug == 'project' ? $this->session->project : (isset($execution) ? $execution->project : 0);
|
||||
$projectID = isset($execution) ? $execution->project : 0;
|
||||
$projectID = $this->lang->navGroup->bug == 'project' ? $this->session->project : $projectID;
|
||||
$project = $this->loadModel('project')->getByID($projectID);
|
||||
if(isset($project->model) && $project->model == 'kanban') $customFields['execution'] = $this->lang->bug->kanban;
|
||||
|
||||
@@ -847,7 +848,8 @@ class bug extends control
|
||||
if(!isset($modules[$bug->product][$bug->branch]) and isset($modules[$bug->product])) $modules[$bug->product][$bug->branch] = $modules[$bug->product][0] + $this->tree->getModulesName($bug->module);
|
||||
|
||||
$bugProduct = isset($productList) ? $productList[$bug->product] : $product;
|
||||
$branch = $bugProduct->type == 'branch' ? ($bug->branch > 0 ? $bug->branch . ',0' : '0') : '';
|
||||
$branch = $bug->branch > 0 ? $bug->branch . ',0' : '0';
|
||||
$branch = $bugProduct->type == 'branch' ? $branch : '';
|
||||
if(!isset($productBugList[$bug->product][$bug->branch])) $productBugList[$bug->product][$bug->branch] = $this->bug->getProductBugPairs($bug->product, $branch);
|
||||
}
|
||||
|
||||
@@ -1475,7 +1477,7 @@ class bug extends control
|
||||
$this->bug->afterClose($bug, $oldBug);
|
||||
|
||||
$this->executeHooks($bugID);
|
||||
$this->bug->handleOnlyBodyAfterClose($oldBug->execution, $extra);
|
||||
$this->bug->handleOnlyBodyAfterClose($oldBug->execution, $extra, $from);
|
||||
|
||||
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'success', 'data' => $bugID));
|
||||
|
||||
@@ -1879,7 +1881,9 @@ class bug extends control
|
||||
{
|
||||
$bug = $this->dao->select('*')->from(TABLE_BUG)->where('id')->eq($bugID)->fetch();
|
||||
$realname = $this->dao->select('*')->from(TABLE_USER)->where('account')->eq($bug->assignedTo)->fetch('realname');
|
||||
$bug->assignedTo = $realname ? $realname : ($bug->assignedTo == 'closed' ? 'Closed' : $bug->assignedTo);
|
||||
|
||||
$bug->assignedTo = $bug->assignedTo == 'closed' ? 'Closed' : $bug->assignedTo;
|
||||
$bug->assignedTo = $realname ?: $bug->assignedTo;
|
||||
return print(json_encode($bug));
|
||||
}
|
||||
|
||||
@@ -1963,7 +1967,8 @@ class bug extends control
|
||||
{
|
||||
$product = $this->loadModel('product')->getById($productID);
|
||||
$bug = $this->bug->getById($bugID);
|
||||
$branch = $product->type == 'branch' ? ($bug->branch > 0 ? $bug->branch . ',0' : '0') : '';
|
||||
$branch = $bug->branch > 0 ? $bug->branch . ',0' : '0';
|
||||
$branch = $product->type == 'branch' ? $branch : '';
|
||||
$productBugs = $this->bug->getProductBugPairs($productID, $branch);
|
||||
unset($productBugs[$bugID]);
|
||||
|
||||
|
||||
@@ -1254,11 +1254,10 @@ class bugModel extends model
|
||||
* Close a bug.
|
||||
*
|
||||
* @param object $bug
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function close(object $bug, string $extra = '')
|
||||
public function close(object $bug)
|
||||
{
|
||||
$this->dao->update(TABLE_BUG)
|
||||
->data($bug, 'comment')
|
||||
@@ -1290,12 +1289,13 @@ class bugModel extends model
|
||||
* 处理弹窗关闭bug的情况。
|
||||
* Handle close bug from only body.
|
||||
*
|
||||
* @param int $executionId
|
||||
* @param int $extra
|
||||
* @param int $executionId
|
||||
* @param string $extra
|
||||
* @param string $extra
|
||||
* @access public
|
||||
* @return viod
|
||||
*/
|
||||
public function handleOnlyBodyAfterClose($executionId, $extra)
|
||||
public function handleOnlyBodyAfterClose($executionId, $extra, $from)
|
||||
{
|
||||
if(!isonlybody()) return;
|
||||
|
||||
|
||||
@@ -241,7 +241,6 @@ class bugTao extends bugModel
|
||||
{
|
||||
if(in_array($changedBugID, $addedLinkBugs))
|
||||
{
|
||||
$currentLinkBug = $bugID;
|
||||
$linkBugs = explode(',', $linkBugs);
|
||||
if(!empty($linkBugs) && !in_array($bugID, $linkBugs)) $linkBugs[] = $bugID;
|
||||
}
|
||||
|
||||
+2
-5
@@ -558,7 +558,7 @@ class bugZen extends bug
|
||||
$stories = $this->story->getProductStoryPairs($productID, $branch, $moduleID, 'all','id_desc', 0, 'full', 'story', false);
|
||||
}
|
||||
|
||||
return $this->updateBugTemplete($bugTpl, array('stories' => $stories, 'builds' => $builds));
|
||||
return $this->updateBugTemplete($bugTpl, array('stories' => $stories, 'builds' => $builds, 'projectID' => $projectID));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -633,10 +633,7 @@ class bugZen extends bug
|
||||
$projectID = $bugTpl->projectID;
|
||||
$project = $bugTpl->project;
|
||||
|
||||
if($projectID and $project)
|
||||
{
|
||||
if(!$bugID or $this->app->tab != 'qa') $projects += array($projectID => $project->name);
|
||||
}
|
||||
if($projectID and $project and (!$bugID or $this->app->tab != 'qa')) $projects += array($projectID => $project->name);
|
||||
|
||||
/* Link all projects to product when copying bug under qa.*/
|
||||
if($bugID and $this->app->tab == 'qa') $projects += $this->product->getProjectPairsByProduct($productID, $branch);
|
||||
|
||||
Reference in New Issue
Block a user