* Finish task #56629.

This commit is contained in:
孙广明
2022-06-14 10:20:29 +08:00
parent 6620381bc7
commit 089662bd5e
7 changed files with 216 additions and 3 deletions
+36
View File
@@ -1334,6 +1334,42 @@ class testcase extends control
$this->display();
}
/**
* Link related bugs.
*
* @param int $caseID
* @param string $browseType
* @param int $param
* @access public
* @return void
*/
public function linkBugs($caseID, $browseType = '', $param = 0)
{
$this->loadModel('bug');
/* Get case and queryID. */
$case = $this->testcase->getById($caseID);
$queryID = ($browseType == 'bySearch') ? (int)$param : 0;
/* Build the search form. */
$actionURL = $this->createLink('testcase', 'linkBugs', "caseID=$caseID&browseType=bySearch&queryID=myQueryID", '', true);
$objectID = 0;
if($this->app->tab == 'project') $objectID = $case->project;
if($this->app->tab == 'execution') $objectID = $case->execution;
$this->bug->buildSearchForm($case->product, $this->products, $queryID, $actionURL, $objectID);
/* Get cases to link. */
$bugs2Link = $this->testcase->getBugs2Link($caseID, $browseType, $queryID);
/* Assign. */
$this->view->position[] = $this->lang->testcase->linkBugs;
$this->view->case = $case;
$this->view->bugs2Link = $bugs2Link;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->display();
}
/**
* Confirm testcase changed.
*