This commit is contained in:
Catouse
2018-05-15 14:22:38 +08:00
16 changed files with 566 additions and 581 deletions
-1
View File
@@ -1,2 +1 @@
function setForm(){}
function setOuterBox(){}
-1
View File
@@ -1 +0,0 @@
function setForm(){}
-1
View File
@@ -1 +0,0 @@
function setForm(){}
+1 -1
View File
@@ -29,7 +29,7 @@ include '../../common/view/chosen.html.php';
#searchForm > table > tbody > tr > td {padding: 10px 15px; color: #838A9D;}
#searchForm .form-actions {padding-bottom: 20px; padding-top: 0;}
#searchForm .chosen-container[id^="field"] .chosen-drop {min-width: 140px;}
#searchForm [id^="valueBox"] .chosen-container .chosen-single {min-width: 140px;}
#searchForm [id^="valueBox"] .chosen-container .chosen-single {min-width: 100px;}
#searchForm [id^="valueBox"] .chosen-container .chosen-drop {min-width: 300px;}
#searchForm .chosen-container .chosen-drop ul.chosen-results li {white-space:normal}
#searchForm input.date::-webkit-input-placeholder {color: #000000; opacity: 1;}
-1
View File
@@ -176,7 +176,6 @@ $(document).ready(function()
/* First unbind ajaxForm for form.*/
$("form[data-type='ajax']").unbind('submit');
setForm();
/* Bind ajaxForm for form again. */
$('.form-ajax').ajaxForm(
+2 -2
View File
@@ -98,7 +98,7 @@ $config->testcase->datatable->fieldList['branch']['required'] = 'no';
$config->testcase->datatable->fieldList['type']['title'] = 'type';
$config->testcase->datatable->fieldList['type']['fixed'] = 'no';
$config->testcase->datatable->fieldList['type']['width'] = '80';
$config->testcase->datatable->fieldList['type']['width'] = '90';
$config->testcase->datatable->fieldList['type']['required'] = 'no';
$config->testcase->datatable->fieldList['stage']['title'] = 'stage';
@@ -204,6 +204,6 @@ $config->testcase->datatable->fieldList['stepNumber']['name'] = $lang->testc
$config->testcase->datatable->fieldList['actions']['title'] = 'actions';
$config->testcase->datatable->fieldList['actions']['fixed'] = 'right';
$config->testcase->datatable->fieldList['actions']['width'] = '150';
$config->testcase->datatable->fieldList['actions']['width'] = '160';
$config->testcase->datatable->fieldList['actions']['required'] = 'yes';
$config->testcase->datatable->fieldList['actions']['sort'] = 'no';
+1 -3
View File
@@ -26,11 +26,9 @@ $(document).ready(function()
if(browseType == 'bysearch') ajaxGetSearchForm();
if($('#caseList thead th.w-title').width() < 150) $('#caseList thead th.w-title').width(150);
setModal4List('runCase', 'caseList');
if(flow == 'onlyTest')
{
$('#modulemenu > .nav').append($('#featurebar > .submenu').html());
$('#modulemenu > .nav').append($('#mainMenu > .pull-left.btn-toolbar').html());
toggleSearch();
$('.export').modalTrigger({width:650, type:'iframe', afterShown: setCheckedCookie})
-1
View File
@@ -138,7 +138,6 @@ $(function()
/* First unbind ajaxForm for form.*/
$("form[data-type='ajax']").unbind('submit');
setForm();
/* Bind ajaxForm for form again. */
$.ajaxForm("form[data-type='ajax']", function(response)
+10 -9
View File
@@ -1291,15 +1291,14 @@ class testcaseModel extends model
$class = '';
if($id == 'status') $class .= $case->status;
if($id == 'title') $class .= ' text-left';
if($id == 'id') $class .= ' cell-id';
if($id == 'actions')$class .= ' c-actions';
if($id == 'lastRunResult') $class .= $case->lastRunResult;
echo "<td class='" . $class . "'" . ($id=='title' ? " title='{$case->title}'":'') . ">";
switch($id)
{
case 'id':
if($mode == 'table') echo "<input type='checkbox' name='caseIDList[]' value='{$case->id}'/> ";
echo $canView ? html::a($caseLink, sprintf('%03d', $case->id)) : sprintf('%03d', $case->id);
echo $mode == 'table' ? html::checkbox('caseIDList', array($case->id => sprintf('%03d', $case->id))) : sprintf('%03d', $case->id);
break;
case 'pri':
echo "<span class='pri" . zget($this->lang->testcase->priList, $case->pri, $case->pri) . "'>";
@@ -1326,7 +1325,7 @@ class testcaseModel extends model
case 'status':
if($case->needconfirm)
{
echo "(<span class='warning'>{$this->lang->story->changed}</span> ";
echo "(<span class='text-warning'>{$this->lang->story->changed}</span> ";
echo html::a(helper::createLink('testcase', 'confirmStoryChange', "caseID=$case->id"), $this->lang->confirm, 'hiddenwin');
echo ")";
}
@@ -1386,10 +1385,8 @@ class testcaseModel extends model
echo $case->stepNumber;
break;
case 'actions':
common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", $case, 'list', 'play', '', 'runCase iframe', false, "data-width='95%'");
common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", $case, 'list', '', '', 'results iframe', '', "data-width='90%'");
if($this->config->testcase->needReview or !empty($this->config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'review', '', 'iframe');
common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list');
echo "<div class='more'>";
if($this->config->testcase->needReview or !empty($this->config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'glasses', '', 'iframe');
common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase&param=$case->id", $case, 'list', 'copy');
if(common::hasPriv('testcase', 'delete', $case))
@@ -1397,8 +1394,12 @@ class testcaseModel extends model
$deleteURL = helper::createLink('testcase', 'delete', "caseID=$case->id&confirm=yes");
echo html::a("javascript:ajaxDelete(\"$deleteURL\",\"batchForm\",confirmDelete)", '<i class="icon-remove"></i>', '', "title='{$this->lang->testcase->delete}' class='btn-icon'");
}
echo '</div>';
common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", $case, 'list', 'play', '', 'runCase iframe', false, "data-width='95%'");
common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", $case, 'list', '', '', 'results iframe', '', "data-width='90%'");
common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list');
common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=", $case, 'list', 'bug', '', 'iframe', '', "data-width='90%'");
break;
}
echo '</td>';
+160 -166
View File
@@ -23,182 +23,176 @@ js::set('batchDelete', $lang->testcase->confirmBatchDelete);
js::set('productID', $productID);
js::set('branch', $branch);
?>
<div class='side' id='treebox'>
<a class='side-handle' data-id='testcaseTree'><i class='icon-caret-left'></i></a>
<div class='side-body'>
<div class='panel panel-sm'>
<div class='panel-heading nobr'><?php echo html::icon($lang->icons['product']);?> <strong><?php echo $branch ? $branches[$branch] : $productName;?></strong></div>
<div class='panel-body'>
<?php echo $moduleTree;?>
<div class='text-right'>
<?php common::printLink('tree', 'browse', "productID=$productID&view=case", $lang->tree->manage);?>
</div>
<div id="mainContent" class="main-row">
<div class='side-col' id='sidebar'>
<div class='cell'>
<?php echo $moduleTree;?>
<div class='text-center'>
<?php common::printLink('tree', 'browse', "productID=$productID&view=case", $lang->tree->manage, '', "class='btn btn-info btn-wide'");?>
<hr class="space-sm" />
</div>
</div>
</div>
</div>
<div class='main'>
<script>setTreeBox();</script>
<form id='batchForm' method='post'>
<?php
$datatableId = $this->moduleName . ucfirst($this->methodName);
$useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable');
$vars = "productID=$productID&branch=$branch&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
if($useDatatable) include '../../common/view/datatable.html.php';
if(!$useDatatable) include '../../common/view/tablesorter.html.php';
$setting = $this->datatable->getSetting('testcase');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
?>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed <?php echo $useDatatable ? 'datatable' : ''?>' id='caseList' data-checkable='true' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>' data-custom-menu='true' data-checkbox-name='caseIDList[]'>
<thead>
<tr>
<?php
foreach($setting as $key => $value)
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars);
$columns ++;
}
}
?>
</tr>
</thead>
<tbody>
<?php foreach($cases as $case):?>
<tr class='text-center' data-id='<?php echo $case->id?>'>
<?php foreach($setting as $key => $value) $this->testcase->printCell($value, $case, $users, $branches, $modulePairs, $browseType, $useDatatable ? 'datatable' : 'table');?>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='<?php echo $columns?>'>
<?php if($cases):?>
<div class='table-actions clearfix'>
<?php echo html::selectButton();?>
<div class='btn-group dropup'>
<div class='main-col'>
<div id='queryBox' class='cell <?php if($browseType =='bysearch') echo 'show';?>'></div>
<form class='main-table table-case' data-ride='table' id='batchForm' method='post'>
<?php
$datatableId = $this->moduleName . ucfirst($this->methodName);
$useDatatable = (isset($this->config->datatable->$datatableId->mode) and $this->config->datatable->$datatableId->mode == 'datatable');
$vars = "productID=$productID&branch=$branch&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
if($useDatatable) include '../../common/view/datatable.html.php';
if(!$useDatatable) include '../../common/view/tablesorter.html.php';
$setting = $this->datatable->getSetting('testcase');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
?>
<table class='table has-sort-head <?php echo $useDatatable ? 'datatable' : ''?>' id='caseList' data-checkable='true' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>' data-custom-menu='true' data-checkbox-name='caseIDList[]'>
<thead>
<tr>
<?php
foreach($setting as $key => $value)
{
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars);
$columns ++;
}
}
?>
</tr>
</thead>
<tbody>
<?php foreach($cases as $case):?>
<tr data-id='<?php echo $case->id?>'>
<?php foreach($setting as $key => $value) $this->testcase->printCell($value, $case, $users, $branches, $modulePairs, $browseType, $useDatatable ? 'datatable' : 'table');?>
</tr>
<?php endforeach;?>
</tbody>
</table>
<?php if($cases):?>
<div class='table-footer'>
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<div class='table-actions btn-toolbar'>
<div class='btn-group dropup'>
<?php
$class = "class='disabled'";
$actionLink = $this->createLink('testcase', 'batchEdit', "productID=$productID&branch=$branch");
$misc = common::hasPriv('testcase', 'batchEdit') ? "onclick=\"setFormAction('$actionLink')\"" : "disabled='disabled'";
echo html::commonButton($lang->edit, $misc);
?>
<button type='button' class='btn dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>
<ul class='dropdown-menu' id='moreActionMenu'>
<?php
$actionLink = $this->createLink('testcase', 'batchDelete', "productID=$productID");
$misc = common::hasPriv('testcase', 'batchDelete') ? "onclick=\"confirmBatchDelete('$actionLink')\"" : $class;
echo "<li>" . html::a('#', $lang->delete, '', $misc) . "</li>";
if(common::hasPriv('testcase', 'batchReview') and ($config->testcase->needReview or !empty($config->testcase->forceReview)))
{
echo "<li class='dropdown-submenu'>";
echo html::a('javascript:;', $lang->testcase->review, '', "id='reviewItem'");
echo "<ul class='dropdown-menu'>";
unset($lang->testcase->reviewResultList['']);
foreach($lang->testcase->reviewResultList as $key => $result)
{
$actionLink = $this->createLink('testcase', 'batchReview', "result=$key");
echo '<li>' . html::a('#', $result, '', "onclick=\"setFormAction('$actionLink','hiddenwin')\"") . '</li>';
}
echo '</ul></li>';
}
if(common::hasPriv('testcase', 'batchConfirmStoryChange'))
{
$actionLink = $this->createLink('testcase', 'batchConfirmStoryChange', "productID=$productID");
$misc = common::hasPriv('testcase', 'batchConfirmStoryChange') ? "onclick=\"setFormAction('$actionLink')\"" : $class;
echo "<li>" . html::a('#', $lang->testcase->confirmStoryChange, '', $misc) . "</li>";
}
$actionLink = $this->createLink('testtask', 'batchRun', "productID=$productID&orderBy=$orderBy");
$misc = common::hasPriv('testtask', 'batchRun') ? "onclick=\"setFormAction('$actionLink')\"" : $class;
echo "<li>" . html::a('#', $lang->testtask->runCase, '', $misc) . "</li>";
if(common::hasPriv('testcase', 'batchCaseTypeChange'))
{
echo "<li class='dropdown-submenu'>";
echo html::a('javascript:;', $lang->testcase->type, '', "id='typeChangeItem'");
echo "<ul class='dropdown-menu'>";
unset($lang->testcase->typeList['']);
foreach($lang->testcase->typeList as $key => $result)
{
$actionLink = $this->createLink('testcase', 'batchCaseTypeChange', "result=$key");
echo '<li>' . html::a('#', $result, '', "onclick=\"setFormAction('$actionLink','hiddenwin')\"") . '</li>';
}
echo '</ul></li>';
}
?>
</ul>
</div>
<?php if(common::hasPriv('testcase', 'batchChangeBranch') and $this->session->currentProductType != 'normal'):?>
<div class="btn-group dropup">
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->product->branchName[$this->session->currentProductType];?> <span class="caret"></span></button>
<?php $withSearch = count($branches) > 10;?>
<?php if($withSearch):?>
<div class="dropdown-menu search-list" data-ride="searchList">
<div class="input-control search-box search-box-circle has-icon-left has-icon-right search-example">
<input id="userSearchBox" type="search" autocomplete="off" class="form-control search-input">
<label for="userSearchBox" class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label>
<a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a>
</div>
<?php else:?>
<div class="dropdown-menu">
<?php endif;?>
<div class="list-group">
<?php
$class = "class='disabled'";
$actionLink = $this->createLink('testcase', 'batchEdit', "productID=$productID&branch=$branch");
$misc = common::hasPriv('testcase', 'batchEdit') ? "onclick=\"setFormAction('$actionLink')\"" : "disabled='disabled'";
echo html::commonButton($lang->edit, $misc);
foreach($branches as $branchID => $branchName)
{
$actionLink = $this->createLink('testcase', 'batchChangeBranch', "branchID=$branchID");
echo html::a('#', $branchName, '', "onclick=\"setFormAction('$actionLink', 'hiddenwin')\" data-key='$branchID'");
}
?>
<button type='button' class='btn dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>
<ul class='dropdown-menu' id='moreActionMenu'>
<?php
$actionLink = $this->createLink('testcase', 'batchDelete', "productID=$productID");
$misc = common::hasPriv('testcase', 'batchDelete') ? "onclick=\"confirmBatchDelete('$actionLink')\"" : $class;
echo "<li>" . html::a('#', $lang->delete, '', $misc) . "</li>";
if(common::hasPriv('testcase', 'batchReview') and ($config->testcase->needReview or !empty($config->testcase->forceReview)))
{
echo "<li class='dropdown-submenu'>";
echo html::a('javascript:;', $lang->testcase->review, '', "id='reviewItem'");
echo "<ul class='dropdown-menu'>";
unset($lang->testcase->reviewResultList['']);
foreach($lang->testcase->reviewResultList as $key => $result)
{
$actionLink = $this->createLink('testcase', 'batchReview', "result=$key");
echo '<li>' . html::a('#', $result, '', "onclick=\"setFormAction('$actionLink','hiddenwin')\"") . '</li>';
}
echo '</ul></li>';
}
elseif($config->testcase->needReview or !empty($config->testcase->forceReview))
{
echo '<li>' . html::a('javascript:;', $lang->testcase->review, '', $class) . '</li>';
}
if(common::hasPriv('testcase', 'batchConfirmStoryChange'))
{
$actionLink = $this->createLink('testcase', 'batchConfirmStoryChange', "productID=$productID");
$misc = common::hasPriv('testcase', 'batchConfirmStoryChange') ? "onclick=\"setFormAction('$actionLink')\"" : $class;
echo "<li>" . html::a('#', $lang->testcase->confirmStoryChange, '', $misc) . "</li>";
}
else
{
echo '<li>' . html::a('javascript:;', $lang->testcase->batchConfirmStoryChange, '', $class) . '</li>';
}
$actionLink = $this->createLink('testtask', 'batchRun', "productID=$productID&orderBy=$orderBy");
$misc = common::hasPriv('testtask', 'batchRun') ? "onclick=\"setFormAction('$actionLink')\"" : $class;
echo "<li>" . html::a('#', $lang->testtask->runCase, '', $misc) . "</li>";
if(common::hasPriv('testcase', 'batchChangeBranch') and $this->session->currentProductType != 'normal')
{
$withSearch = count($branches) > 8;
echo "<li class='dropdown-submenu'>";
echo html::a('javascript:;', $lang->product->branchName[$this->session->currentProductType], '', "id='branchItem'");
echo "<div class='dropdown-menu" . ($withSearch ? ' with-search':'') . "'>";
echo "<ul class='dropdown-list'>";
foreach($branches as $branchID => $branchName)
{
$actionLink = $this->createLink('testcase', 'batchChangeBranch', "branchID=$branchID");
echo "<li class='option' data-key='$branchID'>" . html::a('#', $branchName, '', "onclick=\"setFormAction('$actionLink', 'hiddenwin')\"") . "</li>";
}
echo '</ul>';
if($withSearch) echo "<div class='menu-search'><div class='input-group input-group-sm'><input type='text' class='form-control' placeholder=''><span class='input-group-addon'><i class='icon-search'></i></span></div></div>";
echo '</div></li>';
}
if(common::hasPriv('testcase', 'batchChangeModule'))
{
$withSearch = count($modules) > 8;
echo "<li class='dropdown-submenu'>";
echo html::a('javascript:;', $lang->testcase->moduleAB, '', "id='moduleItem'");
echo "<div class='dropdown-menu" . ($withSearch ? ' with-search' : '') . "'>";
echo '<ul class="dropdown-list">';
foreach($modules as $moduleId => $module)
{
$actionLink = $this->createLink('testcase', 'batchChangeModule', "moduleID=$moduleId");
echo "<li class='option' data-key='$moduleID'>" . html::a('#', $module, '', "onclick=\"setFormAction('$actionLink','hiddenwin')\"") . "</li>";
}
echo '</ul>';
if($withSearch) echo "<div class='menu-search'><div class='input-group input-group-sm'><input type='text' class='form-control' placeholder=''><span class='input-group-addon'><i class='icon-search'></i></span></div></div>";
echo '</div></li>';
}
else
{
echo '<li>' . html::a('javascript:;', $lang->testcase->moduleAB, '', $class) . '</li>';
}
if(common::hasPriv('testcase', 'batchCaseTypeChange'))
{
echo "<li class='dropdown-submenu'>";
echo html::a('javascript:;', $lang->testcase->type, '', "id='typeChangeItem'");
echo "<ul class='dropdown-menu'>";
unset($lang->testcase->typeList['']);
foreach($lang->testcase->typeList as $key => $result)
{
$actionLink = $this->createLink('testcase', 'batchCaseTypeChange', "result=$key");
echo '<li>' . html::a('#', $result, '', "onclick=\"setFormAction('$actionLink','hiddenwin')\"") . '</li>';
}
echo '</ul></li>';
}
else
{
echo '<li>' . html::a('javascript:;', $lang->testcase->type, '', $class) . '</li>';
}
?>
</ul>
</div>
</div>
<?php endif?>
<div class='text-right'><?php $pager->show();?></div>
</td>
</tr>
</tfoot>
</table>
</form>
</div>
<?php endif;?>
<?php if(common::hasPriv('testcase', 'batchChangeModule')):?>
<div class="btn-group dropup">
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->story->moduleAB;?> <span class="caret"></span></button>
<?php $withSearch = count($modules) > 10;?>
<?php if($withSearch):?>
<div class="dropdown-menu search-list" data-ride="searchList">
<div class="input-control search-box search-box-circle has-icon-left has-icon-right search-example">
<input id="userSearchBox" type="search" autocomplete="off" class="form-control search-input">
<label for="userSearchBox" class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label>
<a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a>
</div>
<?php else:?>
<div class="dropdown-menu">
<?php endif;?>
<div class="list-group">
<?php
foreach($modules as $moduleId => $module)
{
$actionLink = $this->createLink('testcase', 'batchChangeModule', "moduleID=$moduleId");
echo html::a('#', $module, '', "onclick=\"setFormAction('$actionLink','hiddenwin')\" data-key='$moduleID'");
}
?>
</div>
</div>
</div>
<?php endif;?>
</div>
<?php $pager->show('right', 'pagerjs');?>
</div>
<?php endif;?>
</form>
</div>
</div>
<script>
$('#module' + moduleID).addClass('active');
$('#' + caseBrowseType + 'Tab').addClass('btn-active-text');
$('#' + caseBrowseType + 'Tab').addClass('btn-active-text').find('.text').after("<span class='label label-light label-badge'><?php echo $pager->recTotal;?></span>");
<?php if($browseType == 'bysearch'):?>
$shortcut = $('#QUERY<?php echo (int)$param;?>Tab');
if($shortcut.size() > 0)
+7 -8
View File
@@ -8,7 +8,7 @@
$hasGroupPriv = common::hasPriv('testcase', 'groupcase');
$hasZeroPriv = common::hasPriv('story', 'zerocase');
?>
<?php if($this->methodName == 'browse') echo "<a id='bysearchTab' class='btn btn-link'><i class='icon-search icon'></i> {$lang->testcase->bySearch}</a>";?>
<?php if($this->methodName == 'browse') echo "<a id='bysearchTab' class='btn btn-link querybox-toggle'><i class='icon-search icon'></i> {$lang->testcase->bySearch}</a>";?>
</div>
<div class='btn-toolbar pull-right'>
<div class='btn-group' id='createActionMenu'>
@@ -61,8 +61,8 @@
</ul>
</li>
</ul>
<div id='querybox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
</div>
<div id='querybox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
<?php else:?>
<div id='mainMenu' class='clearfix'>
<div id="sidebarHeader">
@@ -73,7 +73,7 @@
if(!empty($moduleID))
{
$removeLink = $browseType == 'bymodule' ? inlink('browse', "productID=$productID&branch=$branch&browseType=$browseType&param=0&orderBy=$orderBy&recTotal=0&recPerPage={$pager->recPerPage}") : 'javascript:removeCookieByKey("caseModule")';
echo html::a($removeLink, "<i class='icon icon-remove'></i>", '', "class='text-muted'");
echo html::a($removeLink, "<i class='icon icon-sm icon-close'></i>", '', "class='text-muted'");
}
?>
</div>
@@ -93,11 +93,11 @@
if($hasBrowsePriv and strpos($menuType, 'QUERY') === 0)
{
$queryID = (int)substr($menuType, 5);
echo html::a($this->createLink('testcase', 'browse', "productid=$productID&branch=$branch&browseType=bySearch&param=$queryID"), $menuItem->text, '', "class='btn btn-link' id='{$menuType}Tab'");
echo html::a($this->createLink('testcase', 'browse', "productid=$productID&branch=$branch&browseType=bySearch&param=$queryID"), "<span class='text'>{$menuItem->text}</span>", '', "class='btn btn-link' id='{$menuType}Tab'");
}
elseif($hasBrowsePriv and ($menuType == 'all' or $menuType == 'needconfirm' or $menuType == 'wait'))
{
echo html::a($this->createLink('testcase', 'browse', "productid=$productID&branch=$branch&browseType=$menuType"), $menuItem->text, '', "class='btn btn-link' id='{$menuType}Tab'");
echo html::a($this->createLink('testcase', 'browse', "productid=$productID&branch=$branch&browseType=$menuType"), "<span class='text'>{$menuItem->text}</span>", '', "class='btn btn-link' id='{$menuType}Tab'");
}
elseif($hasBrowsePriv and $menuType == 'suite')
{
@@ -151,12 +151,12 @@
}
elseif($hasZeroPriv and $menuType == 'zerocase')
{
echo html::a($this->createLink('story', 'zeroCase', "productID=$productID"), $lang->story->zeroCase, '', "class='btn btn-link' id='zerocaseTab'");
echo html::a($this->createLink('story', 'zeroCase', "productID=$productID"), "<span class='text'>{$lang->story->zeroCase}</span>", '', "class='btn btn-link' id='zerocaseTab'");
}
?>
<?php endforeach;?>
<?php
if($this->methodName == 'browse') echo "<a id='bysearchTab' class='btn btn-link'><i class='icon-search icon'></i> {$lang->testcase->bySearch}</a>";
if($this->methodName == 'browse') echo "<a id='bysearchTab' class='btn btn-link querybox-toggle'><i class='icon-search icon'></i> {$lang->testcase->bySearch}</a>";
?>
</div>
<div class='btn-toolbar pull-right'>
@@ -208,7 +208,6 @@
?>
</div>
</div>
<div id='querybox' class='<?php if($browseType =='bysearch') echo 'show';?>'></div>
<?php endif;?>
<?php
+282 -288
View File
@@ -12,301 +12,295 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['testcase']);?> <strong><?php echo $case->id;?></strong></span>
<strong style='color: <?php echo $case->color; ?>'><?php echo $case->title;?></strong>
<?php if($case->deleted):?>
<span class='label label-danger'><?php echo $lang->case->deleted;?></span>
<?php endif; ?>
<?php if($case->version > 1):?>
<small class='dropdown'>
<a href='#' data-toggle='dropdown' class='text-muted'><?php echo '#' . $version;?> <span class='caret'></span></a>
<ul class='dropdown-menu'>
<?php
for($i = $case->version; $i >= 1; $i --)
{
$class = $i == $version ? " class='active'" : '';
echo '<li' . $class .'>' . html::a(inlink('view', "caseID=$case->id&version=$i"), '#' . $i) . '</li>';
}
?>
</ul>
</small>
<?php endif; ?>
</div>
<div class='actions'>
<?php
$browseLink = $app->session->caseList != false ? $app->session->caseList : $this->createLink('testcase', 'browse', "productID=$case->product");
$actionLinks = '';
if(!$case->deleted)
{
ob_start();
<?php $browseLink = $app->session->caseList != false ? $app->session->caseList : $this->createLink('testcase', 'browse', "productID=$case->product");?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<?php echo html::a($browseLink, '<i class="icon icon-back icon-sm"></i> ' . $lang->goback, '', "class='btn btn-link'");?>
<div class="divider"></div>
<div class="page-title">
<span class='label label-id'><?php echo $case->id;?></span>
<span class='text' style='color: <?php echo $case->color; ?>'><?php echo $case->title;?></span>
echo "<div class='btn-group'>";
if(!$isLibCase)
{
common::printIcon('testtask', 'runCase', "runID=$runID&caseID=$case->id&version=$case->currentVersion", $case, 'button', '', '', 'runCase', false, "data-width='95%'");
common::printIcon('testtask', 'results', "runID=$runID&caseID=$case->id&version=$case->version", $case, 'button', '', '', 'results', false, "data-width='95%'");
<?php if($case->deleted):?>
<span class='label label-danger'><?php echo $lang->case->deleted;?></span>
<?php endif; ?>
if($caseFails > 0) common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=$runID", $case, 'button', 'bug', '', 'iframe', '', "data-width='90%'");
}
if($config->testcase->needReview or !empty($config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'button', 'review', '', 'iframe');
echo '</div>';
echo "<div class='btn-group'>";
common::printIcon('testcase', 'edit',"caseID=$case->id", $case);
common::printCommentIcon('testcase', $case);
if(!$isLibCase) common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase&param=$case->id", $case, 'button', 'copy');
if($isLibCase and common::hasPriv('testsuite', 'createCase')) echo html::a($this->createLink('testsuite', 'createCase', "libID=$case->lib&moduleID=$case->module&param=$case->id", $case), "<i class='icon-copy'></i>", '', "class='btn' title='{$lang->testcase->copy}'");
common::printIcon('testcase', 'delete', "caseID=$case->id", $case, 'button', '', 'hiddenwin');
echo '</div>';
echo "<div class='btn-group'>";
common::printRPN($browseLink, $preAndNext, inlink('view', "caseID=%s&version=0&testtask=$from&taskID=$taskID"));
echo '</div>';
$actionLinks = ob_get_contents();
ob_end_clean();
echo $actionLinks;
}
else
{
common::printRPN($browseLink);
}
?>
</div>
</div>
<div class='row-table'>
<div class='col-main'>
<div class='main' style='word-break:break-all'>
<fieldset>
<legend><?php echo $lang->testcase->precondition;?></legend>
<?php echo nl2br($case->precondition);?>
</fieldset>
<table class='table table-condensed table-hover table-striped' id='steps'>
<thead>
<tr>
<th class='w-40px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-p70 text-left'><?php echo $lang->testcase->stepDesc;?></th>
<th class='text-left'><?php echo $lang->testcase->stepExpect;?></th>
</tr>
</thead>
<?php if($case->version > 1):?>
<small class='dropdown'>
<a href='#' data-toggle='dropdown' class='text-muted'><?php echo '#' . $version;?> <span class='caret'></span></a>
<ul class='dropdown-menu'>
<?php
$stepId = $childId = 0;
foreach($case->steps as $stepID => $step)
for($i = $case->version; $i >= 1; $i --)
{
$stepClass = "step-{$step->type}";
if($step->type == 'group' or $step->type == 'step')
{
$stepId++;
$childId = 0;
}
if($step->type == 'step') $stepClass = 'step-group';
echo "<tr class='step {$stepClass}'>";
echo "<th class='step-id'>$stepId</th>";
echo "<td class='text-left'><div class='input-group'>";
if($step->type == 'item') echo "<span class='step-item-id'>{$stepId}.{$childId}</span>";
echo nl2br($step->desc) . "</td>";
echo "<td class='text-left'>" . nl2br($step->expect) . "</div></td>";
echo "</tr>";
$childId ++;
$class = $i == $version ? " class='active'" : '';
echo '<li' . $class .'>' . html::a(inlink('view', "caseID=$case->id&version=$i"), '#' . $i) . '</li>';
}
?>
</table>
<?php echo $this->fetch('file', 'printFiles', array('files' => $case->files, 'fieldset' => 'true'));?>
<?php include '../../common/view/action.html.php';?>
<div class='actions'><?php echo $actionLinks;?></div>
<fieldset id='commentBox' class='hide'>
<legend><?php echo $lang->comment;?></legend>
<form method='post' action='<?php echo $this->createLink('action', 'comment', "objectType=case&objectID=$case->id")?>' target='hiddenwin'>
<div class="form-group"><?php echo html::textarea('comment', '',"rows='5' class='w-p100'");?></div>
<?php echo html::submitButton() . html::backButton();?>
</form>
</fieldset>
</div>
</div>
<div class='col-side'>
<a class='side-handle' data-id='caseSide'><i class='icon-caret-right'></i></a>
<div class='main main-side'>
<fieldset>
<legend><?php echo $lang->testcase->legendBasicInfo;?></legend>
<table class='table table-data table-condensed table-borderless table-fixed'>
<?php if($isLibCase):?>
<tr>
<th class='w-80px'><?php echo $lang->testcase->lib;?></th>
<td><?php if(!common::printLink('testsuite', 'library', "libID=$case->lib", $libName)) echo $libName;?></td>
</tr>
<?php else:?>
<tr>
<th class='w-80px'><?php echo $lang->testcase->product;?></th>
<td><?php if(!common::printLink('testcase', 'browse', "productID=$case->product", $productName)) echo $productName;?></td>
</tr>
<?php if($this->session->currentProductType != 'normal'):?>
<tr>
<th><?php echo $lang->product->branch;?></th>
<td><?php if(!common::printLink('testcase', 'browse', "productID=$case->product&branch=$case->branch", $branchName)) echo $branchName;?></td>
</tr>
<?php endif;?>
<?php endif;?>
<tr>
<th><?php echo $lang->testcase->module;?></th>
<td>
<?php
if(empty($modulePath))
{
echo "/";
}
else
{
foreach($modulePath as $key => $module)
{
if(!common::printLink('testcase', 'browse', "productID=$case->product&branch=$module->branch&browseType=byModule&param=$module->id", $module->name)) echo $module->name;
if(isset($modulePath[$key + 1])) echo $lang->arrow;
}
}
?>
</td>
</tr>
<?php if(!$isLibCase and $this->config->global->flow != 'onlyTest'):?>
<tr class='nofixed'>
<th><?php echo $lang->testcase->story;?></th>
<td>
<?php
if(isset($case->storyTitle)) echo html::a($this->createLink('story', 'view', "storyID=$case->story"), "#$case->story:$case->storyTitle");
if($case->story and $case->storyStatus == 'active' and $case->latestStoryVersion > $case->storyVersion)
{
echo "(<span class='warning'>{$lang->story->changed}</span> ";
echo html::a($this->createLink('testcase', 'confirmStoryChange', "caseID=$case->id"), $lang->confirm, 'hiddenwin');
echo ")";
}
?>
</td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->testcase->type;?></th>
<td><?php echo $lang->testcase->typeList[$case->type];?></td>
</tr>
<tr>
<th><?php echo $lang->testcase->stage;?></th>
<td>
<?php
if($case->stage)
{
$stags = explode(',', $case->stage);
foreach($stags as $stage)
{
if(empty($stage)) continue;
isset($lang->testcase->stageList[$stage]) ? print($lang->testcase->stageList[$stage]) : print($stage);
echo "<br />";
}
}
?>
</td>
</tr>
<tr>
<th><?php echo $lang->testcase->pri;?></th>
<td><span class='<?php echo 'pri' . zget($lang->testcase->priList, $case->pri);?>'><?php echo zget($lang->testcase->priList, $case->pri)?></span></td>
</tr>
<tr>
<th><?php echo $lang->testcase->status;?></th>
<td>
<?php
echo $lang->testcase->statusList[$case->status];
if($case->version > $case->currentVersion and $from == 'testtask')
{
echo " (<span class='warning'>{$lang->testcase->changed}</span> ";
echo html::a($this->createLink('testcase', 'confirmchange', "caseID=$case->id"), $lang->confirm, 'hiddenwin');
echo ")";
}
?>
</td>
</tr>
<?php if(!$isLibCase):?>
<tr>
<th><?php echo $this->app->loadLang('testtask')->testtask->lastRunTime;?></th>
<td><?php if(!helper::isZeroDate($case->lastRunDate)) echo $case->lastRunDate;?></td>
</tr>
<tr>
<th><?php echo $this->app->loadLang('testtask')->testtask->lastRunResult;?></th>
<td><?php if($case->lastRunResult) echo $lang->testcase->resultList[$case->lastRunResult];?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->testcase->keywords;?></th>
<td><?php echo $case->keywords;?></td>
</tr>
<?php if(!$isLibCase):?>
<tr>
<th><?php echo $lang->testcase->linkCase;?></th>
<td>
<?php
if(isset($case->linkCaseTitles))
{
foreach($case->linkCaseTitles as $linkCaseID => $linkCaseTitle)
{
echo html::a($this->createLink('testcase', 'view', "caseID=$linkCaseID"), "#$linkCaseID $linkCaseTitle", '_blank') . '<br />';
}
}
?>
</td>
</tr>
<?php endif;?>
</table>
</fieldset>
<?php if(!$isLibCase):?>
<fieldset>
<legend><?php echo $lang->testcase->legendLinkBugs;?></legend>
<table class='table table-data table-condensed table-borderless'>
<?php if($case->fromBug):?>
<tr>
<th class='w-60px'><?php echo $lang->testcase->fromBug;?></th>
<td><?php echo html::a($this->createLink('bug', 'view', "bugID=$case->fromBug"), $case->fromBugTitle);?></td>
</tr>
<?php endif;?>
<?php if($case->toBugs):?>
<tr>
<th class='w-60px' valign="top"><?php echo $lang->testcase->toBug;?></th>
<td>
<?php
foreach($case->toBugs as $bugID => $bugTitle)
{
echo '<p style="margin-bottom:0;">' . html::a($this->createLink('bug', 'view', "bugID=$bugID"), $bugTitle) . '</p>';
}
?>
</td>
</tr>
<?php endif;?>
</table>
</fieldset>
<?php endif;?>
<fieldset>
<legend><?php echo $lang->testcase->legendOpenAndEdit;?></legend>
<table class='table table-data table-condensed table-borderless'>
<tr>
<th class='w-60px'><?php echo $lang->testcase->openedBy;?></th>
<td><?php echo $users[$case->openedBy] . $lang->at . $case->openedDate;?></td>
</tr>
<?php if($config->testcase->needReview or !empty($config->testcase->forceReview)):?>
<tr>
<th><?php echo $lang->testcase->reviewedBy;?></th>
<td><?php $reviewedBy = explode(',', $case->reviewedBy); foreach($reviewedBy as $account) echo ' ' . $users[trim($account)]; ?></td>
</tr>
<tr>
<th><?php echo $lang->testcase->reviewedDate;?></th>
<td><?php if($case->reviewedBy) echo $case->reviewedDate;?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->testcase->lblLastEdited;?></th>
<td><?php if($case->lastEditedBy) echo $users[$case->lastEditedBy] . $lang->at . $case->lastEditedDate;?></td>
</tr>
</table>
</fieldset>
</ul>
</small>
<?php endif; ?>
</div>
</div>
</div>
<div id="mainContent" class="main-row">
<div class='main-col col-8'>
<div class='cell' style='word-break:break-all'>
<div class='detail'>
<div class='detail-title'><?php echo $lang->testcase->precondition;?></div>
<div class="detail-content article-content"><?php echo nl2br($case->precondition);?></div>
</div>
<div class='detail'>
<div class='detail-title'><?php echo $lang->testcase->steps;?></div>
<table class='table table-condensed table-hover table-striped' id='steps'>
<thead>
<tr>
<th class='w-50px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-p70 text-left'><?php echo $lang->testcase->stepDesc;?></th>
<th class='text-left'><?php echo $lang->testcase->stepExpect;?></th>
</tr>
</thead>
<?php
$stepId = $childId = 0;
foreach($case->steps as $stepID => $step)
{
$stepClass = "step-{$step->type}";
if($step->type == 'group' or $step->type == 'step')
{
$stepId++;
$childId = 0;
}
if($step->type == 'step') $stepClass = 'step-group';
echo "<tr class='step {$stepClass}'>";
echo "<th class='step-id'>$stepId</th>";
echo "<td class='text-left'><div class='input-group'>";
if($step->type == 'item') echo "<span class='step-item-id'>{$stepId}.{$childId}</span>";
echo nl2br($step->desc) . "</td>";
echo "<td class='text-left'>" . nl2br($step->expect) . "</div></td>";
echo "</tr>";
$childId ++;
}
?>
</table>
</div>
<?php echo $this->fetch('file', 'printFiles', array('files' => $case->files, 'fieldset' => 'true'));?>
<?php include '../../common/view/action.html.php';?>
</div>
</div>
<div class='side-col col-4'>
<div class="cell">
<details class="detail" open>
<summary class="detail-title"><?php echo $lang->testcase->legendBasicInfo;?></summary>
<div class="detail-content">
<table class='table table-data'>
<?php if($isLibCase):?>
<tr>
<th class='w-80px'><?php echo $lang->testcase->lib;?></th>
<td><?php if(!common::printLink('testsuite', 'library', "libID=$case->lib", $libName)) echo $libName;?></td>
</tr>
<?php else:?>
<tr>
<th class='w-80px'><?php echo $lang->testcase->product;?></th>
<td><?php if(!common::printLink('testcase', 'browse', "productID=$case->product", $productName)) echo $productName;?></td>
</tr>
<?php if($this->session->currentProductType != 'normal'):?>
<tr>
<th><?php echo $lang->product->branch;?></th>
<td><?php if(!common::printLink('testcase', 'browse', "productID=$case->product&branch=$case->branch", $branchName)) echo $branchName;?></td>
</tr>
<?php endif;?>
<?php endif;?>
<tr>
<th><?php echo $lang->testcase->module;?></th>
<td>
<?php
if(empty($modulePath))
{
echo "/";
}
else
{
foreach($modulePath as $key => $module)
{
if(!common::printLink('testcase', 'browse', "productID=$case->product&branch=$module->branch&browseType=byModule&param=$module->id", $module->name)) echo $module->name;
if(isset($modulePath[$key + 1])) echo $lang->arrow;
}
}
?>
</td>
</tr>
<?php if(!$isLibCase and $this->config->global->flow != 'onlyTest'):?>
<tr class='nofixed'>
<th><?php echo $lang->testcase->story;?></th>
<td>
<?php
if(isset($case->storyTitle)) echo html::a($this->createLink('story', 'view', "storyID=$case->story"), "#$case->story:$case->storyTitle");
if($case->story and $case->storyStatus == 'active' and $case->latestStoryVersion > $case->storyVersion)
{
echo "(<span class='warning'>{$lang->story->changed}</span> ";
echo html::a($this->createLink('testcase', 'confirmStoryChange', "caseID=$case->id"), $lang->confirm, 'hiddenwin');
echo ")";
}
?>
</td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->testcase->type;?></th>
<td><?php echo $lang->testcase->typeList[$case->type];?></td>
</tr>
<tr>
<th><?php echo $lang->testcase->stage;?></th>
<td>
<?php
if($case->stage)
{
$stags = explode(',', $case->stage);
foreach($stags as $stage)
{
if(empty($stage)) continue;
isset($lang->testcase->stageList[$stage]) ? print($lang->testcase->stageList[$stage]) : print($stage);
echo "<br />";
}
}
?>
</td>
</tr>
<tr>
<th><?php echo $lang->testcase->pri;?></th>
<td><span class='<?php echo 'pri' . zget($lang->testcase->priList, $case->pri);?>'><?php echo zget($lang->testcase->priList, $case->pri)?></span></td>
</tr>
<tr>
<th><?php echo $lang->testcase->status;?></th>
<td>
<?php
echo $lang->testcase->statusList[$case->status];
if($case->version > $case->currentVersion and $from == 'testtask')
{
echo " (<span class='warning'>{$lang->testcase->changed}</span> ";
echo html::a($this->createLink('testcase', 'confirmchange', "caseID=$case->id"), $lang->confirm, 'hiddenwin');
echo ")";
}
?>
</td>
</tr>
<?php if(!$isLibCase):?>
<tr>
<th><?php echo $this->app->loadLang('testtask')->testtask->lastRunTime;?></th>
<td><?php if(!helper::isZeroDate($case->lastRunDate)) echo $case->lastRunDate;?></td>
</tr>
<tr>
<th><?php echo $this->app->loadLang('testtask')->testtask->lastRunResult;?></th>
<td><?php if($case->lastRunResult) echo $lang->testcase->resultList[$case->lastRunResult];?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->testcase->keywords;?></th>
<td><?php echo $case->keywords;?></td>
</tr>
<?php if(!$isLibCase):?>
<tr>
<th><?php echo $lang->testcase->linkCase;?></th>
<td>
<?php
if(isset($case->linkCaseTitles))
{
foreach($case->linkCaseTitles as $linkCaseID => $linkCaseTitle)
{
echo html::a($this->createLink('testcase', 'view', "caseID=$linkCaseID"), "#$linkCaseID $linkCaseTitle", '_blank') . '<br />';
}
}
?>
</td>
</tr>
<?php endif;?>
</table>
</div>
</details>
</div>
<?php if(!$isLibCase):?>
<div class="cell">
<details class="detail" open>
<summary class="detail-title"><?php echo $lang->testcase->legendLinkBugs;?></summary>
<div class="detail-content">
<table class='table table-data'>
<?php if($case->fromBug):?>
<tr>
<th class='w-60px'><?php echo $lang->testcase->fromBug;?></th>
<td><?php echo html::a($this->createLink('bug', 'view', "bugID=$case->fromBug"), $case->fromBugTitle);?></td>
</tr>
<?php endif;?>
<?php if($case->toBugs):?>
<tr>
<th class='w-60px' valign="top"><?php echo $lang->testcase->toBug;?></th>
<td>
<?php
foreach($case->toBugs as $bugID => $bugTitle)
{
echo '<p style="margin-bottom:0;">' . html::a($this->createLink('bug', 'view', "bugID=$bugID"), $bugTitle) . '</p>';
}
?>
</td>
</tr>
<?php endif;?>
</table>
</div>
</details>
</div>
<?php endif;?>
<div class="cell">
<details class="detail" open>
<summary class="detail-title"><?php echo $lang->testcase->legendOpenAndEdit;?></summary>
<div class="detail-content">
<table class='table table-data'>
<tr>
<th class='w-60px'><?php echo $lang->testcase->openedBy;?></th>
<td><?php echo $users[$case->openedBy] . $lang->at . $case->openedDate;?></td>
</tr>
<?php if($config->testcase->needReview or !empty($config->testcase->forceReview)):?>
<tr>
<th><?php echo $lang->testcase->reviewedBy;?></th>
<td><?php $reviewedBy = explode(',', $case->reviewedBy); foreach($reviewedBy as $account) echo ' ' . $users[trim($account)]; ?></td>
</tr>
<tr>
<th><?php echo $lang->testcase->reviewedDate;?></th>
<td><?php if($case->reviewedBy) echo $case->reviewedDate;?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->testcase->lblLastEdited;?></th>
<td><?php if($case->lastEditedBy) echo $users[$case->lastEditedBy] . $lang->at . $case->lastEditedDate;?></td>
</tr>
</table>
</div>
</details>
</div>
</div>
</div>
<div id="mainActions">
<?php common::printPreAndNext($preAndNext);?>
<div class="btn-toolbar">
<?php common::printBack($browseLink);?>
<?php if(!$case->deleted):?>
<div class='divider'></div>
<?php
if(!$isLibCase)
{
common::printIcon('testtask', 'runCase', "runID=$runID&caseID=$case->id&version=$case->currentVersion", $case, 'button', '', '', 'runCase', false, "data-width='95%'");
common::printIcon('testtask', 'results', "runID=$runID&caseID=$case->id&version=$case->version", $case, 'button', '', '', 'results', false, "data-width='95%'");
if($caseFails > 0) common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=$runID", $case, 'button', 'bug', '', 'iframe', '', "data-width='90%'");
}
if($config->testcase->needReview or !empty($config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'button', 'review', '', 'iframe');
?>
<div class='divider'></div>
<?php
common::printIcon('testcase', 'edit',"caseID=$case->id", $case);
if(!$isLibCase) common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase&param=$case->id", $case, 'button', 'copy');
if($isLibCase and common::hasPriv('testsuite', 'createCase')) echo html::a($this->createLink('testsuite', 'createCase', "libID=$case->lib&moduleID=$case->module&param=$case->id", $case), "<i class='icon-copy'></i>", '', "class='btn' title='{$lang->testcase->copy}'");
common::printIcon('testcase', 'delete', "caseID=$case->id", $case, 'button', '', 'hiddenwin');
?>
</div>
<?php endif;?>
</div>
<?php include '../../common/view/footer.html.php';?>
-1
View File
@@ -47,7 +47,6 @@ $(document).ready(function()
{
// First unbind ajaxForm for form.
$("form[data-type='ajax']").unbind('submit');
setForm();
// Bind ajaxForm for form again.
$.ajaxForm("form[data-type='ajax']", function(response)
+93 -85
View File
@@ -11,21 +11,20 @@
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<div class="outer">
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['usecase']);?> <strong><?php echo $case->id;?></strong></span>
<strong><?php echo $case->title;?></strong>
<small class='text-muted'><?php echo $lang->testtask->results . ' ' . html::icon($lang->icons['result']);?></small>
</div>
<div id='mainContent' class='main-content'>
<div class='main-header'>
<h2>
<span class='label label-id'><?php echo $case->id;?></span>
<?php echo $case->title;?>
</h2>
</div>
<div class='main pdb-20' style='word-break:break-all'>
<fieldset>
<legend><?php echo $lang->testcase->precondition;?></legend>
<?php echo $case->precondition;?>
</fieldset>
<div id='casesResults'>
<div class='main' style='word-break:break-all'>
<div class='detail'>
<div class='detail-title'><?php echo $lang->testcase->precondition;?></div>
<div class='detail-content'><?php echo $case->precondition;?></div>
</div>
<div class='detail' id='casesResults'>
<table class='table table-condensed table-hover' style='border: 1px solid #ddd; word-break:break-all'>
<?php $count = count($results);?>
<caption class='text-left'>
@@ -51,69 +50,74 @@
<tr class='result-detail hide' id='tr-detail_<?php echo $trCount++; ?>'>
<td colspan='7' class='pd-0'>
<form action='<?php echo $this->createLink('bug', 'create', "product=$case->product&branch=$case->branch&extras=caseID=$case->id,version=$case->version,resultID=$result->id,runID=$runID" . $params)?>' target='_blank' method='post'>
<table class='table table-condensed borderless mg-0 resultSteps'>
<thead>
<tr>
<th class='w-40px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-p30 text-left'><?php echo $lang->testcase->stepDesc;?></th>
<th class='w-p25 text-left'><?php echo $lang->testcase->stepExpect;?></th>
<th class='w-p5 text-left'><?php echo $lang->testcase->stepVersion;?></th>
<th class='text-center'><?php echo $lang->testcase->result;?></th>
<th class='w-p20 text-left'><?php echo $lang->testcase->real;?></th>
<th class='w-80px'></th>
</tr>
</thead>
<?php
$stepId = $childId = 0;
foreach($result->stepResults as $key => $stepResult):
?>
<?php
if(empty($stepResult['type'])) $stepResult['type'] = 'step';
if(empty($stepResult['parent'])) $stepResult['parent'] = 0;
if($stepResult['type'] == 'group' or $stepResult['type'] == 'step')
{
$stepId++;
$childId = 0;
}
$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'>
<table class='table table-condensed resultSteps'>
<thead>
<tr>
<th class='w-50px'><?php echo $lang->testcase->stepID;?></th>
<th class='text-left'><?php echo $lang->testcase->stepDesc;?></th>
<th class='w-p25 text-left'><?php echo $lang->testcase->stepExpect;?></th>
<th class='w-p5 text-left'><?php echo $lang->testcase->stepVersion;?></th>
<th class='w-80px text-center'><?php echo $lang->testcase->result;?></th>
<th class='w-p20 text-left'><?php echo $lang->testcase->real;?></th>
<th class='w-80px'></th>
</tr>
</thead>
<tbody>
<?php
$stepId = $childId = 0;
foreach($result->stepResults as $key => $stepResult):
?>
<?php
if(empty($stepResult['type'])) $stepResult['type'] = 'step';
if(empty($stepResult['parent'])) $stepResult['parent'] = 0;
if($stepResult['type'] == 'group' or $stepResult['type'] == 'step')
{
$stepId++;
$childId = 0;
}
$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 = $stepResult['type'] != 'group' ? 'stepIDList[]' : '';?>
<div class='checkbox-primary'>
<input type='checkbox' id='<?php echo $inputName;?>' name='<?php echo $inputName;?>' value='<?php echo $key;?>'/>
<label><?php echo $stepId;?></label>
</div>
<?php else:?>
<?php echo $stepId;?>
<?php endif;?>
</td>
<td class='text-left' <?php if($stepResult['type'] == 'group') echo "colspan='6'"?>>
<div class='input-group'>
<?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>
<?php if($stepResult['type'] != 'group'):?>
<td class='text-left'><?php if(isset($stepResult['expect'])) echo nl2br($stepResult['expect']);?></td>
<td><?php if(isset($result->version)) echo nl2br($result->version);?></td>
<?php if(!empty($stepResult['result'])):?>
<td class='<?php echo $stepResult['result'];?> text-center'><?php echo $lang->testcase->resultList[$stepResult['result']];?></td>
<td><?php echo $stepResult['real'];?></td>
<td class='text-center'><?php if(!empty($stepResult['files'])) echo html::a("#stepResult{$modalID}", $lang->files . $fileCount, '', "data-toggle='modal' data-type='iframe'")?></td>
<?php else:?>
<td></td>
<td></td>
<?php endif; endif; $childId++;?>
</tr>
<?php endforeach;?>
<?php if($result->caseResult == 'fail'):?>
<?php $inputName = $stepResult['type'] != 'group' ? 'stepIDList[]' : '';?>
<input type='checkbox' name='<?php echo $inputName;?>' value='<?php echo $key;?>'/>
<tr>
<td></td><td></td><td></td><td></td><td></td><td></td>
<td><?php echo html::submitButton($lang->testcase->createBug);?></td>
</tr>
<?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') echo "<span class='step-item-id'>{$stepId}.{$childId}</span>";?>
<?php if(isset($stepResult['desc'])) echo nl2br($stepResult['desc']);?>
</div>
</td>
<?php if($stepResult['type'] != 'group'):?>
<td class='text-left'><?php if(isset($stepResult['expect'])) echo nl2br($stepResult['expect']);?></td>
<td><?php if(isset($result->version)) echo nl2br($result->version);?></td>
<?php if(!empty($stepResult['result'])):?>
<td class='<?php echo $stepResult['result'];?> text-center'><?php echo $lang->testcase->resultList[$stepResult['result']];?></td>
<td><?php echo $stepResult['real'];?></td>
<td class='text-center'><?php if(!empty($stepResult['files'])) echo html::a("#stepResult{$modalID}", $lang->files . $fileCount, '', "data-toggle='modal' data-type='iframe'")?></td>
<?php else:?>
<td></td>
<td></td>
<?php endif; endif; $childId++;?>
</tr>
<?php endforeach;?>
<?php if($result->caseResult == 'fail'):?>
<tr><td></td><td></td><td></td><td></td><td></td><td></td>
<td>
<?php echo html::submitButton($lang->testcase->createBug);?>
</td>
</tr>
<?php endif;?>
</table>
</tbody>
</table>
</form>
</td>
</tr>
@@ -131,22 +135,26 @@
</div>
</div>
</div>
<?php foreach($result->stepResults as $stepID => $stepResult):?>
<div class="modal fade" id="stepResult<?php echo $result->id . '-' .$stepID;?>">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title"><?php echo $lang->files;?></h4>
</div>
<div class="modal-body"><?php echo $this->fetch('file', 'printFiles', array('files' => $stepResult['files'], 'fieldset' => 'false'));?></div>
<?php foreach($result->stepResults as $stepID => $stepResult):?>
<div class="modal fade" id="stepResult<?php echo $result->id . '-' .$stepID;?>">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title"><?php echo $lang->files;?></h4>
</div>
<div class="modal-body"><?php echo $this->fetch('file', 'printFiles', array('files' => $stepResult['files'], 'fieldset' => 'false'));?></div>
</div>
</div>
<?php endforeach;?>
</div>
<?php endforeach;?>
<?php endforeach;?>
<div id='resultTip' class='hide'><?php if($count > 0) echo $failCount > 0 ? "<span>" . sprintf($lang->testtask->showFail, $failCount) . "</span>":"<span class='text-success'>{$lang->testtask->passAll}</span>";?></div>
<style>.table-hover tr.result-detail:hover td {background: #fff} #casesResults > table > caption {border: 1px solid #ddd; margin-bottom: -1px}</style>
<style>
.table-hover tr.result-detail:hover td {background: #fff}
#casesResults > table > caption {border: 1px solid #ddd; margin-bottom: -1px}
#casesResults .table{margin-bottom:0px !important;}
</style>
</div>
</div>
</div>
+10 -12
View File
@@ -13,22 +13,21 @@
<?php include '../../common/view/header.lite.html.php';?>
<?php include '../../common/view/form.html.php';?>
<?php js::set('caseResultSave', $lang->save);?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['usecase']);?> <strong><?php echo $run->case->id;?></strong></span>
<strong><?php echo $run->case->title;?></strong>
<small class='text-muted'> <?php echo $lang->testtask->runCase;?> <?php echo html::icon($lang->icons['run']);?></small>
<div id='mainContent' class='main-content'>
<div class='main-header'>
<h2>
<span class='label label-id'><?php echo $run->case->id;?></span>
<?php echo $run->case->title;?>
</h2>
</div>
</div>
<div class='main'>
<form class='form-condensed' method='post' enctype='multipart/form-data' id='dataform' data-type='ajax'>
<table class='table table-bordered table-form' style='word-break:break-all' id='steps'>
<form method='post' enctype='multipart/form-data' id='dataform' data-type='ajax'>
<table class='table table-bordered' style='word-break:break-all' id='steps'>
<thead>
<tr>
<td colspan='5' style='word-break: break-all;'><strong><?php echo $lang->testcase->precondition;?></strong> <?php echo $run->case->precondition;?></td>
</tr>
<tr>
<th class='w-40px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-50px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-p30'><?php echo $lang->testcase->stepDesc;?></th>
<th class='w-p30'><?php echo $lang->testcase->stepExpect;?></th>
<th class='w-100px'><?php echo $lang->testcase->result;?></th>
@@ -117,8 +116,7 @@
</div>
<?php endforeach;?>
</form>
</div>
<div class='main' id='resultsContainer'>
<div class='main' id='resultsContainer'></div>
</div>
<script>
$(function()
-1
View File
@@ -1,7 +1,6 @@
// Prevent login page show in a iframe modal
if(window.self !== window.top) window.top.location.href = window.location.href;
function setForm(){}
$(document).ready(function()
{
var $login = $('#login');