From 48de518767a42e6c2394243afc20fc31095aacef Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 26 Mar 2024 15:34:35 +0800 Subject: [PATCH] * Fix bug #47304. --- module/execution/js/story.ui.js | 16 ++++++++-------- module/execution/ui/story.html.php | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/module/execution/js/story.ui.js b/module/execution/js/story.ui.js index aae8e9ba63..9380df41a8 100644 --- a/module/execution/js/story.ui.js +++ b/module/execution/js/story.ui.js @@ -53,22 +53,22 @@ window.setStatistics = function(element, checkedIdList) let checkedEstimate = 0; let checkedCase = 0; + let SRTotal = 0; + let total = 0; checkedIdList.forEach((rowID) => { - const task = element.getRowInfo(rowID); - if(task) + const story = element.getRowInfo(rowID); + if(storyType == 'requirement' && story.data.type == 'story') SRTotal += 1; + if(storyType == story.data.type) total += 1; + if(story) { - checkedEstimate += parseFloat(task.data.estimate); + checkedEstimate += parseFloat(story.data.estimate); if(cases[rowID]) checkedCase += 1; } }) const rate = Math.round(checkedCase / checkedTotal * 10000) / 100 + '' + '%'; - return { - html: checkedSummary.replace('%total%', checkedTotal) - .replace('%estimate%', checkedEstimate) - .replace('%rate%', rate) - }; + return {html: checkedSummary.replace('%total%', total).replace('%estimate%', checkedEstimate).replace('%rate%', rate).replace('%SRTotal%', SRTotal)}; } window.renderStoryCell = function(result, info) diff --git a/module/execution/ui/story.html.php b/module/execution/ui/story.html.php index 97e961ed3b..0c28e7197a 100644 --- a/module/execution/ui/story.html.php +++ b/module/execution/ui/story.html.php @@ -411,7 +411,8 @@ foreach($stories as $story) jsVar('cases', $storyCases); jsVar('summary', $summary); -jsVar('checkedSummary', $lang->product->checkedSRSummary); +jsVar('storyType', $storyType); +jsVar('checkedSummary', $storyType == 'story' ? $lang->product->checkedSRSummary : $lang->product->checkedURSummary); dtable ( setClass('shadow rounded'),