diff --git a/module/testcase/control.php b/module/testcase/control.php index 7b2ba3fbd3..9e08a8d30b 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -601,7 +601,7 @@ class testcase extends control $this->view->moduleOptionMenu = $moduleOptionMenu; $this->view->stories = $this->story->getProductStoryPairs($productID, $case->branch); } - if(!$this->config->testcase->needReview) unset($this->lang->testcase->statusList['wait']); + if(!$this->testcase->forceReview()) unset($this->lang->testcase->statusList['wait']); $position[] = $this->lang->testcase->common; $position[] = $this->lang->testcase->edit; @@ -709,7 +709,7 @@ class testcase extends control } } - if(!$this->config->testcase->needReview) unset($this->lang->testcase->statusList['wait']); + if(!$this->testcase->forceReview()) unset($this->lang->testcase->statusList['wait']); /* Judge whether the editedTasks is too large and set session. */ $countInputVars = count($cases) * (count(explode(',', $this->config->testcase->custom->batchEditFields)) + 3); @@ -1184,7 +1184,6 @@ class testcase extends control { if($_POST) { - if(!$this->config->testcase->needReview) unset($this->lang->testcase->statusList['wait']); $product = $this->loadModel('product')->getById($productID); if($product->type != 'normal') $fields['branch'] = $this->lang->product->branchName[$product->type]; @@ -1195,14 +1194,12 @@ class testcase extends control $fields['keywords'] = $this->lang->testcase->keywords; $fields['type'] = $this->lang->testcase->type; $fields['pri'] = $this->lang->testcase->pri; - $fields['status'] = $this->lang->testcase->status; $fields['stage'] = $this->lang->testcase->stage; $fields['precondition'] = $this->lang->testcase->precondition; $fields[''] = ''; $fields['typeValue'] = $this->lang->testcase->lblTypeValue; $fields['stageValue'] = $this->lang->testcase->lblStageValue; - $fields['statusValue'] = $this->lang->testcase->lblStatusValue; if($product->type != 'normal') $fields['branchValue'] = $this->lang->product->branchName[$product->type]; $branches = $this->loadModel('branch')->getPairs($productID); @@ -1221,7 +1218,6 @@ class testcase extends control { $row->typeValue = join("\n", $this->lang->testcase->typeList); $row->stageValue = join("\n", $this->lang->testcase->stageList); - $row->statusValue = join("\n", $this->lang->testcase->statusList); if($product->type != 'normal') $row->branchValue = join("\n", $branches); } $rows[] = $row; @@ -1499,7 +1495,6 @@ class testcase extends control echo js::alert($this->lang->error->noData); die(js::locate($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"))); } - if(!$this->config->testcase->needReview) unset($this->lang->testcase->statusList['wait']); /* Judge whether the editedTasks is too large and set session. */ $countInputVars = count($caseData) * 12 + $stepVars; diff --git a/module/testcase/model.php b/module/testcase/model.php index 12d7de3dd2..ce8384b14d 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -940,7 +940,6 @@ class testcaseModel extends model $caseData->title = $data->title[$key]; $caseData->pri = (int)$data->pri[$key]; $caseData->type = $data->type[$key]; - $caseData->status = $data->status[$key]; $caseData->stage = join(',', $data->stage[$key]); $caseData->keywords = $data->keywords[$key]; $caseData->frequency = 1; @@ -962,9 +961,15 @@ class testcaseModel extends model $forceReview = $this->forceReview(); foreach($cases as $key => $caseData) { + $caseID = 0; if(!empty($_POST['id'][$key]) and empty($_POST['insert'])) { - $caseID = $data->id[$key]; + $caseID = $data->id[$key]; + if(!isset($oldCases[$caseID])) $caseID = 0; + } + + if($caseID) + { $stepChanged = false; $steps = array(); $oldStep = isset($oldSteps[$caseID]) ? $oldSteps[$caseID] : array(); @@ -1050,7 +1055,7 @@ class testcaseModel extends model $caseData->openedDate = $now; $caseData->branch = isset($data->branch[$key]) ? $data->branch[$key] : $branch; if($caseData->story) $caseData->storyVersion = zget($storyVersionPairs, $caseData->story, 1); - if($forceReview) $caseData->status = 'wait'; + $caseData->status = $forceReview ? 'wait' : 'normal'; $this->dao->insert(TABLE_CASE)->data($caseData)->autoCheck()->exec(); if(!dao::isError()) @@ -1269,7 +1274,7 @@ class testcaseModel extends model case 'actions': common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", '', 'list', 'play', '', 'runCase iframe', false, "data-width='95%'"); common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", '', 'list', '', '', 'results iframe', '', "data-width='90%'"); - if($config->testcase->needReview) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'review', '', 'iframe'); + if($config->testcase->needReview or !empty($config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'review', '', 'iframe'); common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list'); common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'list', 'copy'); diff --git a/module/testcase/view/browse.html.php b/module/testcase/view/browse.html.php index aa0b334162..b924363056 100644 --- a/module/testcase/view/browse.html.php +++ b/module/testcase/view/browse.html.php @@ -67,7 +67,7 @@ js::set('batchDelete', $lang->testcase->confirmBatchDelete); $misc = common::hasPriv('testcase', 'batchDelete') ? "onclick=\"confirmBatchDelete('$actionLink')\"" : $class; echo "