* Task#4115.

This commit is contained in:
滔哥
2018-05-14 15:25:31 +08:00
parent e46a670ddc
commit 39d5b73286
3 changed files with 254 additions and 242 deletions
+2 -2
View File
@@ -1,2 +1,2 @@
.w-180px{width:180px}
.chosen-container[id^="module"] .chosen-drop {min-width: 400px; border-top: 1px solid #ddd!important}
#batchCreateForm .input-group .colorpicker {z-index: 2;}
#batchCreateForm .input-group .colorpicker.open {z-index: 5;}
+59 -54
View File
@@ -13,63 +13,68 @@
<?php include '../../common/view/header.html.php';?>
<?php js::set('testcaseBatchCreateNum', $config->testcase->batchCreate);?>
<?php js::set('libID', $libID);?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['testcase']);?></span>
<strong>
<small class='text-muted'><?php echo html::icon($lang->icons['batchCreate']);?></small>
<?php echo $lang->testcase->batchCreate;?>
</strong>
<div class='actions'>
<?php echo html::commonButton($lang->pasteText, "data-toggle='myModal' ")?>
<div id="mainContent" class="main-content">
<div class="main-header">
<h2><?php echo $lang->testcase->batchCreate;?></h2>
<div class="pull-right btn-toolbar">
<?php echo html::commonButton($lang->pasteText, "data-toggle='importLinesModal' ", 'btn btn-info')?>
</div>
</div>
</div>
<form class='form-condensed' method='post' enctype='multipart/form-data' target='hiddenwin'>
<table align='center' class='table table-form table-fixed'>
<thead>
<tr>
<th class='w-50px'> <?php echo $lang->idAB;?></th>
<th class='w-180px'><?php echo $lang->testcase->module;?></th>
<th><?php echo $lang->testcase->title;?> <span class='required'></span></th>
<th class='w-100px'><?php echo $lang->testcase->type;?> <span class='required'></span></th>
<th class='w-80px'> <?php echo $lang->testcase->pri;?></th>
<th class='w-150px'><?php echo $lang->testcase->precondition;?></th>
<th class='w-100px'><?php echo $lang->testcase->keywords;?></th>
<th class='w-200px'><?php echo $lang->testcase->stage;?></th>
<form method='post' class='load-indicator main-form' enctype='multipart/form-data' target='hiddenwin' id="batchCreateForm">
<table align='center' class='table table-form' id="tableBody">
<thead>
<tr>
<th class='w-50px'> <?php echo $lang->idAB;?></th>
<th class='w-180px'><?php echo $lang->testcase->module;?></th>
<th><?php echo $lang->testcase->title;?> <span class='required'></span></th>
<th class='w-100px'><?php echo $lang->testcase->type;?> <span class='required'></span></th>
<th class='w-80px'> <?php echo $lang->testcase->pri;?></th>
<th class='w-150px'><?php echo $lang->testcase->precondition;?></th>
<th class='w-100px'><?php echo $lang->testcase->keywords;?></th>
<th class='w-200px'><?php echo $lang->testcase->stage;?></th>
</tr>
</thead>
<tbody>
<?php unset($lang->testcase->typeList['']);?>
<?php for($i = 0; $i < $config->testcase->batchCreate; $i++):?>
<?php
if($i != 0) $currentModuleID = 'ditto';
if($i != 0) $lang->testcase->typeList['ditto'] = $lang->testcase->ditto;
if($i != 0) $lang->testcase->priList['ditto'] = $lang->testcase->ditto;
$type = $i == 0 ? 'feature' : 'ditto';
$pri = $i == 0 ? 3 : 'ditto';
?>
<tr class='text-center'>
<td><?php echo $i+1;?></td>
<td class='text-left' style='overflow:visible'><?php echo html::select("module[$i]", $moduleOptionMenu, $currentModuleID, "class='form-control chosen'");?></td>
<td style='overflow:visible'>
<div class='input-group'>
<div class="input-control has-icon-right">
<?php echo html::input("title[$i]", '', "class='form-control' autocomplete='off'");?>
<div class="colorpicker">
<button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown"><span class="cp-title"></span><span class="color-bar"></span><i class="ic"></i></button>
<ul class="dropdown-menu clearfix">
<li class="heading"><?php echo $lang->testcase->colorTag;?><i class="icon icon-close"></i></li>
</ul>
<?php echo html::hidden("color[$i]", '', "data-provide='colorpicker' data-icon='color' data-wrapper='input-control-icon-right' data-update-color='#title\\[$i\\]'");?>
</div>
</div>
</div>
</td>
<td><?php echo html::select("type[$i]", $lang->testcase->typeList, $type, "class=form-control");?></td>
<td><?php echo html::select("pri[$i]", $lang->testcase->priList, $pri, "class=form-control");?></td>
<td><?php echo html::textarea("precondition[$i]", '', "rows='1' class='form-control autosize'")?></td>
<td><?php echo html::input("keywords[$i]", '', "class='form-control' autocomplete='off'");?></td>
<td class='text-left' style='overflow:visible'><?php echo html::select("stage[$i][]", $lang->testcase->stageList, '', "class='form-control chosen' multiple");?></td>
</tr>
</thead>
<?php unset($lang->testcase->typeList['']);?>
<?php for($i = 0; $i < $config->testcase->batchCreate; $i++):?>
<?php
if($i != 0) $currentModuleID = 'ditto';
if($i != 0) $lang->testcase->typeList['ditto'] = $lang->testcase->ditto;
if($i != 0) $lang->testcase->priList['ditto'] = $lang->testcase->ditto;
$type = $i == 0 ? 'feature' : 'ditto';
$pri = $i == 0 ? 3 : 'ditto';
?>
<tr class='text-center'>
<td><?php echo $i+1;?></td>
<td class='text-left' style='overflow:visible'><?php echo html::select("module[$i]", $moduleOptionMenu, $currentModuleID, "class='form-control chosen'");?></td>
<td style='overflow:visible'>
<div class='input-group'>
<?php echo html::hidden("color[$i]", '', "data-provide='colorpicker' data-wrapper='input-group-btn fix-border-right' data-pull-menu-right='false' data-btn-tip='{$lang->testcase->colorTag}' data-update-text='#title\\[{$i}\\]'");?>
<?php echo html::input("title[$i]", '', "class='form-control' autocomplete='off'");?>
</div>
</td>
<td><?php echo html::select("type[$i]", $lang->testcase->typeList, $type, "class=form-control");?></td>
<td><?php echo html::select("pri[$i]", $lang->testcase->priList, $pri, "class=form-control");?></td>
<td><?php echo html::textarea("precondition[$i]", '', "rows='1' class='form-control autosize'")?></td>
<td><?php echo html::input("keywords[$i]", '', "class='form-control' autocomplete='off'");?></td>
<td class='text-left' style='overflow:visible'><?php echo html::select("stage[$i][]", $lang->testcase->stageList, '', "class='form-control chosen' multiple");?></td>
</tr>
<?php endfor;?>
<tfoot>
<tr><td colspan='8' class='text-center'><?php echo html::submitButton() . html::backButton();?></td></tr>
</tfoot>
</table>
</form>
<?php endfor;?>
</tbody>
<tfoot>
<tr><td colspan='8' class='text-center'><?php echo html::submitButton('', '', 'btn btn-primary btn-wide')?> <?php echo html::backButton('', '', 'btn btn-wide');?></td></tr>
</tfoot>
</table>
</form>
</div>
<table class='hide' id='trTemp'>
<tbody>
<tr class='text-center'>
+193 -186
View File
@@ -14,200 +14,207 @@
<?php js::set('lblDelete', $lang->testcase->deleteStep);?>
<?php js::set('lblBefore', $lang->testcase->insertBefore);?>
<?php js::set('lblAfter', $lang->testcase->insertAfter);?>
<div class='container mw-1400px'>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['testcase']);?></span>
<strong><small class='text-muted'><?php echo html::icon($lang->icons['create']);?></small> <?php echo $lang->testcase->create;?></strong>
<div class='main-content' id="mainContent">
<div class='center-block'>
<div class='main-header'>
<h2><?php echo $lang->testcase->create;?></h2>
</div>
</div>
<form class='form-condensed' method='post' enctype='multipart/form-data' id='dataform' target='hiddenwin'>
<table class='table table-form'>
<tr>
<th class='w-80px'><?php echo $lang->testcase->lib;?></th>
<td class='w-p45-f'>
<div class='input-group'>
<?php echo html::select('lib', $libraries, $libID, "onchange='loadLibModules(this.value);' class='form-control chosen'");?>
</div>
</td>
<td style='padding-left:15px;'>
<div class='input-group' id='moduleIdBox'>
<span class="input-group-addon"><?php echo $lang->testcase->module?></span>
<?php
echo html::select('module', $moduleOptionMenu, $currentModuleID, "onchange='loadModuleRelated();' class='form-control chosen'");
if(count($moduleOptionMenu) == 1)
{
echo "<span class='input-group-btn'>";
echo html::a($this->createLink('tree', 'browse', "rootID=$libID&view=caselib&currentModuleID=0"), "<i class='icon icon-cog'></i>", '_blank', "data-toggle='tooltip' class='btn' title='{$lang->tree->manage}'");
echo '</span>';
echo "<span class='input-group-btn'>";
echo html::a("javascript:loadLibModules($libID)", "<i class='icon icon-refresh'></i>", '', "data-toggle='tooltip' class='btn' title='{$lang->refresh}'");
echo '</span>';
}
?>
</div>
</td><td></td>
</tr>
<tr>
<th><?php echo $lang->testcase->type;?></th>
<td><?php echo html::select('type', $lang->testcase->typeList, $type, "class='form-control chosen'");?></td>
<td style='padding-left:15px'>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->testcase->stage?></span>
<?php echo html::select('stage[]', $lang->testcase->stageList, $stage, "class='form-control chosen' multiple='multiple'");?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->testcase->title;?></th>
<td colspan='2'>
<div class='row-table'>
<div class='col-table w-p100'>
<div class='input-group w-p100'>
<input type='hidden' id='color' name='color' data-provide='colorpicker' data-wrapper='input-group-btn' data-pull-menu-right='false' data-btn-tip='<?php echo $lang->testcase->colorTag ?>' data-update-text='#title'>
<form method='post' enctype='multipart/form-data' id='dataform' target='hiddenwin'>
<table class='table table-form'>
<tbody>
<tr>
<th><?php echo $lang->testcase->lib;?></th>
<td>
<div class='input-group'>
<?php echo html::select('lib', $libraries, $libID, "onchange='loadLibModules(this.value);' class='form-control chosen'");?>
</div>
</td>
<td style='padding-left:15px;'>
<div class='input-group' id='moduleIdBox'>
<span class="input-group-addon"><?php echo $lang->testcase->module?></span>
<?php
echo html::select('module', $moduleOptionMenu, $currentModuleID, "onchange='loadModuleRelated();' class='form-control chosen'");
if(count($moduleOptionMenu) == 1)
{
echo "<span class='input-group-btn'>";
echo html::a($this->createLink('tree', 'browse', "rootID=$libID&view=caselib&currentModuleID=0"), "<i class='icon icon-cog'></i>", '_blank', "data-toggle='tooltip' class='btn' title='{$lang->tree->manage}'");
echo '</span>';
echo "<span class='input-group-btn'>";
echo html::a("javascript:loadLibModules($libID)", "<i class='icon icon-refresh'></i>", '', "data-toggle='tooltip' class='btn' title='{$lang->refresh}'");
echo '</span>';
}
?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->testcase->type;?></th>
<td><?php echo html::select('type', $lang->testcase->typeList, $type, "class='form-control chosen'");?></td>
<td style='padding-left:15px'>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->testcase->stage?></span>
<?php echo html::select('stage[]', $lang->testcase->stageList, $stage, "class='form-control chosen' multiple='multiple'");?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->testcase->title;?></th>
<td colspan='2'>
<div class="input-control has-icon-right">
<?php echo html::input('title', $caseTitle, "class='form-control' autocomplete='off'");?>
<?php if(!$this->loadModel('testcase')->forceNotReview()):?>
<span class='input-group-addon'><?php echo html::checkbox('forceNotReview', $lang->testcase->forceNotReview, '', "id='forceNotReview'");?></span>
<?php endif;?>
<div class="colorpicker">
<button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown"><span class="cp-title"></span><span class="color-bar"></span><i class="ic"></i></button>
<ul class="dropdown-menu clearfix">
<li class="heading"><?php echo $lang->testcase->colorTag;?><i class="icon icon-close"></i></li>
</ul>
<input type="hidden" class="colorpicker" id="color" name="color" value="" data-icon="color" data-wrapper="input-control-icon-right" data-update-color="#title" data-provide="colorpicker">
</div>
</div>
<div class='col-table'>
<div class='input-group'>
<span class='input-group-addon fix-border br-0'><?php echo $lang->testcase->pri;?></span>
<?php
$hasCustomPri = false;
foreach($lang->testcase->priList as $priKey => $priValue)
</td>
</tr>
<tr>
<th><?php echo $lang->testcase->pri;?></th>
<td colspan="2">
<?php
$hasCustomPri = false;
foreach($lang->testcase->priList as $priKey => $priValue)
{
if(!empty($priKey) and (string)$priKey != (string)$priValue)
{
if(!empty($priKey) and (string)$priKey != (string)$priValue)
{
$hasCustomPri = true;
break;
}
$hasCustomPri = true;
break;
}
?>
<?php if($hasCustomPri):?>
<?php echo html::select('pri', (array)$lang->testcase->priList, $pri, "class='form-control minw-80px'");?>
<?php else: ?>
<div class='input-group-btn dropdown-pris'>
<button type='button' class='btn dropdown-toggle br-0' data-toggle='dropdown'>
<span class='pri-text'></span> &nbsp;<span class='caret'></span>
</button>
<ul class='dropdown-menu pull-right'></ul>
<?php echo html::select('pri', (array)$lang->testcase->priList, $pri, "class='hide'");?>
</div>
<?php endif; ?>
</div>
</div>
}
$priList = $lang->testcase->priList;
if(end($priList))
{
unset($priList[0]);
$priList[0] = '';
}
?>
<?php if($hasCustomPri):?>
<?php echo html::select('pri', (array)$priList, $pri, "class='form-control chosen'");?>
<?php else: ?>
<?php echo html::select('pri', (array)$priList, $pri, "class='form-control' data-provide='labelSelector'");?>
<?php endif; ?>
</td>
</tr>
<tr>
<th><?php echo $lang->testcase->precondition;?></th>
<td colspan='2'><?php echo html::textarea('precondition', $precondition, " rows='2' class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->testcase->steps;?></th>
<td colspan='2'>
<table class='table table-form mg-0 table-bordered' style='border: 1px solid #ddd'>
<thead>
<tr>
<th class='w-40px text-right'><?php echo $lang->testcase->stepID;?></th>
<th width="45%"><?php echo $lang->testcase->stepDesc;?></th>
<th><?php echo $lang->testcase->stepExpect;?></th>
<th class='step-actions'><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody id='steps' class='sortable' data-group-name='<?php echo $lang->testcase->groupName ?>'>
<tr class='template step' id='stepTemplate'>
<td class='step-id'></td>
<td>
<div class='input-group'>
<span class='input-group-addon step-item-id'></span>
<textarea rows='1' class='form-control autosize step-steps' name='steps[]'></textarea>
<span class="input-group-addon step-type-toggle">
<input type='hidden' name='stepType[]' value='item' class='step-type'>
<div class='step-type-menu-box'>
<div class='step-type-current'><span></span> <i class='caret'></i></div>
<div class='step-type-menu'>
<a href='javascript:;' href='step-type-option' data-value='step'><?php echo $lang->testcase->step ?></a>
<a href='javascript:;' href='step-type-option' data-value='group'><?php echo $lang->testcase->group ?></a>
<a href='javascript:;' href='step-type-option' data-value='item'><?php echo $lang->testcase->stepChild ?></a>
</div>
</div>
</span>
</div>
</td>
<td><textarea rows='1' class='form-control autosize step-expects' name='expects[]'></textarea></td>
<td class='step-actions'>
<div class='btn-group'>
<button type='button' class='btn btn-step-add'><i class='icon icon-plus'></i></button>
<button type='button' class='btn btn-step-move'><i class='icon icon-move'></i></button>
<button type='button' class='btn btn-step-delete'><i class='icon icon-trash'></i></button>
</div>
</td>
</tr>
<?php foreach($steps as $stepID => $step):?>
<tr class='step'>
<td class='step-id'></td>
<td>
<div class='input-group'>
<span class='input-group-addon step-item-id'></span>
<?php echo html::textarea('steps[]', $step->desc, "rows='1' class='form-control autosize step-steps'") ?>
<span class='input-group-addon step-type-toggle'>
<?php if(!isset($step->type)) $step->type = 'step';?>
<input type='hidden' name='stepType[]' value='<?php echo $step->type ?>' class='step-type'>
<div class='step-type-menu-box'>
<div class='step-type-current'><span></span> <i class='caret'></i></div>
<div class='step-type-menu'>
<a href='javascript:;' href='step-type-option' data-value='step'><?php echo $lang->testcase->step ?></a>
<a href='javascript:;' href='step-type-option' data-value='group'><?php echo $lang->testcase->group ?></a>
<a href='javascript:;' href='step-type-option' data-value='item'><?php echo $lang->testcase->stepChild ?></a>
</div>
</div>
</span>
</div>
</td>
<td><?php echo html::textarea('expects[]', $step->expect, "rows='1' class='form-control autosize step-expects'") ?></td>
<td class='step-actions'>
<div class='btn-group'>
<button type='button' class='btn btn-step-add'><i class='icon icon-plus'></i></button>
<button type='button' class='btn btn-step-move'><i class='icon icon-move'></i></button>
<button type='button' class='btn btn-step-delete'><i class='icon icon-trash'></i></button>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</td>
</tr>
<tr>
<th><?php echo $lang->testcase->keywords;?></th>
<td colspan='2'><?php echo html::input('keywords', '', "class='form-control' autocomplete='off'");?></td>
</tr>
<tr>
<th><?php echo $lang->testcase->files;?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan='2' class='text-center'>
<?php
echo html::submitButton($lang->save, '', 'btn btn-wide btn-primary');
echo ' &nbsp; ';
echo html::backButton($lang->goback, '', 'btn btn-wide');
?>
</td>
</tr>
</tfoot>
</table>
</form>
</div>
<div class='modal fade' id='searchStories'>
<div class='modal-dialog'>
<div class='modal-content'>
<div class='modal-header'>
<button type='button' class='close' data-dismiss='modal'>&times;</button>
<div class='searchInput w-p90'>
<input id='storySearchInput' type='text' class='form-control' placeholder='<?php echo $lang->testcase->searchStories?>'>
<i class='icon icon-search'></i>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->testcase->precondition;?></th>
<td colspan='2'><?php echo html::textarea('precondition', $precondition, " rows='2' class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->testcase->steps;?></th>
<td colspan='2'>
<table class='table table-form mg-0 table-bordered' style='border: 1px solid #ddd'>
<thead>
<tr>
<th class='w-40px text-right'><?php echo $lang->testcase->stepID;?></th>
<th width="45%"><?php echo $lang->testcase->stepDesc;?></th>
<th><?php echo $lang->testcase->stepExpect;?></th>
<th class='step-actions'><?php echo $lang->actions;?></th>
</tr>
</thead>
<tbody id='steps' class='sortable' data-group-name='<?php echo $lang->testcase->groupName ?>'>
<tr class='template step' id='stepTemplate'>
<td class='step-id'></td>
<td>
<div class='input-group'>
<span class='input-group-addon step-item-id'></span>
<textarea rows='1' class='form-control autosize step-steps' name='steps[]'></textarea>
<span class="input-group-addon step-type-toggle">
<input type='hidden' name='stepType[]' value='item' class='step-type'>
<div class='step-type-menu-box'>
<div class='step-type-current'><span></span> <i class='caret'></i></div>
<div class='step-type-menu'>
<a href='javascript:;' href='step-type-option' data-value='step'><?php echo $lang->testcase->step ?></a>
<a href='javascript:;' href='step-type-option' data-value='group'><?php echo $lang->testcase->group ?></a>
<a href='javascript:;' href='step-type-option' data-value='item'><?php echo $lang->testcase->stepChild ?></a>
</div>
</div>
</span>
</div>
</td>
<td><textarea rows='1' class='form-control autosize step-expects' name='expects[]'></textarea></td>
<td class='step-actions'>
<div class='btn-group'>
<button type='button' class='btn btn-step-add'><i class='icon icon-plus'></i></button>
<button type='button' class='btn btn-step-move'><i class='icon icon-move'></i></button>
<button type='button' class='btn btn-step-delete'><i class='icon icon-remove'></i></button>
</div>
</td>
</tr>
<?php foreach($steps as $stepID => $step):?>
<tr class='step'>
<td class='step-id'></td>
<td>
<div class='input-group'>
<span class='input-group-addon step-item-id'></span>
<?php echo html::textarea('steps[]', $step->desc, "rows='1' class='form-control autosize step-steps'") ?>
<span class='input-group-addon step-type-toggle'>
<?php if(!isset($step->type)) $step->type = 'step';?>
<input type='hidden' name='stepType[]' value='<?php echo $step->type ?>' class='step-type'>
<div class='step-type-menu-box'>
<div class='step-type-current'><span></span> <i class='caret'></i></div>
<div class='step-type-menu'>
<a href='javascript:;' href='step-type-option' data-value='step'><?php echo $lang->testcase->step ?></a>
<a href='javascript:;' href='step-type-option' data-value='group'><?php echo $lang->testcase->group ?></a>
<a href='javascript:;' href='step-type-option' data-value='item'><?php echo $lang->testcase->stepChild ?></a>
</div>
</div>
</span>
</div>
</td>
<td><?php echo html::textarea('expects[]', $step->expect, "rows='1' class='form-control autosize step-expects'") ?></td>
<td class='step-actions'>
<div class='btn-group'>
<button type='button' class='btn btn-step-add'><i class='icon icon-plus'></i></button>
<button type='button' class='btn btn-step-move'><i class='icon icon-move'></i></button>
<button type='button' class='btn btn-step-delete'><i class='icon icon-remove'></i></button>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</td>
</tr>
<tr>
<th><?php echo $lang->testcase->keywords;?></th>
<td colspan='2'><?php echo html::input('keywords', '', "class='form-control' autocomplete='off'");?></td>
</tr>
<tr>
<th><?php echo $lang->testcase->files;?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
</tr>
<tr>
<th></th>
<td colspan='2' class='text-center'><?php echo html::submitButton() . html::backButton();?> </td>
</tr>
</table>
</form>
</div>
<div class='modal fade' id='searchStories'>
<div class='modal-dialog'>
<div class='modal-content'>
<div class='modal-header'>
<button type='button' class='close' data-dismiss='modal'>&times;</button>
<div class='searchInput w-p90'>
<input id='storySearchInput' type='text' class='form-control' placeholder='<?php echo $lang->testcase->searchStories?>'>
<i class='icon icon-search'></i>
</div>
</div>
<div class='modal-body'>
<ul id='searchResult'></ul>
<div class='modal-body'>
<ul id='searchResult'></ul>
</div>
</div>
</div>
</div>