* Fix bug #14957.
This commit is contained in:
@@ -30,7 +30,7 @@ class product extends control
|
||||
$this->loadModel('user');
|
||||
|
||||
/* Get all products, if no, goto the create page. */
|
||||
$this->products = $this->product->getPairs('nocode');
|
||||
$this->products = $this->product->getPairs('nocode|all');
|
||||
if(empty($this->products) and strpos(',create,index,showerrornone,ajaxgetdropmenu,', $this->methodName) === false and $this->app->getViewType() != 'mhtml') $this->locate($this->createLink('product', 'create'));
|
||||
$this->view->products = $this->products;
|
||||
}
|
||||
|
||||
@@ -150,7 +150,8 @@ class productModel extends model
|
||||
if($productID == 0 and $this->session->product == '') $this->session->set('product', key($products));
|
||||
if(!isset($products[$this->session->product]))
|
||||
{
|
||||
$this->session->set('product', key($products));
|
||||
$product = $this->getById($productID);
|
||||
if(empty($product)) $this->session->set('product', key($products));
|
||||
if($productID && strpos(",{$this->app->user->view->products},", ",{$this->session->product},") === false) $this->accessDenied();
|
||||
}
|
||||
if($this->cookie->preProductID != $productID)
|
||||
@@ -287,7 +288,7 @@ class productModel extends model
|
||||
$orderBy = !empty($this->config->product->orderBy) ? $this->config->product->orderBy : 'isClosed';
|
||||
$products = $this->dao->select('*, IF(INSTR(" closed", status) < 2, 0, 1) AS isClosed')
|
||||
->from(TABLE_PRODUCT)
|
||||
->where('deleted')->eq(0)
|
||||
->beginIF(strpos($mode, 'all') === false)->where('deleted')->eq(0)->fi()
|
||||
->beginIF($programID)->andWhere('program')->eq($programID)->fi()
|
||||
->beginIF(strpos($mode, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->products)->fi()
|
||||
|
||||
@@ -218,9 +218,16 @@ class productplan extends control
|
||||
$sort = $this->loadModel('common')->appendOrder($orderBy);
|
||||
$this->session->set('productPlanList', $this->app->getURI(true), 'product');
|
||||
|
||||
if(isset($products[$productID])) $productName = $products[$productID];
|
||||
if(!isset($products[$productID]))
|
||||
{
|
||||
$product = $this->loadModel('product')->getById($productID);
|
||||
$productName = empty($product) ? '' : $product->name;
|
||||
}
|
||||
|
||||
$this->commonAction($productID, $branch);
|
||||
$products = $this->product->getPairs();
|
||||
$this->view->title = $products[$productID] . $this->lang->colon . $this->lang->productplan->browse;
|
||||
$this->view->title = $productName . $this->lang->colon . $this->lang->productplan->browse;
|
||||
$this->view->position[] = $this->lang->productplan->browse;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->branch = $branch;
|
||||
|
||||
@@ -659,11 +659,11 @@ class testcase extends control
|
||||
if($this->app->tab == 'execution') $this->loadModel('execution')->setMenu($this->session->execution);
|
||||
if($this->app->tab == 'qa') $this->testcase->setMenu($this->products, $productID, $case->branch);
|
||||
|
||||
$this->view->title = "CASE #$case->id $case->title - " . $this->products[$productID];
|
||||
$this->view->title = "CASE #$case->id $case->title - " . $product->name;
|
||||
|
||||
$this->view->product = $product;
|
||||
$this->view->branches = $branches;
|
||||
$this->view->productName = isset($this->products[$productID]) ? $this->products[$productID] : '';
|
||||
$this->view->productName = $product->name;
|
||||
$this->view->branchName = $product->type == 'normal' ? '' : zget($branches, $case->branch, '');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user