* Change data structure and show root line for the all page of product module.
This commit is contained in:
@@ -9,72 +9,40 @@ $extendFields = $this->product->getFlowExtendFields();
|
||||
$data = array();
|
||||
$totalStories = 0;
|
||||
$programs = array();
|
||||
foreach($productStructure as $proID => $program)
|
||||
|
||||
foreach($productStats as $productID => $product)
|
||||
{
|
||||
if(isset($programLines[$proID]))
|
||||
$item = new stdClass();
|
||||
|
||||
if(!empty($product->PO))
|
||||
{
|
||||
foreach($programLines[$proID] as $lineID => $lineName)
|
||||
{
|
||||
if(!isset($program[$lineID]))
|
||||
{
|
||||
$program[$lineID] = array();
|
||||
$program[$lineID]['product'] = '';
|
||||
$program[$lineID]['lineName'] = $lineName;
|
||||
}
|
||||
}
|
||||
$item->PO = zget($users, $product->PO);
|
||||
$item->POAvatar = $avatarList[$product->PO];
|
||||
$item->POAccount = $product->PO;
|
||||
}
|
||||
$totalStories = $product->stories['finishClosed'] + $product->stories['unclosed'];
|
||||
|
||||
if(isset($program['programName']))
|
||||
{
|
||||
$pro = new stdClass();
|
||||
$pro->id = $program['id'];
|
||||
$pro->name = $program['programName'];
|
||||
$pro->parent = null;
|
||||
$item->name = $product->name; /* TODO replace with <a> */
|
||||
$item->id = $product->id;
|
||||
$item->type = 'product';
|
||||
$item->draftStories = $product->stories['draft'];
|
||||
$item->activeStories = $product->stories['active'];
|
||||
$item->changingStories = $product->stories['changing'];
|
||||
$item->reviewingStories = $product->stories['reviewing'];
|
||||
$item->storyCompleteRate = ($totalStories == 0 ? 0 : round($product->stories['finishClosed'] / $totalStories, 3) * 100);
|
||||
$item->unResolvedBugs = $product->unResolved;
|
||||
$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->rootLine;
|
||||
$item->execution = rand(0, 10);
|
||||
$item->feedback = rand(0, 100);
|
||||
$item->testCaseCoverage = rand(0, 100);
|
||||
$item->releasesOld = rand(0, 10);
|
||||
/* TODO attach extend fields. */
|
||||
|
||||
$programs[] = $pro;
|
||||
}
|
||||
|
||||
foreach($program as $lineID => $line)
|
||||
{
|
||||
/* Products of Product Line. */
|
||||
if(isset($line['products']) and is_array($line['products']))
|
||||
{
|
||||
foreach($line['products'] as $productID => $product)
|
||||
{
|
||||
$item = new stdClass();
|
||||
|
||||
if(!empty($product->PO))
|
||||
{
|
||||
$item->PO = zget($users, $product->PO);
|
||||
$item->POAvatar = $usersAvatar[$product->PO];
|
||||
$item->POAccount = $product->PO;
|
||||
}
|
||||
$totalStories = $product->stories['finishClosed'] + $product->stories['unclosed'];
|
||||
|
||||
$item->name = $product->name; /* TODO replace with <a> */
|
||||
$item->id = $product->id;
|
||||
$item->type = 'product';
|
||||
$item->draftStories = $product->stories['draft'];
|
||||
$item->activeStories = $product->stories['active'];
|
||||
$item->changingStories = $product->stories['changing'];
|
||||
$item->reviewingStories = $product->stories['reviewing'];
|
||||
$item->storyCompleteRate = ($totalStories == 0 ? 0 : round($product->stories['finishClosed'] / $totalStories, 3) * 100);
|
||||
$item->unResolvedBugs = $product->unResolved;
|
||||
$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->line ? $line['lineName'] : '';
|
||||
$item->execution = rand(0, 10);
|
||||
$item->feedback = rand(0, 100);
|
||||
$item->testCaseCoverage = rand(0, 100);
|
||||
$item->releasesOld = rand(0, 10);
|
||||
/* TODO attach extend fields. */
|
||||
|
||||
$data[] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
$data[] = $item;
|
||||
}
|
||||
|
||||
$programMenuLink = createLink(
|
||||
@@ -148,7 +116,6 @@ toolbar
|
||||
|
||||
|
||||
jsVar('langSummary', $lang->product->pageSummary);
|
||||
|
||||
dtable
|
||||
(
|
||||
set::cols($cols),
|
||||
|
||||
Reference in New Issue
Block a user