diff --git a/module/bug/control.php b/module/bug/control.php index 5dd2352835..8e8b3d285a 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -260,15 +260,14 @@ class bug extends control $extras = str_replace(array(',', ' '), array('&', ''), $extras); parse_str($extras); - /* If set runID, get the last result info as the template. */ - if(!empty($runID)) $resultID = $this->dao->select('id')->from(TABLE_TESTRESULT)->where('run')->eq($runID)->orderBy('id desc')->limit(1)->fetch('id'); - if(isset($resultID) and $resultID > 0) extract($this->bug->getBugInfoFromResult($resultID)); - - /* If set caseID and runID='', get the last result info as the template. */ - if($caseID && empty($runID)) - { - $resultID = $this->dao->select('id')->from(TABLE_TESTRESULT)->where('`case`')->eq($caseID)->orderBy('date desc')->limit(1)->fetch('id'); - if(isset($resultID) and $resultID > 0) extract($this->bug->getBugInfoFromResult($resultID, $caseID, $version)); + /* If set runID, get the result info by resultID as the template. Else get the result info by resultID and case info. */ + if($runID) + { + extract($this->bug->getBugInfoFromResult($resultID)); + } + else + { + extract($this->bug->getBugInfoFromResult($resultID, $caseID, $version)); } /* If bugID setted, use this bug as template. */ diff --git a/module/testcase/css/createbug.css b/module/testcase/css/createbug.css index 6255dfaec5..f0180f1fd7 100644 --- a/module/testcase/css/createbug.css +++ b/module/testcase/css/createbug.css @@ -8,3 +8,14 @@ body {padding: 15px;} .table tfoot td {border-bottom: none} .table-actions {float: none; padding: 10px 0 0 0;} .table-actions .checkbox.btn {padding: 6px 11px;} + +.resultSteps .step-id {text-align: right} +.resultSteps .step-item-id {background-color: transparent; border: none; display: none; width: 30px; padding-left: 0; padding-right: 0; text-align: right; padding-right: 8px} +.resultSteps .checkbox-inline input[type="checkbox"] {top: -2px} +.resultSteps .btn-group .btn {padding-left: 0; padding-right: 0; min-width: 30px;} +.resultSteps .step-actions {width: 98px;} +.resultSteps .active td {transition: background-color .5s;} +.resultSteps .step-group .step-steps {resize: none; max-height: 30px;} +.resultSteps .step-group .step-expects {display: none;} +.resultSteps .step-item .step-item-id {display: table-cell;} +.resultSteps .step-item .step-id {color: transparent} diff --git a/module/testcase/view/createbug.html.php b/module/testcase/view/createbug.html.php index 907e18b351..1677fd3b4b 100644 --- a/module/testcase/view/createbug.html.php +++ b/module/testcase/view/createbug.html.php @@ -11,7 +11,6 @@ */ ?> -
product&branch=$case->branch&extras=caseID=$case->id,version=$case->version,runID=")?>' target='_parent' method='post'>
diff --git a/module/testtask/control.php b/module/testtask/control.php index 969aa88b5e..643b614134 100644 --- a/module/testtask/control.php +++ b/module/testtask/control.php @@ -888,6 +888,7 @@ class testtask extends control } $this->view->case = $case; + $this->view->runID = $runID; $this->view->results = $results; $this->view->builds = $this->loadModel('build')->getProductBuildPairs($case->product, $branch = 0, $params = ''); $this->view->users = $this->loadModel('user')->getPairs('noclosed, noletter'); diff --git a/module/testtask/view/results.html.php b/module/testtask/view/results.html.php index da5a7b30ee..57f595a937 100644 --- a/module/testtask/view/results.html.php +++ b/module/testtask/view/results.html.php @@ -49,7 +49,7 @@ -
product&branch=$case->branch&extras=caseID=$case->id,version=$case->version,runID=")?>' target='_blank' method='post'> + product&branch=$case->branch&extras=caseID=$case->id,version=$case->version,resultID=$result->id,runID=$runID")?>' target='_blank' method='post'>