From 8927059720464dfc8aa9d039bc0fc0780e60d892 Mon Sep 17 00:00:00 2001
From: songchenxuan
Date: Thu, 6 Jan 2022 13:08:46 +0800
Subject: [PATCH] *Code for code review.
---
framework/base/router.class.php | 2 +-
module/block/view/scrumoverviewblock.html.php | 2 +-
module/story/model.php | 2 +-
module/story/view/view.html.php | 2 +-
module/testreport/control.php | 41 ++++++++++++++++++-
module/testreport/lang/en.php | 2 +-
module/testreport/model.php | 1 -
module/testreport/view/create.html.php | 3 +-
module/testreport/view/edit.html.php | 3 +-
module/testreport/view/view.html.php | 3 +-
module/tree/model.php | 6 +--
11 files changed, 50 insertions(+), 17 deletions(-)
diff --git a/framework/base/router.class.php b/framework/base/router.class.php
index bc154790f7..15b02574ca 100644
--- a/framework/base/router.class.php
+++ b/framework/base/router.class.php
@@ -2793,7 +2793,7 @@ class EndResponseException extends \Exception
/**
* @param string $content
*
- * @return sellf
+ * @return self
*/
public static function create($content = '')
{
diff --git a/module/block/view/scrumoverviewblock.html.php b/module/block/view/scrumoverviewblock.html.php
index 9d04315843..fcf990cc03 100644
--- a/module/block/view/scrumoverviewblock.html.php
+++ b/module/block/view/scrumoverviewblock.html.php
@@ -31,7 +31,7 @@
| block->totalStory . ':';?> |
allStories;?> |
block->totalPeople . ':';?> |
- teamCount ? html::a($this->createLink('project', 'team', 'projectID=' . $projectID), $totalData[$projectID]->teamCount) : 0;?> |
+ teamCount ? html::a($this->createLink('project', 'team', 'projectID=' . $projectID), $totalData[$projectID]->teamCount) : 0;?> |
block->estimatedHours . ':';?> |
estimate . $lang->execution->workHour;?> |
block->totalBug. ':';?> |
diff --git a/module/story/model.php b/module/story/model.php
index ad1305a7b5..e5e6183898 100644
--- a/module/story/model.php
+++ b/module/story/model.php
@@ -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
*/
diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php
index 1c101aafdf..16be21d237 100644
--- a/module/story/view/view.html.php
+++ b/module/story/view/view.html.php
@@ -482,7 +482,7 @@
if(!isset($executions[$task->execution])) continue;
$executionName = $executions[$task->execution];
$taskInfo = $task->id . ' ' . $this->lang->task->statusList[$task->status] . ' ' . $task->name;
- $class = isonlybody() ? 'showinonlybody' : 'iframe';
+ $class = isonlybody() ? 'showinonlybody' : 'iframe';
echo "" . 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'") . '';
}
diff --git a/module/testreport/control.php b/module/testreport/control.php
index 6960f3d3ae..3e2108471a 100644
--- a/module/testreport/control.php
+++ b/module/testreport/control.php
@@ -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();
}
diff --git a/module/testreport/lang/en.php b/module/testreport/lang/en.php
index 2ed6bae529..ccc73a6406 100644
--- a/module/testreport/lang/en.php
+++ b/module/testreport/lang/en.php
@@ -78,7 +78,7 @@ $lang->testreport->exportNotice = "Exported By severity] = isset($severityGroups[$bug->severity]) ? $severityGroups[$bug->severity] + 1 : 1;
diff --git a/module/testreport/view/create.html.php b/module/testreport/view/create.html.php
index 4d4db722b0..353affdd93 100644
--- a/module/testreport/view/create.html.php
+++ b/module/testreport/view/create.html.php
@@ -83,8 +83,7 @@
' . $storySummary . '';
echo '' . sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary . '
';
- echo '' . sprintf($lang->testreport->bugSummary, $bugInfo['foundBugs'], count($legacyBugs), count($bugInfo['activatedBugs']), $bugInfo['countBugByTask'], $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '
';
- unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']); unset($bugInfo['foundBugs']); unset($bugInfo['activatedBugs']);
+ echo '' . sprintf($lang->testreport->bugSummary, $bugSummary['foundBugs'], count($legacyBugs), $bugSummary['activatedBugs'], $bugSummary['countBugByTask'], $bugSummary['bugConfirmedRate'] . '%', $bugSummary['bugCreateByCaseRate'] . '%') . '
';
?>
|
diff --git a/module/testreport/view/edit.html.php b/module/testreport/view/edit.html.php
index d25d7aafa4..9081388c71 100644
--- a/module/testreport/view/edit.html.php
+++ b/module/testreport/view/edit.html.php
@@ -71,8 +71,7 @@
' . $storySummary . '
';
echo '' . sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary . '
';
- echo '' . sprintf($lang->testreport->bugSummary, $bugInfo['foundBugs'], count($legacyBugs), count($bugInfo['activatedBugs']), $bugInfo['countBugByTask'], $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '
';
- unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']); unset($bugInfo['foundBugs']); unset($bugInfo['activatedBugs']);
+ echo '' . sprintf($lang->testreport->bugSummary, $bugSummary['foundBugs'], count($legacyBugs), $bugSummary['activatedBugs'], $bugSummary['countBugByTask'], $bugSummary['bugConfirmedRate'] . '%', $bugSummary['bugCreateByCaseRate'] . '%') . '
';
?>
|
diff --git a/module/testreport/view/view.html.php b/module/testreport/view/view.html.php
index a06c5f9117..fd1fb8bb56 100644
--- a/module/testreport/view/view.html.php
+++ b/module/testreport/view/view.html.php
@@ -78,8 +78,7 @@
' . $storySummary . '';
echo '' . sprintf($lang->testreport->buildSummary, empty($builds) ? 1 : count($builds)) . $caseSummary . '
';
- echo '' . sprintf($lang->testreport->bugSummary, $bugInfo['foundBugs'], count($legacyBugs), count($bugInfo['activatedBugs']), $bugInfo['countBugByTask'], $bugInfo['bugConfirmedRate'] . '%', $bugInfo['bugCreateByCaseRate'] . '%') . '
';
- unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']); unset($bugInfo['foundBugs']); unset($bugInfo['activatedBugs']);
+ echo '' . sprintf($lang->testreport->bugSummary, $bugSummary['foundBugs'], count($legacyBugs), $bugSummary['activatedBugs'], $bugSummary['countBugByTask'], $bugSummary['bugConfirmedRate'] . '%', $bugSummary['bugCreateByCaseRate'] . '%') . '
';
?>
diff --git a/module/tree/model.php b/module/tree/model.php
index a3c386fb50..9ca7e0eb97 100644
--- a/module/tree/model.php
+++ b/module/tree/model.php
@@ -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');