diff --git a/module/product/control.php b/module/product/control.php index a82b881d46..eddbee8c29 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -47,7 +47,7 @@ class product extends control * @access public * @return void */ - public function index($locate = 'yes', $productID = 0, $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 10, $pageID = 1) + public function index($locate = 'yes', $productID = 0, $status = 'noclosed', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 10, $pageID = 1) { if($locate == 'yes') $this->locate($this->createLink($this->moduleName, 'browse')); @@ -61,12 +61,13 @@ class product extends control $this->app->loadLang('my'); $this->view->title = $this->lang->product->allProduct; $this->view->position[] = $this->lang->product->allProduct; - $this->view->productStats = $this->product->getStats($orderBy, $pager); + $this->view->productStats = $this->product->getStats($orderBy, $pager, $status); $this->view->productID = $productID; $this->view->pager = $pager; $this->view->recTotal = $pager->recTotal; $this->view->recPerPage = $pager->recPerPage; $this->view->orderBy = $orderBy; + $this->view->status = $status; $this->display(); } diff --git a/module/product/css/index.css b/module/product/css/index.css index 85301c3456..0cf8b873ef 100644 --- a/module/product/css/index.css +++ b/module/product/css/index.css @@ -1,2 +1 @@ .alert>[class*="icon-"]+.content {padding-left: 20px;} -#featurebar {display: none} diff --git a/module/product/model.php b/module/product/model.php index 041a760e33..d2b851e951 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -144,7 +144,7 @@ class productModel extends model { return $this->dao->select('*')->from(TABLE_PRODUCT) ->where('deleted')->eq(0) - ->beginIF($status = 'noclosed')->andWhere('status')->ne('closed')->fi() + ->beginIF($status == 'noclosed')->andWhere('status')->ne('closed')->fi() ->beginIF($status != 'all' and $status != 'noclosed')->andWhere('status')->in($status)->fi() ->beginIF($limit > 0)->limit($limit)->fi() ->orderBy('`order` desc') @@ -479,13 +479,13 @@ class productModel extends model * @access public * @return array */ - public function getStats($orderBy = 'order_desc', $pager = null) + public function getStats($orderBy = 'order_desc', $pager = null, $status = 'noclosed') { $this->loadModel('report'); $this->loadModel('story'); $this->loadModel('bug'); - $products = $this->getList(',normal'); + $products = $this->getList($status); foreach($products as $productID => $product) { if(!$this->checkPriv($product)) unset($products[$productID]); @@ -558,17 +558,14 @@ class productModel extends model ->fetchPairs(); foreach($products as $key => $product) { - if($product->status != 'closed') - { - $product->stories = $stories[$product->id]; - $product->plans = isset($plans[$product->id]) ? $plans[$product->id] : 0; - $product->releases= isset($releases[$product->id]) ? $releases[$product->id] : 0; + $product->stories = $stories[$product->id]; + $product->plans = isset($plans[$product->id]) ? $plans[$product->id] : 0; + $product->releases= isset($releases[$product->id]) ? $releases[$product->id] : 0; - $product->bugs = isset($bugs[$product->id]) ? $bugs[$product->id] : 0; - $product->unResolved = isset($unResolved[$product->id]) ? $unResolved[$product->id] : 0; - $product->assignToNull = isset($assignToNull[$product->id]) ? $assignToNull[$product->id] : 0; - $stats[] = $product; - } + $product->bugs = isset($bugs[$product->id]) ? $bugs[$product->id] : 0; + $product->unResolved = isset($unResolved[$product->id]) ? $unResolved[$product->id] : 0; + $product->assignToNull = isset($assignToNull[$product->id]) ? $assignToNull[$product->id] : 0; + $stats[] = $product; } return $stats; diff --git a/module/product/view/index.html.php b/module/product/view/index.html.php index fda19fa61e..5fd0c8c7d0 100644 --- a/module/product/view/index.html.php +++ b/module/product/view/index.html.php @@ -17,6 +17,11 @@
createLink('product', 'create'), " " . $lang->product->create,'', "class='btn'") ?>
+
@@ -34,7 +39,7 @@
'> - recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> + recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> @@ -97,5 +102,6 @@ +
idAB);?>