This commit is contained in:
wangyidong
2024-01-09 13:22:20 +08:00
parent bd69bf0ca4
commit 4e88cce11a
7 changed files with 37 additions and 33 deletions
+7 -3
View File
@@ -84,11 +84,12 @@ window.setStatistics = function(element, checkedIdList, pageSummary)
{
if(checkedIdList.length == 0) return {html: pageSummary};
let total = checkedIdList.length;
let total = 0;
let SRTotal = 0;
let estimate = 0;
let rate = '0%';
let hasCase = 0;
let rateCount = total;
let rateCount = checkedIdList.length;
const rows = element.layout.allRows;
rows.forEach((row) => {
@@ -104,10 +105,13 @@ window.setStatistics = function(element, checkedIdList, pageSummary)
{
rateCount -= 1;
}
if(storyType == story.type) total += 1;
if(storyType == 'requirement' && story.type == 'story') SRTotal += 1;
}
})
if(rateCount) rate = Math.round(hasCase / rateCount * 10000 / 100) + '' + '%';
return {html: checkedSummary.replace('%total%', total).replace('%estimate%', estimate).replace('%rate%', rate)};
return {html: checkedSummary.replace('%total%', total).replace('%estimate%', estimate).replace('%rate%', rate).replace('%SRTotal%', SRTotal)};
};
+4 -4
View File
@@ -217,10 +217,10 @@ $lang->product->abbr->aclList['open'] = 'Default';
$lang->product->aclTips['open'] = "Benutzer mit Rechten für {$lang->productCommon} können zugreifen.";
$lang->product->aclTips['private'] = "{$lang->executionCommon} Nur Teammitglieder";
$lang->product->storySummary = " <strong>%s</strong> %s, <strong>%s</strong> Stunde(n) geplant, Fallabdeckung ist <strong>%s</strong> auf dieser Seite.";
$lang->product->checkedSRSummary = " <strong>%total%</strong> geprüft, <strong>%estimate%</strong> Stunde(n) geplant, Fallabdeckung ist <strong>%rate%</strong>.";
$lang->product->requirementSummary = " <strong>%s</strong> %s, <strong>%s</strong> Stunde(n) geplant.";
$lang->product->checkedURSummary = " <strong>%total%</strong> geprüft, <strong>%estimate%</strong> Stunde(n) geplant.";
$lang->product->storySummary = " <strong>%s</strong> {$lang->SRCommon}, <strong>%s</strong> Stunde(n) geplant, Fallabdeckung ist <strong>%s</strong> auf dieser Seite.";
$lang->product->checkedSRSummary = " <strong>%total%</strong> {$lang->SRCommon}, <strong>%estimate%</strong> Stunde(n) geplant, Fallabdeckung ist <strong>%rate%</strong>.";
$lang->product->requirementSummary = " <strong>%s</strong> {$lang->URCommon}, <strong>%s</strong> {$lang->SRCommon}, <strong>%s</strong> Stunde(n) geplant.";
$lang->product->checkedURSummary = " <strong>%total%</strong> {$lang->URCommon}, <strong>%SRTotal%</strong> {$lang->SRCommon}, <strong>%estimate%</strong> Stunde(n) geplant.";
$lang->product->noModule = '<div>Kein Modul</div><div>Jetzt verwalten</div>';
$lang->product->noProduct = 'Kein Produkt. ';
$lang->product->noMatched = '"%s" kann nicht gefunden werden.' . $lang->productCommon;
+3 -3
View File
@@ -217,10 +217,10 @@ $lang->product->abbr->aclList['open'] = 'Default';
$lang->product->aclTips['open'] = "Users with privileges to {$lang->productCommon} can access it.";
$lang->product->aclTips['private'] = "{$lang->executionCommon} team members only";
$lang->product->storySummary = "Total <strong>%s</strong> %s on this page. Estimates: <strong>%s</strong> ({$lang->hourCommon}), and Case Coverage: <strong>%s</strong>.";
$lang->product->storySummary = "Total <strong>%s</strong> {$lang->SRCommon} on this page. Estimates: <strong>%s</strong> ({$lang->hourCommon}), and Case Coverage: <strong>%s</strong>.";
$lang->product->checkedSRSummary = "<strong>%total%</strong> {$lang->SRCommon} selected, Esitmates: <strong>%estimate%</strong> ({$lang->hourCommon}), and Case Coverage: <strong>%rate%</strong>.";
$lang->product->requirementSummary = "Total <strong>%s</strong> %s on this page. Estimates: <strong>%s</strong> ({$lang->hourCommon}).";
$lang->product->checkedURSummary = "<strong>%total%</strong> {$lang->URCommon} selected, Esitmates: <strong>%estimate%</strong> ({$lang->hourCommon}).";
$lang->product->requirementSummary = "Total <strong>%s</strong> {$lang->URCommon}, <strong>%s</strong> {$lang->SRCommon} on this page. Estimates: <strong>%s</strong> ({$lang->hourCommon}).";
$lang->product->checkedURSummary = "<strong>%total%</strong> {$lang->URCommon}, <strong>%SRTotal%</strong> {$lang->SRCommon} selected, Esitmates: <strong>%estimate%</strong> ({$lang->hourCommon}).";
$lang->product->noModule = '<div>You have no modules. </div><div>Manage Now</div>';
$lang->product->noProduct = "No {$lang->productCommon} yet. ";
$lang->product->noMatched = '"%s" cannot be found.' . $lang->productCommon;
+3 -3
View File
@@ -217,10 +217,10 @@ $lang->product->abbr->aclList['open'] = 'Défaut';
$lang->product->aclTips['open'] = "Les utilisateurs ayant des droits sur {$lang->productCommon} peuvent accéder à ce {$lang->productCommon}.";
$lang->product->aclTips['private'] = "les membres de l'équipe et les membres de la Liste blanche peuvent y accéder.";
$lang->product->storySummary = "Total de <strong>%s</strong> %s sur cette page. Estimé: <strong>%s</strong> (h), et couverture de la recette: <strong>%s</strong>.";
$lang->product->storySummary = "Total de <strong>%s</strong> {$lang->SRCommon} sur cette page. Estimé: <strong>%s</strong> (h), et couverture de la recette: <strong>%s</strong>.";
$lang->product->checkedSRSummary = "<strong>%total%</strong> {$lang->SRCommon} sélectionnées, Estimé: <strong>%estimate%</strong>, et couverture de la recette: <strong>%rate%</strong>.";
$lang->product->requirementSummary = "Total de <strong>%s</strong> %s sur cette page. Estimé: <strong>%s</strong> (h),.";
$lang->product->checkedURSummary = "<strong>%total%</strong> {$lang->URCommon} sélectionnées, Estimé: <strong>%estimate%</strong>,.";
$lang->product->requirementSummary = "Total de <strong>%s</strong> {$lang->URCommon}, <strong>%s</strong> {$lang->SRCommon} sur cette page. Estimé: <strong>%s</strong> (h),.";
$lang->product->checkedURSummary = "<strong>%total%</strong> {$lang->URCommon}, <strong>%SRTotal%</strong> {$lang->SRCommon} sélectionnées, Estimé: <strong>%estimate%</strong>,.";
$lang->product->noModule = "<div>Vous n'avez aucun modules. </div><div>Gérer Maintenant</div>";
$lang->product->noProduct = "No {$lang->productCommon} à ce jour. ";
$lang->product->noMatched = '"%s" cannot be found.' . $lang->productCommon;
+3 -3
View File
@@ -217,10 +217,10 @@ $lang->product->abbr->aclList['open'] = '公开';
$lang->product->aclTips['open'] = "有{$lang->productCommon}视图权限,即可访问";
$lang->product->aclTips['private'] = "{$lang->productCommon}相关负责人、所属项目集的干系人、相关联{$lang->projectCommon}的团队成员和干系人可访问";
$lang->product->storySummary = "本页共 <strong>%s</strong> 个%s,预计 <strong>%s</strong> 个{$lang->hourCommon},用例覆盖率 <strong>%s</strong>。";
$lang->product->storySummary = "本页共 <strong>%s</strong> 个{$lang->SRCommon},预计 <strong>%s</strong> 个{$lang->hourCommon},用例覆盖率 <strong>%s</strong>。";
$lang->product->checkedSRSummary = "选中 <strong>%total%</strong> 个{$lang->SRCommon},预计 <strong>%estimate%</strong> 个{$lang->hourCommon},用例覆盖率 <strong>%rate%</strong>。";
$lang->product->requirementSummary = "本页共 <strong>%s</strong> 个%s,预计 <strong>%s</strong> 个{$lang->hourCommon}。";
$lang->product->checkedURSummary = "选中 <strong>%total%</strong> 个{$lang->URCommon},预计 <strong>%estimate%</strong> 个{$lang->hourCommon}。";
$lang->product->requirementSummary = "本页共 <strong>%s</strong> 个{$lang->URCommon},<strong>%s</strong>个{$lang->SRCommon},预计 <strong>%s</strong> 个{$lang->hourCommon}。";
$lang->product->checkedURSummary = "选中 <strong>%total%</strong> 个{$lang->URCommon},<strong>%SRTotal%</strong>个{$lang->SRCommon},预计 <strong>%estimate%</strong> 个{$lang->hourCommon}。";
$lang->product->noModule = "<div>您现在还没有模块信息</div><div>请维护模块</div>";
$lang->product->noProduct = "暂时没有{$lang->productCommon}。";
$lang->product->noMatched = '找不到包含"%s"的' . $lang->productCommon;
+5 -5
View File
@@ -1187,8 +1187,10 @@ class productModel extends model
$rateCount = 0;
$allCount = 0;
$SRTotal = 0;
foreach($stories as $story)
{
if($storyType == 'requirement' && $story->type == 'story') $SRTotal += 1;
if(!empty($story->type) && $story->type != $storyType) continue;
$totalEstimate += $story->estimate;
@@ -1204,6 +1206,7 @@ class productModel extends model
if(empty($story->children)) continue;
foreach($story->children as $child)
{
if($storyType == 'requirement' && $child->type == 'story') $SRTotal += 1;
if($child->type != $storyType) continue;
$allCount ++;
@@ -1218,11 +1221,8 @@ class productModel extends model
$casesCount = count($this->productTao->filterNoCasesStory($storyIdList));
$rate = empty($stories) || $rateCount == 0 ? 0 : round($casesCount / $rateCount, 2);
$storyCommon = $this->lang->SRCommon;
if($storyType == 'requirement') $storyCommon = $this->lang->URCommon;
$summary = $storyType == 'story' ? $this->lang->product->storySummary : $this->lang->product->requirementSummary;
return sprintf($summary, $allCount, $storyCommon, $totalEstimate, $rate * 100 . "%");
if($storyType == 'story') return sprintf($this->lang->product->storySummary, $allCount, $totalEstimate, $rate * 100 . "%");
return sprintf($this->lang->product->requirementSummary, $allCount, $SRTotal, $totalEstimate);
}
/**
+12 -12
View File
@@ -7,14 +7,14 @@ title=productModel->summary();
cid=0
- 获取正确的产品的需求统计 @本页共 <strong>2</strong> 个研发需求,预计 <strong>10</strong> 个工时,用例覆盖率 <strong>50%%</strong>。
- 获取正确的产品的需求统计 @本页共 <strong>1</strong> 个用户需求,预计 <strong>1</strong> 个工时。
- 获取正确的产品的需求统计 @本页共 <strong>0</strong> 个研发需求,预计 <strong>0</strong> 个工时。
- 获取正确的产品的需求统计 @本页共 <strong>1</strong> 个用户需求,<strong>0</strong>个研发需求,预计 <strong>1</strong> 个工时。
- 获取正确的产品的需求统计 @本页共 <strong>0</strong> 个用户需求,<strong>0</strong>个研发需求,预计 <strong>0</strong> 个工时。
- 获取空的产品的需求统计 @本页共 <strong>0</strong> 个研发需求,预计 <strong>0</strong> 个工时,用例覆盖率 <strong>0%%</strong>。
- 获取空的产品的需求统计 @本页共 <strong>0</strong> 个用户需求,预计 <strong>0</strong> 个工时。
- 获取空的产品的需求统计 @本页共 <strong>0</strong> 个研发需求,预计 <strong>0</strong> 个工时。
- 获取空的产品的需求统计 @本页共 <strong>0</strong> 个用户需求,<strong>0</strong>个研发需求,预计 <strong>0</strong> 个工时。
- 获取空的产品的需求统计 @本页共 <strong>0</strong> 个用户需求,<strong>0</strong>个研发需求,预计 <strong>0</strong> 个工时。
- 获取错误的产品的需求统计 @本页共 <strong>0</strong> 个研发需求,预计 <strong>0</strong> 个工时,用例覆盖率 <strong>0%%</strong>。
- 获取错误的产品的需求统计 @本页共 <strong>0</strong> 个用户需求,预计 <strong>0</strong> 个工时。
- 获取错误的产品的需求统计 @本页共 <strong>0</strong> 个研发需求,预计 <strong>0</strong> 个工时。
- 获取错误的产品的需求统计 @本页共 <strong>0</strong> 个用户需求,<strong>0</strong>个研发需求,预计 <strong>0</strong> 个工时。
- 获取错误的产品的需求统计 @本页共 <strong>0</strong> 个用户需求,<strong>0</strong>个研发需求,预计 <strong>0</strong> 个工时。
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
@@ -32,13 +32,13 @@ $typeList = array('story', 'requirement', 'error');
$product = new productTest('admin');
r($product->summaryTest($productIDList[0], $typeList[0])) && p() && e('本页共 <strong>2</strong> 个研发需求,预计 <strong>10</strong> 个工时,用例覆盖率 <strong>50%%</strong>。'); // 获取正确的产品的需求统计
r($product->summaryTest($productIDList[0], $typeList[1])) && p() && e('本页共 <strong>1</strong> 个用户需求,预计 <strong>1</strong> 个工时。'); // 获取正确的产品的需求统计
r($product->summaryTest($productIDList[0], $typeList[2])) && p() && e('本页共 <strong>0</strong> 个研发需求,预计 <strong>0</strong> 个工时。'); // 获取正确的产品的需求统计
r($product->summaryTest($productIDList[0], $typeList[1])) && p() && e('本页共 <strong>1</strong> 个用户需求,<strong>0</strong>个研发需求,预计 <strong>1</strong> 个工时。'); // 获取正确的产品的需求统计
r($product->summaryTest($productIDList[0], $typeList[2])) && p() && e('本页共 <strong>0</strong> 个用户需求,<strong>0</strong>个研发需求,预计 <strong>0</strong> 个工时。'); // 获取正确的产品的需求统计
r($product->summaryTest($productIDList[1], $typeList[0])) && p() && e('本页共 <strong>0</strong> 个研发需求,预计 <strong>0</strong> 个工时,用例覆盖率 <strong>0%%</strong>。'); // 获取空的产品的需求统计
r($product->summaryTest($productIDList[1], $typeList[1])) && p() && e('本页共 <strong>0</strong> 个用户需求,预计 <strong>0</strong> 个工时。'); // 获取空的产品的需求统计
r($product->summaryTest($productIDList[1], $typeList[2])) && p() && e('本页共 <strong>0</strong> 个研发需求,预计 <strong>0</strong> 个工时。'); // 获取空的产品的需求统计
r($product->summaryTest($productIDList[1], $typeList[1])) && p() && e('本页共 <strong>0</strong> 个用户需求,<strong>0</strong>个研发需求,预计 <strong>0</strong> 个工时。'); // 获取空的产品的需求统计
r($product->summaryTest($productIDList[1], $typeList[2])) && p() && e('本页共 <strong>0</strong> 个用户需求,<strong>0</strong>个研发需求,预计 <strong>0</strong> 个工时。'); // 获取空的产品的需求统计
r($product->summaryTest($productIDList[2], $typeList[0])) && p() && e('本页共 <strong>0</strong> 个研发需求,预计 <strong>0</strong> 个工时,用例覆盖率 <strong>0%%</strong>。'); // 获取错误的产品的需求统计
r($product->summaryTest($productIDList[2], $typeList[1])) && p() && e('本页共 <strong>0</strong> 个用户需求,预计 <strong>0</strong> 个工时。'); // 获取错误的产品的需求统计
r($product->summaryTest($productIDList[2], $typeList[2])) && p() && e('本页共 <strong>0</strong> 个研发需求,预计 <strong>0</strong> 个工时。'); // 获取错误的产品的需求统计
r($product->summaryTest($productIDList[2], $typeList[1])) && p() && e('本页共 <strong>0</strong> 个用户需求,<strong>0</strong>个研发需求,预计 <strong>0</strong> 个工时。'); // 获取错误的产品的需求统计
r($product->summaryTest($productIDList[2], $typeList[2])) && p() && e('本页共 <strong>0</strong> 个用户需求,<strong>0</strong>个研发需求,预计 <strong>0</strong> 个工时。'); // 获取错误的产品的需求统计