* product: Get root program list and render it to product list page.

This commit is contained in:
chentao
2023-05-18 16:49:20 +08:00
parent 1309b66cd6
commit 3f002a6018
2 changed files with 13 additions and 11 deletions
+10 -6
View File
@@ -579,21 +579,25 @@ class product extends control
/* Set env data. */
$this->productZen->setMenu4All();
/* Generate statistics of products and program. */
/* Generate statistics of products. */
if($this->config->systemMode == 'light' && $orderBy == 'program_asc') $orderBy = 'order_asc';
$this->app->loadClass('pager', true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$queryID = ($browseType == 'bySearch' or !empty($param)) ? $param : 0;
if($this->config->systemMode == 'light' and $orderBy == 'program_asc') $orderBy = 'order_asc';
$pager = new pager($recTotal, $recPerPage, $pageID);
$queryID = ($browseType == 'bySearch' || !empty($param)) ? $param : 0;
$productStatList = $this->product->getStats($orderBy, $pager, $browseType, 0, 'story', 0, $queryID);
$productStats = $this->product->getStats($orderBy, $pager, $browseType, 0, 'story', 0, $queryID);
/* Generate root program list. */
$rootProgramList = $this->productZen->getRootProgramList($productStatList);
/* Save search form. */
$actionURL = $this->createLink('product', 'all', "browseType=bySearch&orderBy=order_asc&queryID=myQueryID");
$this->product->buildProductSearchForm($param, $actionURL);
/* Assign. */
$this->view->title = $this->lang->productCommon;
$this->view->recTotal = $pager->recTotal;
$this->view->productStats = $productStats;
$this->view->productStats = $productStatList;
$this->view->programList = $rootProgramList;
$this->view->users = $this->user->getPairs('noletter');
$this->view->userIdPairs = $this->user->getPairs('noletter|showid');
$this->view->avatarList = $this->user->getAvatarPairs('');
+3 -5
View File
@@ -14,7 +14,6 @@ foreach($cols as &$col)
$data = array();
$totalStories = 0;
$programs = array();
foreach($productStats as $productID => $product)
{
@@ -28,7 +27,7 @@ foreach($productStats as $productID => $product)
}
$totalStories = $product->stories['finishClosed'] + $product->stories['unclosed'];
$item->name = $product->name; /* TODO replace with <a> */
$item->name = $product->name;
$item->id = $product->id;
$item->type = 'product';
$item->draftStories = $product->stories['draft'];
@@ -40,7 +39,6 @@ foreach($productStats as $productID => $product)
$item->bugFixedRate = (($product->unResolved + $product->fixedBugs) == 0 ? 0 : round($product->fixedBugs / ($product->unResolved + $product->fixedBugs), 3) * 100);
$item->plans = $product->plans;
$item->releases = $product->releases;
$item->parent = null;
$item->productLine = $product->lineName;
$item->execution = $product->executions;
$item->testCaseCoverage = $product->coverage;
@@ -75,8 +73,8 @@ featureBar
array
(
'title' => $lang->program->all,
'programs' => $programs,
'activeKey' => !empty($programs) ? $programID : null,
'programs' => $programList,
'activeKey' => !empty($programList) ? $programID : null,
'closeLink' => sprintf($programMenuLink, 0),
'onClickItem' => jsRaw("function(data){window.programMenuOnClick(data, '$programMenuLink');}")
)