* finish task #4108.

This commit is contained in:
wangyidong
2018-05-15 15:46:06 +08:00
parent a5647d69aa
commit cc4c828a1e
+58 -60
View File
@@ -12,68 +12,66 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php $this->app->loadLang('testcase'); unset($this->lang->testcase->resultList['n/a']); ?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['testtask']);?></span>
<strong><small class='text-muted'><?php echo html::icon($lang->icons['batchRun']);?></small> <?php echo $lang->testtask->common . $lang->colon . $lang->testtask->batchRun;?></strong>
<div id='mainContent' class='main-content'>
<div class='main-header'>
<h2><?php echo $lang->testtask->common . $lang->colon . $lang->testtask->batchRun;?></h2>
</div>
<form method='post' target='hiddenwin'>
<table class='table table-fixed table-form table-bordered'>
<thead>
<tr>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-100px'><?php echo $lang->testcase->module;?></th>
<th class='w-200px'><?php echo $lang->testcase->title;?></th>
<th class='precondition w-60px'><?php echo $lang->testcase->precondition;?></th>
<th class='w-80px'><?php echo $lang->testcase->result?></th>
<th> <?php echo $lang->testcase->stepDesc . '/' . $lang->testcase->stepExpect?></th>
</tr>
</thead>
<?php foreach($caseIDList as $caseID):?>
<?php if(!$productID) $moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($cases[$caseID]->product, $viewType = 'case', $startModuleID = 0);?>
<tr class='text-center'>
<td><?php echo $caseID . html::hidden("version[$caseID]", $cases[$caseID]->version)?></td>
<td class='text-left'><?php echo "<span title='" . $moduleOptionMenu[$cases[$caseID]->module] . "'>" . $moduleOptionMenu[$cases[$caseID]->module] . "</span>"?></td>
<td class='text-left wordwrap'><?php echo "<span title='{$cases[$caseID]->title}'>{$cases[$caseID]->title}</span>"?></td>
<td class='text-left precondition wordwrap'><?php echo "<span title='{$cases[$caseID]->precondition}'>{$cases[$caseID]->precondition}</span>"?></td>
<td><?php echo html::radio("results[$caseID]", $this->lang->testcase->resultList, 'pass', "onclick='showAction(this.value,\".action$caseID\")'", 'block')?></td>
<td>
<?php if(!empty($steps[$caseID])):?>
<table class='table table-fixed'>
<?php $stepId = $childId = 0;?>
<?php foreach($steps[$caseID] as $stepID => $step):?>
<?php
if($step->type == 'group' or $step->type == 'step')
{
$stepId ++;
$childId = 0;
}
$ID = $step->type == 'item' ? "{$stepId}.{$childId}" : $stepId;
$stepClass = $step->type == 'item' ? 'step-item' : 'step-group';
?>
<tr>
<td class='text-left w-p30' <?php if($step->type == 'group') echo "colspan='2'"?>><?php echo "<span title='$step->desc' class='$stepClass'>" . $ID . "、" . $step->desc . '</span>'?></td>
<?php if($step->type != 'group'):?>
<td class='text-left w-p30'><?php echo "<span title='$step->expect'>" . $lang->testcase->stepExpect . ":" . $step->expect . '</span>'?></td>
<td class='w-80px hidden action<?php echo $caseID?>'><?php echo html::select("steps[$caseID][$stepID]", $lang->testcase->resultList, 'pass', "class='form-control'")?></td>
<td class='hidden action<?php echo $caseID?>'><?php echo html::input("reals[$caseID][$stepID]", '', "class='form-control'");?></td>
<?php endif;?>
</tr>
<?php $childId ++;?>
<?php endforeach?>
</table>
<?php else:?>
<span class='hidden action<?php echo $caseID?>'><?php echo html::input("reals[$caseID][]", '', "class='form-control'");?></span>
<?php endif;?>
</td>
</tr>
<?php endforeach;?>
<tr><td colspan='6' class='text-center'><?php echo html::submitButton();?></td></tr>
</table>
</form>
</div>
<form class='form-condensed' method='post' target='hiddenwin'>
<table class='table table-fixed table-form table-bordered'>
<thead>
<tr>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-100px'><?php echo $lang->testcase->module;?></th>
<th width='200'> <?php echo $lang->testcase->title;?></th>
<th class='precondition' width='60'><?php echo $lang->testcase->precondition;?></th>
<th width='180'> <?php echo $lang->testcase->result?></th>
<th> <?php echo $lang->testcase->stepDesc . '/' . $lang->testcase->stepExpect?></th>
</tr>
</thead>
<?php foreach($caseIDList as $caseID):?>
<?php if(!$productID) $moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($cases[$caseID]->product, $viewType = 'case', $startModuleID = 0);?>
<tr class='text-center'>
<td><?php echo $caseID . html::hidden("version[$caseID]", $cases[$caseID]->version)?></td>
<td class='text-left'><?php echo "<span title='" . $moduleOptionMenu[$cases[$caseID]->module] . "'>" . $moduleOptionMenu[$cases[$caseID]->module] . "</span>"?></td>
<td class='text-left wordwrap'><?php echo "<span title='{$cases[$caseID]->title}'>{$cases[$caseID]->title}</span>"?></td>
<td class='text-left precondition wordwrap'><?php echo "<span title='{$cases[$caseID]->precondition}'>{$cases[$caseID]->precondition}</span>"?></td>
<td><?php echo html::radio("results[$caseID]", $this->lang->testcase->resultList, 'pass', "onclick='showAction(this.value,\".action$caseID\")'", 'block')?></td>
<td>
<?php if(!empty($steps[$caseID])):?>
<table class='table table-fixed'>
<?php $stepId = $childId = 0;?>
<?php foreach($steps[$caseID] as $stepID => $step):?>
<?php
if($step->type == 'group' or $step->type == 'step')
{
$stepId ++;
$childId = 0;
}
$ID = $step->type == 'item' ? "{$stepId}.{$childId}" : $stepId;
$stepClass = $step->type == 'item' ? 'step-item' : 'step-group';
?>
<tr>
<td class='text-left w-p30' <?php if($step->type == 'group') echo "colspan='2'"?>><?php echo "<span title='$step->desc' class='$stepClass'>" . $ID . "、" . $step->desc . '</span>'?></td>
<?php if($step->type != 'group'):?>
<td class='text-left w-p30'><?php echo "<span title='$step->expect'>" . $lang->testcase->stepExpect . ":" . $step->expect . '</span>'?></td>
<td class='w-80px hidden action<?php echo $caseID?>'><?php echo html::select("steps[$caseID][$stepID]", $lang->testcase->resultList, 'pass', "class='form-control'")?></td>
<td class='hidden action<?php echo $caseID?>'><?php echo html::input("reals[$caseID][$stepID]", '', "class='form-control'");?></td>
<?php endif;?>
</tr>
<?php $childId ++;?>
<?php endforeach?>
</table>
<?php else:?>
<span class='hidden action<?php echo $caseID?>'><?php echo html::input("reals[$caseID][]", '', "class='form-control'");?></span>
<?php endif;?>
</td>
</tr>
<?php endforeach;?>
<tr><td colspan='6' class='text-center'><?php echo html::submitButton();?></td></tr>
</table>
</form>
<script type='text/javascript'>
<script>
function showAction(value, obj)
{
if(value == 'pass')