diff --git a/module/testcase/control.php b/module/testcase/control.php index 18eeae6b01..0a70d0dd81 100644 --- a/module/testcase/control.php +++ b/module/testcase/control.php @@ -993,11 +993,12 @@ class testcase extends control * @access public * @return void */ - public function confirmChange($caseID) + public function confirmChange($caseID, $from = 'view') { $case = $this->testcase->getById($caseID); $this->dao->update(TABLE_TESTRUN)->set('version')->eq($case->version)->where('`case`')->eq($caseID)->exec(); - die(js::locate(inLink('view', "caseID=$caseID"), 'parent')); + if($from == 'view') die(js::locate(inLink('view', "caseID=$caseID"), 'parent')); + die(js::reload('parent')); } /** diff --git a/module/testtask/css/cases.css b/module/testtask/css/cases.css index 59bcd713d2..f6203f70ba 100644 --- a/module/testtask/css/cases.css +++ b/module/testtask/css/cases.css @@ -10,6 +10,7 @@ tbody > tr > td .icon-bug {margin-left: -8px;} .table-footer .table-actions .input-group #assignedTo_chosen .chosen-single span{font-size:12px;} .table-footer .table-actions .input-group #assignedTo_chosen .chosen-single div{line-height:10px;} td.c-story{overflow: hidden; text-overflow:ellipsis; white-space: nowrap;} +td .warning{color: red;} .fail .result-fail, .blocked .result-blocked{color:#f00;} .pass .result-pass{color:green;} diff --git a/module/testtask/model.php b/module/testtask/model.php index c198c5911f..e7d2b9c3a0 100644 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -1177,10 +1177,11 @@ class testtaskModel extends model */ public function printCell($col, $run, $users, $task, $branches, $mode = 'datatable') { - $canView = common::hasPriv('testcase', 'view'); - $caseLink = helper::createLink('testcase', 'view', "caseID=$run->case&version=$run->version&from=testtask&taskID=$run->task"); - $account = $this->app->user->account; - $id = $col->id; + $canView = common::hasPriv('testcase', 'view'); + $caseLink = helper::createLink('testcase', 'view', "caseID=$run->case&version=$run->version&from=testtask&taskID=$run->task"); + $account = $this->app->user->account; + $id = $col->id; + $caseChanged = $run->version < $run->caseVersion; if($col->show) { $class = "c-$id "; @@ -1216,7 +1217,7 @@ class testtaskModel extends model foreach(explode(',', trim($run->stage, ',')) as $stage) echo $this->lang->testcase->stageList[$stage] . '
'; break; case 'status': - echo ($run->version < $run->caseVersion) ? "{$this->lang->testcase->changed}" : $this->processStatus('testtask', $run); + echo $caseChanged ? "{$this->lang->testcase->changed}" : $this->processStatus('testtask', $run); break; case 'precondition': echo $run->precondition; @@ -1275,6 +1276,12 @@ class testtaskModel extends model echo $run->stepNumber; break; case 'actions': + if($caseChanged) + { + common::printIcon('testcase', 'confirmChange', "id=$run->case&from=list", $run, 'list', 'search', 'hiddenwin'); + break; + } + common::printIcon('testcase', 'createBug', "product=$run->product&branch=$run->branch&extra=projectID=$task->project,buildID=$task->build,caseID=$run->case,version=$run->version,runID=$run->id,testtask=$task->id", $run, 'list', 'bug', '', 'iframe', '', "data-width='90%'"); common::printIcon('testtask', 'results', "id=$run->id", $run, 'list', '', '', 'iframe', '', "data-width='90%'");