* Remove useless function.

* Rename forceNotReview to needReview.
This commit is contained in:
daitingting
2023-09-01 03:25:55 +00:00
parent 6514d6e830
commit acddaed1d0
4 changed files with 13 additions and 25 deletions
+5 -17
View File
@@ -273,10 +273,11 @@ class testcase extends control
$extras = str_replace(array(',', ' '), array('&', ''), $extras);
parse_str($extras, $output);
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->create;
$this->view->productID = $productID;
$this->view->users = $this->user->getPairs('noletter|noclosed|nodeleted');
$this->view->gobackLink = isset($output['from']) && $output['from'] == 'global' ? $this->createLink('testcase', 'browse', "productID=$productID") : '';
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->create;
$this->view->productID = $productID;
$this->view->users = $this->user->getPairs('noletter|noclosed|nodeleted');
$this->view->gobackLink = isset($output['from']) && $output['from'] == 'global' ? $this->createLink('testcase', 'browse', "productID=$productID") : '';
$this->view->needReview = $this->testcase->forceNotReview() == true ? 0 : 1;
$this->display();
}
@@ -1316,19 +1317,6 @@ class testcase extends control
$this->display();
}
/**
* Export case getModuleByStory
*
* @params int $storyID
* @return void
*/
public function ajaxGetStoryModule($storyID)
{
$story = $this->dao->select('module')->from(TABLE_STORY)->where('id')->eq($storyID)->fetch();
$moduleID = !empty($story) ? $story->module : 0;
echo json_encode(array('moduleID'=> $moduleID));
}
/**
* Get status by ajax.
*
+2 -2
View File
@@ -44,7 +44,7 @@ class testcaseModel extends model
/* 插入测试用例。 */
/* Insert testcase. */
$this->dao->insert(TABLE_CASE)->data($case, 'steps,expects,files,labels,stepType,forceNotReview,scriptFile,scriptName')
$this->dao->insert(TABLE_CASE)->data($case, 'steps,expects,files,labels,stepType,needReview,scriptFile,scriptName')
->autoCheck()
->batchCheck($this->config->testcase->create->requiredFields, 'notempty')
->checkFlow()
@@ -2329,7 +2329,7 @@ class testcaseModel extends model
{
if($methodName == 'create')
{
if($this->forceNotReview() || $this->post->forceNotReview) return 'normal';
if($this->forceNotReview() || !$this->post->needReview) return 'normal';
return 'wait';
}
+5 -5
View File
@@ -224,7 +224,7 @@ formPanel
set::value($case->pri)
),
),
formGroup
$needReview ? formGroup
(
setClass('grow-0'),
set::label($lang->testcase->isReviewed),
@@ -232,12 +232,12 @@ formPanel
(
width('80px'),
set::items($lang->testcase->reviewList),
set::id('forceNotReview'),
set::name('forceNotReview'),
set::value('1'),
set::id('needReview'),
set::name('needReview'),
set::value('0'),
set::required(true),
),
)
) : null
),
formRow
(
+1 -1
View File
@@ -1118,7 +1118,7 @@ class testcaseZen extends testcase
->setIF($from == 'bug', 'fromBug', $param)
->setIF($this->post->auto, 'auto', 'auto')
->setIF($this->post->auto && $this->post->script, 'script', $this->post->script ? htmlentities($this->post->script) : '')
->setIF($this->testcase->forceNotReview() || $this->post->forceNotReview, 'status', 'normal')
->setIF($this->testcase->forceNotReview() || !$this->post->needReview, 'status', 'normal')
->setIF($this->app->tab == 'project', 'project', $this->session->project)
->setIF($this->app->tab == 'execution', 'execution', $this->session->execution)
->setIF($this->post->story, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story))