* fix bug #994.
This commit is contained in:
@@ -275,6 +275,8 @@ class my extends control
|
||||
}
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', $type == 'assigntome' ? false : true);
|
||||
|
||||
$cases = $this->testcase->appendData($cases, $type == 'assigntome' ? 'run' : 'case');
|
||||
|
||||
/* Assign. */
|
||||
$this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->testCase;
|
||||
$this->view->position[] = $this->lang->my->testCase;
|
||||
|
||||
@@ -48,13 +48,17 @@
|
||||
$canBatchRun = common::hasPriv('testtask', 'batchRun');
|
||||
?>
|
||||
<?php foreach($cases as $case):?>
|
||||
<?php
|
||||
$caseID = $type == 'assigntome' ? $case->case : $case->id;
|
||||
$runID = $type == 'assigntome' ? $case->id : 0;
|
||||
?>
|
||||
<tr class='text-center'>
|
||||
<td class='cell-id'>
|
||||
<?php if($canBatchEdit or $canBatchRun):?><input type='checkbox' name='caseIDList[]' value='<?php echo $case->id;?>'/><?php endif;?>
|
||||
<?php echo html::a($this->createLink('testcase', 'view', "testcaseID=$case->id"), sprintf('%03d', $case->id));?>
|
||||
<?php if($canBatchEdit or $canBatchRun):?><input type='checkbox' name='caseIDList[]' value='<?php echo $caseID;?>'/><?php endif;?>
|
||||
<?php echo html::a($this->createLink('testcase', 'view', "testcaseID=$caseID&version=$case->version"), sprintf('%03d', $caseID));?>
|
||||
</td>
|
||||
<td><span class='<?php echo 'pri' . zget($lang->testcase->priList, $case->pri, $case->pri)?>'><?php echo zget($lang->testcase->priList, $case->pri, $case->pri)?></span</td>
|
||||
<td class='text-left'><?php echo html::a($this->createLink('testcase', 'view', "testcaseID=$case->id"), $case->title, null, "style='color: $case->color'");?></td>
|
||||
<td class='text-left'><?php echo html::a($this->createLink('testcase', 'view', "testcaseID=$caseID&version=$case->version"), $case->title, null, "style='color: $case->color'");?></td>
|
||||
<td><?php echo $lang->testcase->typeList[$case->type];?></td>
|
||||
<td><?php echo $users[$case->openedBy];?></td>
|
||||
<td><?php echo $users[$case->lastRunner];?></td>
|
||||
@@ -63,18 +67,18 @@
|
||||
<td class='<?php if(isset($run)) echo $run->status;?>'><?php echo $lang->testcase->statusList[$case->status];?></td>
|
||||
<td class='text-right'>
|
||||
<?php
|
||||
common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", '', 'list', 'play', '', 'iframe');
|
||||
common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", '', 'list', 'list-alt', '', 'iframe');
|
||||
common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list', 'pencil');
|
||||
common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$case->id", $case, 'list', 'copy');
|
||||
common::printIcon('testtask', 'runCase', "runID=$runID&caseID=$caseID&version=$case->version", '', 'list', 'play', '', 'iframe', '', "data-width='95%'");
|
||||
common::printIcon('testtask', 'results', "runID=$runID&caseID=$caseID", '', 'list', 'list-alt', '', 'iframe', '', "data-width='95%'");
|
||||
common::printIcon('testcase', 'edit', "caseID=$caseID", $case, 'list', 'pencil');
|
||||
common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase¶m=$caseID", $case, 'list', 'copy');
|
||||
|
||||
if(common::hasPriv('testcase', 'delete'))
|
||||
{
|
||||
$deleteURL = $this->createLink('testcase', 'delete', "caseID=$case->id&confirm=yes");
|
||||
$deleteURL = $this->createLink('testcase', 'delete', "caseID=$caseID&confirm=yes");
|
||||
echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"caseList\",confirmDelete)", '<i class="icon-remove"></i>', '', "class='btn-icon' title='{$lang->testcase->delete}'");
|
||||
}
|
||||
|
||||
common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=", $case, 'list', 'bug');
|
||||
common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$caseID,version=$case->version,runID=$runID", $case, 'list', 'bug');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -92,7 +96,7 @@
|
||||
$actionLink = $this->createLink('testcase', 'batchEdit');
|
||||
echo html::submitButton("<i class='icon-pencil'></i> " . $lang->edit, "onclick=setFormAction('$actionLink')");
|
||||
}
|
||||
if($canBatchRun)
|
||||
if($canBatchRun and $type != 'assigntome')
|
||||
{
|
||||
$actionLink = $this->createLink('testtask', 'batchRun', "productID=0&orderBy=$orderBy&from=testcase");
|
||||
echo html::submitButton("<i class='icon-play'></i> " . $lang->testtask->runCase, "onclick=setFormAction('$actionLink')");
|
||||
|
||||
@@ -399,7 +399,7 @@ class testcaseModel extends model
|
||||
*/
|
||||
public function getByAssignedTo($account, $orderBy = 'id_desc', $pager = null)
|
||||
{
|
||||
return $this->dao->select('t1.assignedTo AS assignedTo, t2.*')->from(TABLE_TESTRUN)->alias('t1')
|
||||
return $this->dao->select('t1.*,t2.pri,t2.title,t2.type,t2.openedBy,t2.color,t2.product,t2.branch,t2.module,t2.status')->from(TABLE_TESTRUN)->alias('t1')
|
||||
->leftJoin(TABLE_CASE)->alias('t2')->on('t1.case = t2.id')
|
||||
->leftJoin(TABLE_TESTTASK)->alias('t3')->on('t1.task = t3.id')
|
||||
->where('t1.assignedTo')->eq($account)
|
||||
|
||||
@@ -928,6 +928,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');
|
||||
|
||||
@@ -286,7 +286,7 @@ class user extends control
|
||||
{
|
||||
$cases = $this->loadModel('testcase')->getByOpenedBy($account, $sort, $pager);
|
||||
}
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', $type == 'assigntome' ? false : true);
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', $type == 'case2Him' ? false : true);
|
||||
|
||||
/* Assign. */
|
||||
$this->view->title = $this->lang->user->common . $this->lang->colon . $this->lang->user->testCase;
|
||||
|
||||
@@ -42,10 +42,11 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($cases as $case):?>
|
||||
<?php $caseID = $type == 'case2Him' ? $case->case : $case->id?>
|
||||
<tr class='text-center'>
|
||||
<td><?php echo html::a($this->createLink('testcase', 'view', "testcaseID=$case->id"), sprintf('%03d', $case->id));?></td>
|
||||
<td><?php echo html::a($this->createLink('testcase', 'view', "testcaseID=$caseID&version=$case->version"), sprintf('%03d', $caseID));?></td>
|
||||
<td><span class='<?php echo 'pri' . zget($lang->testcase->priList, $case->pri, $case->pri)?>'><?php echo zget($lang->testcase->priList, $case->pri, $case->pri)?></span</td>
|
||||
<td class='text-left'><?php echo html::a($this->createLink('testcase', 'view', "testcaseID=$case->id"), $case->title);?></td>
|
||||
<td class='text-left'><?php echo html::a($this->createLink('testcase', 'view', "testcaseID=$caseID&version=$case->version"), $case->title);?></td>
|
||||
<td><?php echo $lang->testcase->typeList[$case->type];?></td>
|
||||
<td><?php echo $users[$case->openedBy];?></td>
|
||||
<td><?php echo $users[$case->lastRunner];?></td>
|
||||
|
||||
Reference in New Issue
Block a user