*Code for code review.

This commit is contained in:
songchenxuan
2022-01-06 13:08:46 +08:00
parent 6d80b334bf
commit 8927059720
11 changed files with 50 additions and 17 deletions
+1 -1
View File
@@ -2793,7 +2793,7 @@ class EndResponseException extends \Exception
/**
* @param string $content
*
* @return sellf
* @return self
*/
public static function create($content = '')
{
@@ -31,7 +31,7 @@
<th><?php echo $lang->block->totalStory . ':';?></th>
<td><?php echo $totalData[$projectID]->allStories;?></td>
<th><?php echo $lang->block->totalPeople . ':';?></th>
<td><?php echo $totalData[$projectID]->teamCount ? html::a($this->createLink('project', 'team', 'projectID=' . $projectID), $totalData[$projectID]->teamCount) : 0;?></td>
<td><?php echo $totalData[$projectID]->teamCount ? html::a($this->createLink('project', 'team', 'projectID=' . $projectID), $totalData[$projectID]->teamCount) : 0;?></td>
<th><?php echo $lang->block->estimatedHours . ':';?></th>
<td><?php echo $totalData[$projectID]->estimate . $lang->execution->workHour;?></td>
<th><?php echo $lang->block->totalBug. ':';?></th>
+1 -1
View File
@@ -2436,7 +2436,7 @@ class storyModel extends model
* @param int $productID
* @param string $type requirement|story
* @param string $orderBy
* @param string $pager
* @param object $pager
* @access public
* @return array
*/
+1 -1
View File
@@ -482,7 +482,7 @@
if(!isset($executions[$task->execution])) continue;
$executionName = $executions[$task->execution];
$taskInfo = $task->id . '&nbsp<span class="label label-success label-outline">' . $this->lang->task->statusList[$task->status] . '</span>&nbsp' . $task->name;
$class = isonlybody() ? 'showinonlybody' : 'iframe';
$class = isonlybody() ? 'showinonlybody' : 'iframe';
echo "<li title='$task->name'>" . html::a($this->createLink('task', 'view', "taskID=$task->id", '', true), $taskInfo, '', "class=$class data-width='80%'");
echo html::a($this->createLink('execution', 'browse', "executionID=$task->execution"), $executionName, '', "class='text-muted'") . '</li>';
}
+39 -2
View File
@@ -330,8 +330,20 @@ class testreport extends control
$this->view->datas['testTaskPerRunner'] = $this->report->computePercent($perCaseRunner);
$this->view->legacyBugs = $bugInfo['legacyBugs'];
$bugSummary['foundBugs'] = $bugInfo['foundBugs'];
$bugSummary['activatedBugs'] = count($bugInfo['activatedBugs']);
$bugSummary['countBugByTask'] = $bugInfo['countBugByTask'];
$bugSummary['bugConfirmedRate'] = $bugInfo['bugConfirmedRate'];
$bugSummary['bugCreateByCaseRate'] = $bugInfo['bugCreateByCaseRate'];
unset($bugInfo['foundBugs']);
unset($bugInfo['legacyBugs']);
$this->view->bugInfo = $bugInfo;
unset($bugInfo['activatedBugs']);
unset($bugInfo['countBugByTask']);
unset($bugInfo['bugConfirmedRate']);
unset($bugInfo['bugCreateByCaseRate']);
$this->view->bugInfo = $bugInfo;
$this->view->bugSummary = $bugSummary;
$this->view->objectID = $objectID;
$this->view->objectType = $objectType;
@@ -459,8 +471,20 @@ class testreport extends control
$this->view->datas['testTaskPerRunner'] = $this->report->computePercent($perCaseRunner);
$this->view->legacyBugs = $bugInfo['legacyBugs'];
$bugSummary['foundBugs'] = $bugInfo['foundBugs'];
$bugSummary['activatedBugs'] = count($bugInfo['activatedBugs']);
$bugSummary['countBugByTask'] = $bugInfo['countBugByTask'];
$bugSummary['bugConfirmedRate'] = $bugInfo['bugConfirmedRate'];
$bugSummary['bugCreateByCaseRate'] = $bugInfo['bugCreateByCaseRate'];
unset($bugInfo['foundBugs']);
unset($bugInfo['legacyBugs']);
$this->view->bugInfo = $bugInfo;
unset($bugInfo['activatedBugs']);
unset($bugInfo['countBugByTask']);
unset($bugInfo['bugConfirmedRate']);
unset($bugInfo['bugCreateByCaseRate']);
$this->view->bugInfo = $bugInfo;
$this->view->bugSummary = $bugSummary;
$this->display();
}
@@ -567,8 +591,21 @@ class testreport extends control
$this->view->datas['testTaskPerRunner'] = $this->report->computePercent($perCaseRunner);
$this->view->legacyBugs = $bugInfo['legacyBugs'];
$bugSummary['foundBugs'] = $bugInfo['foundBugs'];
$bugSummary['activatedBugs'] = count($bugInfo['activatedBugs']);
$bugSummary['countBugByTask'] = $bugInfo['countBugByTask'];
$bugSummary['bugConfirmedRate'] = $bugInfo['bugConfirmedRate'];
$bugSummary['bugCreateByCaseRate'] = $bugInfo['bugCreateByCaseRate'];
unset($bugInfo['foundBugs']);
unset($bugInfo['legacyBugs']);
unset($bugInfo['activatedBugs']);
unset($bugInfo['countBugByTask']);
unset($bugInfo['bugConfirmedRate']);
unset($bugInfo['bugCreateByCaseRate']);
$this->view->bugInfo = $bugInfo;
$this->view->bugSummary = $bugSummary;
$this->display();
}
+1 -1
View File
@@ -78,7 +78,7 @@ $lang->testreport->exportNotice = "Exported By <a href='https://www.zentao.ne
$lang->testreport->noReport = "No report has been generated. Please check it later.";
$lang->testreport->foundBugTip = "Bugs found in this build period and the affected build is in this test period.";
$lang->testreport->legacyBugTip = "Active bugs, or bugs that are not resolved in the test period.";
$lang->testreport->activatedBugTip = "Reactive bugs in the test period.";
$lang->testreport->activatedBugTip = "Reactived bugs during the testtask.";
$lang->testreport->fromCaseBugTip = "Bugs found from the running of cases in the test period.";
$lang->testreport->errorTrunk = "You cannot create a Testing report for the trunk. Please modify the linked build!";
$lang->testreport->noTestTask = "No test requests for this {$lang->productCommon}, so no reports can be generated. Please go to {$lang->productCommon} which has test requests and then generate the report.";
-1
View File
@@ -259,7 +259,6 @@ class testreportModel extends model
}
$resolvedBugs = 0;
$this->loadModel('action');
foreach($foundBugs as $bug)
{
$severityGroups[$bug->severity] = isset($severityGroups[$bug->severity]) ? $severityGroups[$bug->severity] + 1 : 1;
+1 -2
View File
@@ -83,8 +83,7 @@
<?php
echo '<div>' . $storySummary . '</div>';
echo '<div>' . sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary . '</div>';
echo '<div>' . sprintf($lang->testreport->bugSummary, $bugInfo['foundBugs'], count($legacyBugs), count($bugInfo['activatedBugs']), $bugInfo['countBugByTask'], $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '</div>';
unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']); unset($bugInfo['foundBugs']); unset($bugInfo['activatedBugs']);
echo '<div>' . sprintf($lang->testreport->bugSummary, $bugSummary['foundBugs'], count($legacyBugs), $bugSummary['activatedBugs'], $bugSummary['countBugByTask'], $bugSummary['bugConfirmedRate'] . '%', $bugSummary['bugCreateByCaseRate'] . '%') . '</div>';
?>
</td>
<td></td>
+1 -2
View File
@@ -71,8 +71,7 @@
<?php
echo '<p>' . $storySummary . '</p>';
echo '<p>' . sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary . '</p>';
echo '<p>' . sprintf($lang->testreport->bugSummary, $bugInfo['foundBugs'], count($legacyBugs), count($bugInfo['activatedBugs']), $bugInfo['countBugByTask'], $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '</p>';
unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']); unset($bugInfo['foundBugs']); unset($bugInfo['activatedBugs']);
echo '<p>' . sprintf($lang->testreport->bugSummary, $bugSummary['foundBugs'], count($legacyBugs), $bugSummary['activatedBugs'], $bugSummary['countBugByTask'], $bugSummary['bugConfirmedRate'] . '%', $bugSummary['bugCreateByCaseRate'] . '%') . '</p>';
?>
</td>
<td></td>
+1 -2
View File
@@ -78,8 +78,7 @@
<?php
echo '<p>' . $storySummary . '</p>';
echo '<p>' . sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary . '</p>';
echo '<p>' . sprintf($lang->testreport->bugSummary, $bugInfo['foundBugs'], count($legacyBugs), count($bugInfo['activatedBugs']), $bugInfo['countBugByTask'], $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '</p>';
unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']); unset($bugInfo['foundBugs']); unset($bugInfo['activatedBugs']);
echo '<p>' . sprintf($lang->testreport->bugSummary, $bugSummary['foundBugs'], count($legacyBugs), $bugSummary['activatedBugs'], $bugSummary['countBugByTask'], $bugSummary['bugConfirmedRate'] . '%', $bugSummary['bugCreateByCaseRate'] . '%') . '</p>';
?>
</td>
</tr>
+3 -3
View File
@@ -242,8 +242,8 @@ class treeModel extends model
public function getTaskOptionMenu($rootID, $productID = 0, $startModule = 0, $extra = '')
{
/* If createdVersion <= 4.1, go to getOptionMenu(). */
$products = $this->loadModel('product')->getProductPairsByProject($rootID);
$branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noclosed');
$products = $this->loadModel('product')->getProductPairsByProject($rootID);
$branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noclosed');
if(!$this->isMergeModule($rootID, 'task') or !$products) return $this->getOptionMenu($rootID, 'task', $startModule);
@@ -282,7 +282,7 @@ class treeModel extends model
{
$modules = $this->dao->select('*')->from(TABLE_MODULE)->where("((root = '" . (int)$rootID . "' and type = 'task' and parent != 0) OR (root = $id and type = 'story'))")
->beginIF($startModulePath)->andWhere('path')->like($startModulePath)->fi()
->beginIF(!empty($activeBranch))->andWhere('branch')->in($activeBranch)->fi()
->andWhere('branch')->in($activeBranch)->fi()
->andWhere('deleted')->eq(0)
->orderBy('grade desc, branch, `order`, type')
->fetchAll('id');