* save step type and display according to step type.

This commit is contained in:
chenfeiCF
2017-03-20 13:30:58 +08:00
parent 6914123274
commit 4ccf0ebc1f
4 changed files with 19 additions and 18 deletions
+4 -5
View File
@@ -69,27 +69,26 @@
<?php
if(empty($stepResult['type'])) $stepResult['type'] = 'item';
if(empty($stepResult['parent'])) $stepResult['parent'] = 0;
$stepClass = "step-{$stepResult['type']}";
if($stepResult['type'] == 'group' or ($stepResult['type'] == 'item' and $stepResult['parent'] == 0))
if($stepResult['type'] == 'group' or $stepResult['type'] == 'step')
{
$stepId++;
$childId = 0;
}
if($stepResult['type'] == 'item' and $stepResult['parent'] == 0) $stepClass = 'step-group';
$stepClass = $stepResult['type'] == 'item' ? 'step-item' : 'step-group';
$modalID = $result->id . '-' . $key;
$fileCount = '(' . count($stepResult['files']) . ')';
?>
<tr class='step <?php echo $stepClass?>'>
<td class='step-id'>
<?php if($result->caseResult == 'fail'):?>
<?php $inputName = $stepClass == 'step-item' ? 'stepIDList[]' : 'stepGroup[]';?>
<?php $inputName = $stepResult['type'] != 'group' ? 'stepIDList[]' : '';?>
<input type='checkbox' name='<?php echo $inputName;?>' value='<?php echo $key;?>'/>
<?php endif;?>
<?php echo $stepId;?>
</td>
<td class='text-left' <?php if($stepResult['type'] == 'group') echo "colspan='6'"?>>
<div class='input-group'>
<?php if($stepResult['type'] == 'item' and $stepResult['parent'] != 0) echo "<span class='step-item-id'>{$stepId}.{$childId}</span>";?>
<?php if($stepResult['type'] == 'item') echo "<span class='step-item-id'>{$stepId}.{$childId}</span>";?>
<?php if(isset($stepResult['desc'])) echo nl2br($stepResult['desc']);?>
</div>
</td>
+2 -2
View File
@@ -51,7 +51,7 @@
<?php foreach($run->case->steps as $key => $step):?>
<?php
$stepClass = "step-{$step->type}";
if($step->type == 'group' or ($step->type == 'item' and $step->parent == 0))
if($step->type == 'group' or $step->type == 'step')
{
$stepId++;
$childId = 0;
@@ -62,7 +62,7 @@
<th class='step-id'><?php echo $stepId;?></th>
<td class='text-left' <?php if($step->type == 'group') echo "colspan='4'"?>>
<div class='input-group'>
<?php if($step->type == 'item' and $step->parent != 0) echo "<span class='step-item-id'>{$stepId}.{$childId}</span>";?>
<?php if($step->type == 'item') echo "<span class='step-item-id'>{$stepId}.{$childId}</span>";?>
<?php echo nl2br($step->desc);?>
</div>
</td>