* Finish task #107891.

This commit is contained in:
tanghucheng
2023-12-13 01:40:34 -05:00
parent 0ad3372437
commit 02f0a9c906
3 changed files with 26 additions and 11 deletions
+4 -2
View File
@@ -556,6 +556,7 @@ class testtask extends control
{
$assignedToList = $this->loadModel('user')->getPairs('noclosed|noletter|nodeleted|qafirst');
}
$showModule = $this->config->datatable->testtaskCases->showModule;
/* Append id for secend sort. */
$sort = common::appendOrder($orderBy, 't2.id');
@@ -611,11 +612,12 @@ class testtask extends control
$this->view->treeClass = $browseType == 'bymodule' ? '' : 'hidden';
$this->view->pager = $pager;
$this->view->branches = $this->loadModel('branch')->getPairs($productID);
$this->view->setModule = false;
$this->view->setModule = true;
$this->view->suites = $this->loadModel('testsuite')->getSuitePairs($productID);
$this->view->suiteName = isset($suiteName) ? $suiteName : $this->lang->testtask->browseBySuite;
$this->view->canBeChanged = $canBeChanged;
$this->view->automation = $this->loadModel('zanode')->getAutomationByProduct($productID);
$this->view->automation = $this->loadModel('zanode')->getAutomationByProduct($productID);
$this->view->modulePairs = $showModule ? $this->tree->getModulePairs($productID, 'case', $showModule) : array();
$this->display();
}
+10 -7
View File
@@ -1617,15 +1617,17 @@ class testtaskModel extends model
/**
* Print cell data.
*
* @param object $col
* @param object $run
* @param array $users
* @param object $task
* @param array $branches
* @param mixed $col
* @param mixed $run
* @param mixed $users
* @param mixed $task
* @param mixed $branches
* @param mixed $modulePairs
* @param string $mode
* @access public
* @return void
*/
public function printCell($col, $run, $users, $task, $branches, $mode = 'datatable')
public function printCell($col, $run, $users, $task, $branches, $modulePairs, $mode = 'datatable')
{
$canBatchEdit = common::hasPriv('testcase', 'batchEdit');
$canBatchUnlink = common::hasPriv('testtask', 'batchUnlinkCases');
@@ -1671,7 +1673,8 @@ class testtaskModel extends model
echo "</span>";
break;
case 'title':
if(!empty($branches)) echo "<span class='label label-badge label-outline'>{$branches[$run->branch]}</span>";
if(!empty($branches)) echo "<span class='label label-badge label-outline'>{$branches[$run->branch]}</span> ";
if($modulePairs and $run->module and isset($modulePairs[$run->module])) echo "<span class='label label-gray label-badge'>{$modulePairs[$run->module]}</span> ";
if($canView)
{
if($fromCaseID)
+12 -2
View File
@@ -27,7 +27,17 @@
<div id='mainContent' class='main-row fade'>
<div class='side-col' id='sidebar'>
<div class="sidebar-toggle"><i class="icon icon-angle-left"></i></div>
<div class='cell'><?php echo $moduleTree;?></div>
<div class='cell'>
<?php if(!$moduleTree):?>
<hr class="space">
<div class="text-center text-muted"><?php echo $lang->testcase->noModule;?></div>
<hr class="space">
<?php endif;?>
<?php echo $moduleTree;?>
<div class='text-center'>
<hr class="space-sm" />
</div>
</div>
</div>
<div class='main-col'>
<div class="cell" id="queryBox" data-module='testtask'></div>
@@ -78,7 +88,7 @@
<tbody>
<?php foreach($runs as $run):?>
<tr data-id='<?php echo $run->id?>' data-auto='<?php echo $run->auto;?>'>
<?php foreach($setting as $key => $value) $this->testtask->printCell($value, $run, $users, $task, $branches, $useDatatable ? 'datatable' : 'table');?>
<?php foreach($setting as $key => $value) $this->testtask->printCell($value, $run, $users, $task, $branches, $modulePairs, $useDatatable ? 'datatable' : 'table');?>
</tr>
<?php endforeach;?>
</tbody>