diff --git a/module/story/control.php b/module/story/control.php index 48410217de..1c51f5fe4c 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -166,6 +166,10 @@ class story extends control } $actionID = $this->action->create('story', $storyID, $action, '', $extra); + /* Record submit review action. */ + $story = $this->dao->findById((int)$storyID)->from(TABLE_STORY)->fetch(); + if($story->status == 'reviewing') $this->action->create('story', $storyID, 'submitReview'); + if($objectID != 0) { $object = $this->dao->findById((int)$objectID)->from(TABLE_PROJECT)->fetch(); @@ -1153,6 +1157,10 @@ class story extends control $action = !empty($changes) ? 'Changed' : 'Commented'; $actionID = $this->action->create('story', $storyID, $action, $this->post->comment); $this->action->logHistory($actionID, $changes); + + /* Record submit review action. */ + $story = $this->dao->findById((int)$storyID)->from(TABLE_STORY)->fetch(); + if($story->status == 'reviewing') $this->action->create('story', $storyID, 'submitReview'); } $this->executeHooks($storyID); @@ -1341,7 +1349,7 @@ class story extends control ->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id') ->where('t1.product')->eq($product->id) ->andWhere('t2.type')->eq('project') - ->fetch('model'); + ->fetch('model'); if($projectModel === 'waterfall') { diff --git a/module/testcase/control.php b/module/testcase/control.php index 17be83ffba..9b793976f5 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -409,6 +409,7 @@ class testcase extends control $this->loadModel('action'); $this->action->create('case', $caseID, 'Opened'); + if($this->testcase->getStatus('create') == 'wait') $this->action->create('case', $caseID, 'submitReview'); /* If the story is linked project, make the case link the project. */ $this->testcase->syncCase2Project($caseResult['caseInfo'], $caseID); @@ -858,6 +859,9 @@ class testcase extends control { $this->loadModel('story'); + $case = $this->testcase->getById($caseID); + if(!$case) return print(js::error($this->lang->notFound) . js::locate('back')); + $testtasks = $this->loadModel('testtask')->getGroupByCases($caseID); $testtasks = empty($testtasks[$caseID]) ? array() : $testtasks[$caseID]; @@ -875,6 +879,8 @@ class testcase extends control $action = !empty($changes) ? 'Edited' : 'Commented'; $actionID = $this->action->create('case', $caseID, $action, $this->post->comment); $this->action->logHistory($actionID, $changes); + + if($case->status != 'wait' and $this->post->status == 'wait') $this->action->create('case', $caseID, 'submitReview'); } $this->executeHooks($caseID); @@ -889,8 +895,6 @@ class testcase extends control } } - $case = $this->testcase->getById($caseID); - if(!$case) return print(js::error($this->lang->notFound) . js::locate('back')); if($case->auto == 'unit') { $this->lang->testcase->subMenu->testcase->feature['alias'] = ''; diff --git a/module/testcase/model.php b/module/testcase/model.php index 2b02dd78be..0309fe5b4b 100644 --- a/module/testcase/model.php +++ b/module/testcase/model.php @@ -61,7 +61,6 @@ class testcaseModel extends model ->setIF($this->app->tab == 'project', 'project', $this->session->project) ->setIF($this->app->tab == 'execution', 'execution', $this->session->execution) ->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion((int)$this->post->story)) - ->stripTags($this->config->testcase->editor->create['id'], $this->config->allowedTags) ->remove('steps,expects,files,labels,stepType,forceNotReview') ->setDefault('story', 0) ->cleanInt('story,product,branch,module') @@ -78,7 +77,6 @@ class testcaseModel extends model /* Value of story may be showmore. */ $case->story = (int)$case->story; - $case = $this->loadModel('file')->processImgURL($case, $this->config->testcase->editor->create['id'], $this->post->uid); $this->dao->insert(TABLE_CASE)->data($case)->autoCheck()->batchCheck($this->config->testcase->create->requiredFields, 'notempty')->checkFlow()->exec(); if(!$this->dao->isError()) {