* [misc,done,0.1h] optimize code.
This commit is contained in:
+8
-8
@@ -1213,6 +1213,13 @@ class bugZen extends bug
|
||||
*/
|
||||
protected function assignVarsForEdit(object $bug): void
|
||||
{
|
||||
/* Add product related to the bug when it is not in the products. */
|
||||
if(!isset($this->products[$bug->product]))
|
||||
{
|
||||
$this->products[$bug->product] = $product->name;
|
||||
$this->view->products = $this->products;
|
||||
}
|
||||
|
||||
$product = $this->loadModel('product')->fetchByID($bug->product);
|
||||
if(empty($product->shadow))
|
||||
{
|
||||
@@ -1220,18 +1227,11 @@ class bugZen extends bug
|
||||
$productList = $this->loadModel('product')->getByIdList(array_keys($products));
|
||||
foreach($products as $id => $name)
|
||||
{
|
||||
if(!empty($productList[$id]->shadow) || $productList[$id]->status == 'closed') unset($products[$id]);
|
||||
if($id != $bug->product && (!empty($productList[$id]->shadow) || $productList[$id]->status == 'closed')) unset($products[$id]);
|
||||
}
|
||||
$this->view->products = $products;
|
||||
}
|
||||
|
||||
/* Add product related to the bug when it is not in the products. */
|
||||
if(!isset($this->products[$bug->product]))
|
||||
{
|
||||
$this->products[$bug->product] = $product->name;
|
||||
$this->view->products = $this->products;
|
||||
}
|
||||
|
||||
if($bug->execution)
|
||||
{
|
||||
$openedBuilds = $this->loadModel('build')->getBuildPairs(array($bug->product), $bug->branch, 'noempty,noterminate,nodone,withbranch,noreleased,nofail', $bug->execution, 'execution');
|
||||
|
||||
Reference in New Issue
Block a user