Optimize the code.

This commit is contained in:
孙华伟
2022-04-02 01:32:33 +00:00
parent a58fc45e20
commit c6327139bc
2 changed files with 5 additions and 3 deletions
+2
View File
@@ -543,6 +543,8 @@ class bug extends control
$builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'noempty,noterminate,nodone,withbranch');
$stories = $this->story->getProductStoryPairs($productID, $branch);
}
/* Remove parent stories. */
foreach($stories as $key => $value)
{
$story = $this->story->getByID($value);
+3 -3
View File
@@ -893,12 +893,15 @@ class testcase extends control
{
$branchTagOption[$branchInfo->id] = $branchInfo->name . ($branchInfo->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : '');
}
/* Remove parent stories. */
$stories = $this->story->getProductStoryPairs($productID, $case->branch);
foreach($stories as $key => $value)
{
$story = $this->story->getByID($value);
if(!empty($story->childStories)) unset($stories[$key]);
}
$this->view->productID = $productID;
$this->view->product = $product;
$this->view->branchTagOption = $branchTagOption;
@@ -908,11 +911,8 @@ class testcase extends control
}
$forceNotReview = $this->testcase->forceNotReview();
if($forceNotReview) unset($this->lang->testcase->statusList['wait']);
$position[] = $this->lang->testcase->common;
$position[] = $this->lang->testcase->edit;
$this->view->title = $title;
$this->view->position = $position;
$this->view->currentModuleID = $case->module;
$this->view->users = $this->user->getPairs('noletter');
$this->view->case = $case;