diff --git a/module/product/control.php b/module/product/control.php index 1dd5194a89..dd8414c6d9 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -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; } diff --git a/module/product/model.php b/module/product/model.php index c1a49205d1..b06644f03a 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -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() diff --git a/module/productplan/control.php b/module/productplan/control.php index 1bd51618a2..c4747b6a0c 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -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; diff --git a/module/testcase/control.php b/module/testcase/control.php index 87aa6c4891..1d756a85a9 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -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, ''); }