* Remove wait and doing testtasks, add not closed testtasks.

This commit is contained in:
liumengyi
2024-04-12 15:45:13 +08:00
parent c885e54ccd
commit aa60e79d85
6 changed files with 67 additions and 98 deletions
+12 -12
View File
@@ -599,18 +599,18 @@ $lang->block->projectstatistic->cv = 'Cost Variance(CV)';
$lang->block->projectstatistic->ac = 'Actual Cost(AC)';
$lang->block->qastatistic = new stdclass();
$lang->block->qastatistic->fixBugRate = 'Fix Bug Rate';
$lang->block->qastatistic->closedBugRate = 'Closed Bug Rate';
$lang->block->qastatistic->totalBug = 'Bug Total';
$lang->block->qastatistic->bugStatistics = 'Bug Statistics';
$lang->block->qastatistic->addYesterday = 'Added Yesterday';
$lang->block->qastatistic->addToday = 'Added Today';
$lang->block->qastatistic->resolvedYesterday = 'Resolved Yesterday';
$lang->block->qastatistic->resolvedToday = 'Resolved Today';
$lang->block->qastatistic->closedYesterday = 'Closed Yesterday';
$lang->block->qastatistic->closedToday = 'Closed Today';
$lang->block->qastatistic->latestTesttask = 'Latest Testtask';
$lang->block->qastatistic->bugStatusStat = 'Monthly bug changes';
$lang->block->qastatistic->fixBugRate = 'Fix Bug Rate';
$lang->block->qastatistic->closedBugRate = 'Closed Bug Rate';
$lang->block->qastatistic->totalBug = 'Bug Total';
$lang->block->qastatistic->bugStatistics = 'Bug Statistics';
$lang->block->qastatistic->addYesterday = 'Added Yesterday';
$lang->block->qastatistic->addToday = 'Added Today';
$lang->block->qastatistic->resolvedYesterday = 'Resolved Yesterday';
$lang->block->qastatistic->resolvedToday = 'Resolved Today';
$lang->block->qastatistic->closedYesterday = 'Closed Yesterday';
$lang->block->qastatistic->closedToday = 'Closed Today';
$lang->block->qastatistic->notClosedTesttasks = 'Not Closed Testtasks';
$lang->block->qastatistic->bugStatusStat = 'Monthly bug changes';
$lang->block->bugstatistic = new stdclass();
$lang->block->bugstatistic->effective = 'effectived';
+12 -12
View File
@@ -599,18 +599,18 @@ $lang->block->projectstatistic->cv = 'Cost Variance(CV)';
$lang->block->projectstatistic->ac = 'Actual Cost(AC)';
$lang->block->qastatistic = new stdclass();
$lang->block->qastatistic->fixBugRate = 'Fix Bug Rate';
$lang->block->qastatistic->closedBugRate = 'Closed Bug Rate';
$lang->block->qastatistic->totalBug = 'Bug Total';
$lang->block->qastatistic->bugStatistics = 'Bug Statistics';
$lang->block->qastatistic->addYesterday = 'Added Yesterday';
$lang->block->qastatistic->addToday = 'Added Today';
$lang->block->qastatistic->resolvedYesterday = 'Resolved Yesterday';
$lang->block->qastatistic->resolvedToday = 'Resolved Today';
$lang->block->qastatistic->closedYesterday = 'Closed Yesterday';
$lang->block->qastatistic->closedToday = 'Closed Today';
$lang->block->qastatistic->latestTesttask = 'Latest Testtask';
$lang->block->qastatistic->bugStatusStat = 'Monthly bug changes';
$lang->block->qastatistic->fixBugRate = 'Fix Bug Rate';
$lang->block->qastatistic->closedBugRate = 'Closed Bug Rate';
$lang->block->qastatistic->totalBug = 'Bug Total';
$lang->block->qastatistic->bugStatistics = 'Bug Statistics';
$lang->block->qastatistic->addYesterday = 'Added Yesterday';
$lang->block->qastatistic->addToday = 'Added Today';
$lang->block->qastatistic->resolvedYesterday = 'Resolved Yesterday';
$lang->block->qastatistic->resolvedToday = 'Resolved Today';
$lang->block->qastatistic->closedYesterday = 'Closed Yesterday';
$lang->block->qastatistic->closedToday = 'Closed Today';
$lang->block->qastatistic->notClosedTesttasks = 'Not Closed Testtasks';
$lang->block->qastatistic->bugStatusStat = 'Monthly bug changes';
$lang->block->bugstatistic = new stdclass();
$lang->block->bugstatistic->effective = 'effectived';
+12 -12
View File
@@ -599,18 +599,18 @@ $lang->block->projectstatistic->cv = 'Cost Variance(CV)';
$lang->block->projectstatistic->ac = 'Actual Cost(AC)';
$lang->block->qastatistic = new stdclass();
$lang->block->qastatistic->fixBugRate = 'Fix Bug Rate';
$lang->block->qastatistic->closedBugRate = 'Closed Bug Rate';
$lang->block->qastatistic->totalBug = 'Bug Total';
$lang->block->qastatistic->bugStatistics = 'Bug Statistics';
$lang->block->qastatistic->addYesterday = 'Added Yesterday';
$lang->block->qastatistic->addToday = 'Added Today';
$lang->block->qastatistic->resolvedYesterday = 'Resolved Yesterday';
$lang->block->qastatistic->resolvedToday = 'Resolved Today';
$lang->block->qastatistic->closedYesterday = 'Closed Yesterday';
$lang->block->qastatistic->closedToday = 'Closed Today';
$lang->block->qastatistic->latestTesttask = 'Latest Testtask';
$lang->block->qastatistic->bugStatusStat = 'Monthly bug changes';
$lang->block->qastatistic->fixBugRate = 'Fix Bug Rate';
$lang->block->qastatistic->closedBugRate = 'Closed Bug Rate';
$lang->block->qastatistic->totalBug = 'Bug Total';
$lang->block->qastatistic->bugStatistics = 'Bug Statistics';
$lang->block->qastatistic->addYesterday = 'Added Yesterday';
$lang->block->qastatistic->addToday = 'Added Today';
$lang->block->qastatistic->resolvedYesterday = 'Resolved Yesterday';
$lang->block->qastatistic->resolvedToday = 'Resolved Today';
$lang->block->qastatistic->closedYesterday = 'Closed Yesterday';
$lang->block->qastatistic->closedToday = 'Closed Today';
$lang->block->qastatistic->notClosedTesttasks = 'Not Closed Testtasks';
$lang->block->qastatistic->bugStatusStat = 'Monthly bug changes';
$lang->block->bugstatistic = new stdclass();
$lang->block->bugstatistic->effective = 'effectived';
+12 -12
View File
@@ -599,18 +599,18 @@ $lang->block->projectstatistic->cv = '成本偏差率(CV)';
$lang->block->projectstatistic->ac = '实际花费(AC)';
$lang->block->qastatistic = new stdclass();
$lang->block->qastatistic->fixBugRate = 'Bug修复率';
$lang->block->qastatistic->closedBugRate = 'Bug关闭率';
$lang->block->qastatistic->totalBug = 'Bug总数';
$lang->block->qastatistic->bugStatistics = 'Bug统计';
$lang->block->qastatistic->addYesterday = '昨日新增';
$lang->block->qastatistic->addToday = '今日新增';
$lang->block->qastatistic->resolvedYesterday = '昨日解决';
$lang->block->qastatistic->resolvedToday = '今日解决';
$lang->block->qastatistic->closedYesterday = '昨日关闭';
$lang->block->qastatistic->closedToday = '今日关闭';
$lang->block->qastatistic->latestTesttask = '近期测试单';
$lang->block->qastatistic->bugStatusStat = '月度Bug变化情况';
$lang->block->qastatistic->fixBugRate = 'Bug修复率';
$lang->block->qastatistic->closedBugRate = 'Bug关闭率';
$lang->block->qastatistic->totalBug = 'Bug总数';
$lang->block->qastatistic->bugStatistics = 'Bug统计';
$lang->block->qastatistic->addYesterday = '昨日新增';
$lang->block->qastatistic->addToday = '今日新增';
$lang->block->qastatistic->resolvedYesterday = '昨日解决';
$lang->block->qastatistic->resolvedToday = '今日解决';
$lang->block->qastatistic->closedYesterday = '昨日关闭';
$lang->block->qastatistic->closedToday = '今日关闭';
$lang->block->qastatistic->notClosedTesttasks = '未关闭的测试单';
$lang->block->qastatistic->bugStatusStat = '月度Bug变化情况';
$lang->block->bugstatistic = new stdclass();
$lang->block->bugstatistic->effective = '有效Bug';
+11 -32
View File
@@ -95,53 +95,32 @@ $buildProgressBars = function(object $product, bool $longBlock): node
$buildTesttasks = function(object $product, bool $longBlock): node|null
{
global $lang;
$waitTesttasks = array();
if(!empty($product->waitTesttasks))
$notClosedTesttasks = array();
if(!empty($product->notClosedTesttasks))
{
foreach($product->waitTesttasks as $waitTesttask)
foreach($product->notClosedTesttasks as $waitTesttask)
{
$waitTesttasks[] = div
$notClosedTesttasks[] = div
(
setClass('clip', $longBlock ? 'py-1' : 'py-0.5'),
hasPriv('testtask', 'cases') ? a(set('href', createLink('testtask', 'cases', "taskID={$waitTesttask->id}")), $waitTesttask->name) : span($waitTesttask->name)
);
if(count($waitTesttasks) >= 2) break;
if(count($notClosedTesttasks) >= 2) break;
}
}
$doingTesttasks = array();
if(!empty($product->doingTesttasks))
{
foreach($product->doingTesttasks as $doingTesttask)
{
$doingTesttasks[] = div
(
setClass('clip', $longBlock ? 'py-1' : 'py-0.5'),
common::hasPriv('testtask', 'cases') ? a(set('href', createLink('testtask', 'cases', "taskID={$doingTesttask->id}")), $doingTesttask->name) : span($doingTesttask->name)
);
if(count($doingTesttasks) >= 2) break;
}
}
if(empty($notClosedTesttasks) && empty($doingTesttasks)) return null;
if(empty($waitTesttasks) && empty($doingTesttasks)) return null;
return col
return $notClosedTesttasks ? col
(
setClass('min-w-0 flex-1 gap-1.5 px-3 pt-2 border-l'),
div(setClass('font-bold'), $lang->block->qastatistic->latestTesttask),
empty($doingTesttasks) ? null : div
div(setClass('font-bold'), $lang->block->qastatistic->notClosedTesttasks),
div
(
setClass($longBlock ? 'py-2' : 'pt-2'),
div(setClass('text-sm', $longBlock ? 'pb-2' : 'pb-1'), $lang->testtask->statusList['doing']),
$doingTesttasks
$notClosedTesttasks
),
empty($waitTesttasks) ? null : div
(
setClass($longBlock ? 'py-2' : 'pt-2'),
div(setClass('text-sm', $longBlock ? 'pb-2' : 'pb-1'), $lang->testtask->statusList['wait']),
$waitTesttasks
)
);
) : null;
};
$testTasksView = !empty($product) ? $buildTesttasks($product, $longBlock) : null;
+8 -18
View File
@@ -1598,24 +1598,15 @@ class blockZen extends block
if(!empty($fixedBug)) $fixedBug = array_column($fixedBug, null, 'product');
if(!empty($activatedBug)) $activatedBug = array_column($activatedBug, null, 'product');
$productIdList = array_keys($products);
$doingTesttasks = $this->dao->select('product,id,name')->from(TABLE_TESTTASK)
$productIdList = array_keys($products);
$notClosedTesttasks = $this->dao->select('product,id,name')->from(TABLE_TESTTASK)
->where('product')->in($productIdList)
->andWhere('project')->ne(0)
->andWhere('status')->eq('doing')
->andWhere('status')->ne('closed')
->andWhere('deleted')->eq(0)
->orderBy('begin_asc')
->fetchGroup('product');
$waitTesttasks = $this->dao->select('product,id,name')->from(TABLE_TESTTASK)
->where('product')->in($productIdList)
->andWhere('project')->ne(0)
->andWhere('status')->eq('wait')
->andWhere('deleted')->eq(0)
->andWhere('begin')->ge(date('Y-m-d'))
->orderBy('begin_desc')
->fetchGroup('product');
/* 将获取出的度量项数据塞入产品列表数据中。 */
foreach($products as $productID => $product)
{
@@ -1655,12 +1646,11 @@ class blockZen extends block
}
}
$product->fixedBugRate = isset($bugFixRate[$productID]['value']) ? $bugFixRate[$productID]['value'] * 100 : 0;
$product->totalBug = isset($effectiveBug[$productID]['value']) ? $effectiveBug[$productID]['value'] : 0;
$product->fixedBug = isset($fixedBug[$productID]['value']) ? $fixedBug[$productID]['value'] : 0;
$product->activatedBug = isset($activatedBug[$productID]['value']) ? $activatedBug[$productID]['value'] : 0;
$product->waitTesttasks = isset($waitTesttasks[$productID]) ? $waitTesttasks[$productID] : '';
$product->doingTesttasks = isset($doingTesttasks[$productID]) ? $doingTesttasks[$productID] : '';
$product->fixedBugRate = isset($bugFixRate[$productID]['value']) ? $bugFixRate[$productID]['value'] * 100 : 0;
$product->totalBug = isset($effectiveBug[$productID]['value']) ? $effectiveBug[$productID]['value'] : 0;
$product->fixedBug = isset($fixedBug[$productID]['value']) ? $fixedBug[$productID]['value'] : 0;
$product->activatedBug = isset($activatedBug[$productID]['value']) ? $activatedBug[$productID]['value'] : 0;
$product->notClosedTesttasks = isset($notClosedTesttasks[$productID]) ? $notClosedTesttasks[$productID] : '';
}
$this->view->products = $products;