This commit is contained in:
wangyidong
2015-09-10 16:47:34 +08:00
parent 5c13559737
commit e084f9c2fd
4 changed files with 20 additions and 17 deletions
+3 -2
View File
@@ -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();
}
-1
View File
@@ -1,2 +1 @@
.alert>[class*="icon-"]+.content {padding-left: 20px;}
#featurebar {display: none}
+10 -13
View File
@@ -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;
+7 -1
View File
@@ -17,6 +17,11 @@
<div class='actions'>
<?php echo html::a($this->createLink('product', 'create'), "<i class='icon-plus'></i> " . $lang->product->create,'', "class='btn'") ?>
</div>
<ul class='nav'>
<?php echo "<li id='noclosedTab'>" . html::a(inlink("index", "locate=no&productID=$productID&status=noclosed"), $lang->product->unclosed) . '</li>';?>
<?php echo "<li id='closedTab'>" . html::a(inlink("index", "locate=no&productID=$productID&status=closed"), $lang->product->statusList['closed']) . '</li>';?>
<?php echo "<li id='allTab'>" . html::a(inlink("index", "locate=no&productID=$productID&status=all"), $lang->product->allProduct) . '</li>';?>
</ul>
</div>
<div class='block' id='productbox'>
@@ -34,7 +39,7 @@
<?php $canOrder = (common::hasPriv('product', 'updateOrder') and strpos($orderBy, 'order') !== false)?>
<form method='post' action='<?php echo inLink('batchEdit', "productID=$productID");?>'>
<table class='table table-condensed table-hover table-striped tablesorter'>
<?php $vars = "locate=no&productID=$productID&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<?php $vars = "locate=no&productID=$productID&status=$status&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<thead>
<tr>
<th class='w-id'><?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
@@ -97,5 +102,6 @@
</form>
<?php endif;?>
</div>
<script>$("#<?php echo $status;?>Tab").addClass('active');</script>
<?php js::set('orderBy', $orderBy)?>
<?php include '../../common/view/footer.html.php';?>