* Add case change tips.

This commit is contained in:
Yagami
2019-11-19 11:01:13 +08:00
parent d59f9aa38a
commit a0ca607022
3 changed files with 16 additions and 7 deletions
+3 -2
View File
@@ -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'));
}
/**
+1
View File
@@ -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;}
+12 -5
View File
@@ -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] . '<br />';
break;
case 'status':
echo ($run->version < $run->caseVersion) ? "<span class='warning'>{$this->lang->testcase->changed}</span>" : $this->processStatus('testtask', $run);
echo $caseChanged ? "<span class='warning'>{$this->lang->testcase->changed}</span>" : $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%'");