This commit is contained in:
daitingting
2017-05-12 14:46:15 +08:00
24 changed files with 168 additions and 155 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ $(function()
$('.restore').click(function()
{
url = $(this).attr('href') + '&confirm=yes';
url = $(this).attr('href');
bootbox.confirm(confirmRestore, function(result)
{
if(result)
+1 -1
View File
@@ -49,7 +49,7 @@
<?php if($i == 0):?>
<td <?php if($rowspan > 1) echo "rowspan='$rowspan'"?>>
<?php
if(common::hasPriv('backup', 'restore')) echo html::a(inlink('restore', "file=$backupFile->name"), $lang->backup->restore, 'hiddenwin', "class='restore'");
if(common::hasPriv('backup', 'restore')) echo html::a(inlink('restore', "file={$backupFile->name}&confirm=yes"), $lang->backup->restore, 'hiddenwin', "class='restore'");
if(common::hasPriv('backup', 'delete')) echo html::a(inlink('delete', "file=$backupFile->name"), $lang->delete, 'hiddenwin');
?>
</td>
+18 -12
View File
@@ -423,7 +423,7 @@ class block extends control
$this->session->set('todoList', $uri);
$this->session->set('bugList', $uri);
$this->session->set('taskList', $uri);
$this->view->todos = $this->loadModel('todo')->getList('all', $this->app->user->account, 'wait, doing', $this->viewType == 'json' ? 0 : $this->params->num);
$this->view->todos = $this->loadModel('todo')->getList('all', $this->app->user->account, 'wait, doing', $this->viewType == 'json' ? 0 : (int)$this->params->num);
}
/**
@@ -436,7 +436,8 @@ class block extends control
{
$this->session->set('taskList', $this->server->http_referer);
$this->session->set('storyList', $this->server->http_referer);
$this->view->tasks = $this->loadModel('task')->getUserTasks($this->app->user->account, $this->params->type, $this->viewType == 'json' ? 0 : $this->params->num, null, $this->params->orderBy);
if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die();
$this->view->tasks = $this->loadModel('task')->getUserTasks($this->app->user->account, $this->params->type, $this->viewType == 'json' ? 0 : (int)$this->params->num, null, $this->params->orderBy);
}
/**
@@ -448,7 +449,8 @@ class block extends control
public function printBugBlock()
{
$this->session->set('bugList', $this->server->http_referer);
$this->view->bugs = $this->loadModel('bug')->getUserBugs($this->app->user->account, $this->params->type, $this->params->orderBy, $this->viewType == 'json' ? 0 : $this->params->num);
if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die();
$this->view->bugs = $this->loadModel('bug')->getUserBugs($this->app->user->account, $this->params->type, $this->params->orderBy, $this->viewType == 'json' ? 0 : (int)$this->params->num);
}
/**
@@ -475,7 +477,7 @@ class block extends control
->andWhere('t3.deleted')->eq(0)
->andWhere('t2.deleted')->eq(0)
->orderBy($this->params->orderBy)
->beginIF($this->viewType != 'json')->limit($this->params->num)->fi()
->beginIF($this->viewType != 'json')->limit((int)$this->params->num)->fi()
->fetchAll();
}
elseif($this->params->type == 'openedbyme')
@@ -483,7 +485,7 @@ class block extends control
$cases = $this->dao->findByOpenedBy($this->app->user->account)->from(TABLE_CASE)
->andWhere('deleted')->eq(0)
->orderBy($this->params->orderBy)
->beginIF($this->viewType != 'json')->limit($this->params->num)->fi()
->beginIF($this->viewType != 'json')->limit((int)$this->params->num)->fi()
->fetchAll();
}
$this->view->cases = $cases;
@@ -498,6 +500,7 @@ class block extends control
public function printTesttaskBlock()
{
$this->session->set('testtaskList', $this->server->http_referer);
if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die();
$this->app->loadLang('testtask');
$products = $this->loadModel('product')->getPairs();
$this->view->testtasks = $this->dao->select('t1.*,t2.name as productName,t3.name as buildName,t4.name as projectName')->from(TABLE_TESTTASK)->alias('t1')
@@ -510,7 +513,7 @@ class block extends control
->andWhere('t1.product = t5.product')
->beginIF($this->params->type != 'all')->andWhere('t1.status')->eq($this->params->type)->fi()
->orderBy('t1.id desc')
->beginIF($this->viewType != 'json')->limit($this->params->num)->fi()
->beginIF($this->viewType != 'json')->limit((int)$this->params->num)->fi()
->fetchAll();
}
@@ -523,8 +526,9 @@ class block extends control
public function printStoryBlock()
{
$this->session->set('storyList', $this->server->http_referer);
if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die();
$this->app->loadClass('pager', $static = true);
$num = isset($this->params->num) ? $this->params->num : 0;
$num = isset($this->params->num) ? (int)$this->params->num : 0;
$pager = pager::init(0, $num , 1);
$type = isset($this->params->type) ? $this->params->type : 'assignedTo';
$orderBy = isset($this->params->type) ? $this->params->orderBy : 'id_asc';
@@ -547,7 +551,7 @@ class block extends control
->where('t1.deleted')->eq('0')
->andWhere('t1.product')->in(array_keys($products))
->orderBy('t1.begin desc')
->beginIF($this->viewType != 'json')->limit($this->params->num)->fi()
->beginIF($this->viewType != 'json')->limit((int)$this->params->num)->fi()
->fetchAll();
}
@@ -568,7 +572,7 @@ class block extends control
->where('t1.deleted')->eq('0')
->andWhere('t1.product')->in(array_keys($products))
->orderBy('t1.id desc')
->beginIF($this->viewType != 'json')->limit($this->params->num)->fi()
->beginIF($this->viewType != 'json')->limit((int)$this->params->num)->fi()
->fetchAll();
}
@@ -588,7 +592,7 @@ class block extends control
->where('t1.deleted')->eq('0')
->andWhere('t1.project')->in(array_keys($projects))
->orderBy('t1.id desc')
->beginIF($this->viewType != 'json')->limit($this->params->num)->fi()
->beginIF($this->viewType != 'json')->limit((int)$this->params->num)->fi()
->fetchAll();
}
@@ -601,7 +605,8 @@ class block extends control
public function printProductBlock()
{
$this->app->loadClass('pager', $static = true);
$num = isset($this->params->num) ? $this->params->num : 0;
if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die();
$num = isset($this->params->num) ? (int)$this->params->num : 0;
$type = isset($this->params->type) ? $this->params->type : '';
$pager = pager::init(0, $num , 1);
$this->view->productStats = $this->loadModel('product')->getStats('order_desc', $this->viewType != 'json' ? $pager : '', $type);
@@ -616,7 +621,8 @@ class block extends control
public function printProjectBlock()
{
$this->app->loadClass('pager', $static = true);
$num = isset($this->params->num) ? $this->params->num : 0;
if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die();
$num = isset($this->params->num) ? (int)$this->params->num : 0;
$type = isset($this->params->type) ? $this->params->type : 'all';
$pager = pager::init(0, $num, 1);
$this->view->projectStats = $this->loadModel('project')->getProjectStats($type, $productID = 0, $branch = 0, $itemCounts = 30, $orderBy = 'order_desc', $this->viewType != 'json' ? $pager : '');
+2 -7
View File
@@ -601,7 +601,7 @@ class testcase extends control
$this->view->moduleOptionMenu = $moduleOptionMenu;
$this->view->stories = $this->story->getProductStoryPairs($productID, $case->branch);
}
if(!$this->config->testcase->needReview) unset($this->lang->testcase->statusList['wait']);
if(!$this->testcase->forceReview()) unset($this->lang->testcase->statusList['wait']);
$position[] = $this->lang->testcase->common;
$position[] = $this->lang->testcase->edit;
@@ -709,7 +709,7 @@ class testcase extends control
}
}
if(!$this->config->testcase->needReview) unset($this->lang->testcase->statusList['wait']);
if(!$this->testcase->forceReview()) unset($this->lang->testcase->statusList['wait']);
/* Judge whether the editedTasks is too large and set session. */
$countInputVars = count($cases) * (count(explode(',', $this->config->testcase->custom->batchEditFields)) + 3);
@@ -1184,7 +1184,6 @@ class testcase extends control
{
if($_POST)
{
if(!$this->config->testcase->needReview) unset($this->lang->testcase->statusList['wait']);
$product = $this->loadModel('product')->getById($productID);
if($product->type != 'normal') $fields['branch'] = $this->lang->product->branchName[$product->type];
@@ -1195,14 +1194,12 @@ class testcase extends control
$fields['keywords'] = $this->lang->testcase->keywords;
$fields['type'] = $this->lang->testcase->type;
$fields['pri'] = $this->lang->testcase->pri;
$fields['status'] = $this->lang->testcase->status;
$fields['stage'] = $this->lang->testcase->stage;
$fields['precondition'] = $this->lang->testcase->precondition;
$fields[''] = '';
$fields['typeValue'] = $this->lang->testcase->lblTypeValue;
$fields['stageValue'] = $this->lang->testcase->lblStageValue;
$fields['statusValue'] = $this->lang->testcase->lblStatusValue;
if($product->type != 'normal') $fields['branchValue'] = $this->lang->product->branchName[$product->type];
$branches = $this->loadModel('branch')->getPairs($productID);
@@ -1221,7 +1218,6 @@ class testcase extends control
{
$row->typeValue = join("\n", $this->lang->testcase->typeList);
$row->stageValue = join("\n", $this->lang->testcase->stageList);
$row->statusValue = join("\n", $this->lang->testcase->statusList);
if($product->type != 'normal') $row->branchValue = join("\n", $branches);
}
$rows[] = $row;
@@ -1499,7 +1495,6 @@ class testcase extends control
echo js::alert($this->lang->error->noData);
die(js::locate($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch")));
}
if(!$this->config->testcase->needReview) unset($this->lang->testcase->statusList['wait']);
/* Judge whether the editedTasks is too large and set session. */
$countInputVars = count($caseData) * 12 + $stepVars;
+9 -4
View File
@@ -980,7 +980,6 @@ class testcaseModel extends model
$caseData->title = $data->title[$key];
$caseData->pri = (int)$data->pri[$key];
$caseData->type = $data->type[$key];
$caseData->status = $data->status[$key];
$caseData->stage = join(',', $data->stage[$key]);
$caseData->keywords = $data->keywords[$key];
$caseData->frequency = 1;
@@ -1002,9 +1001,15 @@ class testcaseModel extends model
$forceReview = $this->forceReview();
foreach($cases as $key => $caseData)
{
$caseID = 0;
if(!empty($_POST['id'][$key]) and empty($_POST['insert']))
{
$caseID = $data->id[$key];
$caseID = $data->id[$key];
if(!isset($oldCases[$caseID])) $caseID = 0;
}
if($caseID)
{
$stepChanged = false;
$steps = array();
$oldStep = isset($oldSteps[$caseID]) ? $oldSteps[$caseID] : array();
@@ -1090,7 +1095,7 @@ class testcaseModel extends model
$caseData->openedDate = $now;
$caseData->branch = isset($data->branch[$key]) ? $data->branch[$key] : $branch;
if($caseData->story) $caseData->storyVersion = zget($storyVersionPairs, $caseData->story, 1);
if($forceReview) $caseData->status = 'wait';
$caseData->status = $forceReview ? 'wait' : 'normal';
$this->dao->insert(TABLE_CASE)->data($caseData)->autoCheck()->exec();
if(!dao::isError())
@@ -1309,7 +1314,7 @@ class testcaseModel extends model
case 'actions':
common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", '', 'list', 'play', '', 'runCase iframe', false, "data-width='95%'");
common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", '', 'list', '', '', 'results iframe', '', "data-width='90%'");
if($config->testcase->needReview) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'review', '', 'iframe');
if($config->testcase->needReview or !empty($config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'review', '', 'iframe');
common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list');
common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase&param=$case->id", $case, 'list', 'copy');
+2 -2
View File
@@ -67,7 +67,7 @@ js::set('batchDelete', $lang->testcase->confirmBatchDelete);
$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)
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'");
@@ -80,7 +80,7 @@ js::set('batchDelete', $lang->testcase->confirmBatchDelete);
}
echo '</ul></li>';
}
elseif($config->testcase->needReview)
elseif($config->testcase->needReview or !empty($config->testcase->forceReview))
{
echo '<li>' . html::a('javascript:;', $lang->testcase->review, '', $class) . '</li>';
}
+2 -2
View File
@@ -30,7 +30,7 @@
<th class='w-30px' title='<?php echo $lang->testcase->bugs?>'> <?php echo $lang->testcase->bugsAB;?></th>
<th class='w-30px' title='<?php echo $lang->testcase->results?>'> <?php echo $lang->testcase->resultsAB;?></th>
<th class='w-30px' title='<?php echo $lang->testcase->stepNumber?>'> <?php echo $lang->testcase->stepNumberAB;?></th>
<th class='<?php echo $config->testcase->needReview ? 'w-170px' : 'w-150px'?> {sorter:false}'><?php echo $lang->actions;?></th>
<th class='<?php echo ($config->testcase->needReview or !empty($config->testcase->forceReview)) ? 'w-170px' : 'w-150px'?> {sorter:false}'><?php echo $lang->actions;?></th>
<?php endif;?>
</tr>
</thead>
@@ -79,7 +79,7 @@
<?php
common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", '', 'list', 'play', '', 'runCase iframe', false, "data-width='95%'");
common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", '', 'list', 'list-alt', '', 'results iframe', false, "data-width='95%'");
if($config->testcase->needReview) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'review', '', 'iframe');
if($config->testcase->needReview or !empty($config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'review', '', 'iframe');
common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list');
common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase&param=$case->id", $case, 'list', 'copy');
+1 -1
View File
@@ -89,7 +89,7 @@
<?php
if(isset($menuItem->hidden)) continue;
$menuType = $menuItem->name;
if(!$config->testcase->needReview and $menuType == 'wait') continue;
if(!$config->testcase->needReview and empty($config->testcase->forceReview) and $menuType == 'wait') continue;
if($this->config->global->flow == 'onlyTest' and (strpos(',needconfirm,group,zerocase,', ',' . $menuType . ',') !== false)) continue;
if($hasBrowsePriv and strpos($menuType, 'QUERY') === 0)
{
+2 -2
View File
@@ -1,9 +1,9 @@
<?php include '../../common/view/header.lite.html.php';?>
<div class='container mw-600px'>
<form class='form-condensed' method='post' enctype='multipart/form-data' target='hiddenwin'>
<form class='form-condensed' method='post' enctype='multipart/form-data' target='hiddenwin' style="padding:30px">
<table class='table table-form'>
<tr>
<td align='center' style="padding:30px">
<td align='center'>
<input type='file' name='file' class='form-control'/>
</td>
<td>
+90 -92
View File
@@ -6,99 +6,97 @@
<div class='alert alert-info'><?php echo $suhosinInfo?></div>
<?php else:?>
<form target='hiddenwin' method='post' class='form-condensed'>
<table class='table table-fixed active-disabled table-custom'>
<thead>
<tr>
<th class='w-70px'><?php echo $lang->testcase->id?></th>
<th><?php echo $lang->testcase->title?></th>
<?php if($branches):?>
<th class='w-100px'><?php echo $lang->testcase->branch?></th>
<?php endif;?>
<th class='w-100px'><?php echo $lang->testcase->module?></th>
<th class='w-120px'><?php echo $lang->testcase->story?></th>
<th class='w-70px'><?php echo $lang->testcase->pri?></th>
<th class='w-100px'><?php echo $lang->testcase->type?></th>
<th class='w-100px'><?php echo $lang->testcase->status?></th>
<th><?php echo $lang->testcase->stage?></th>
<th class='w-80px'><?php echo $lang->testcase->keywords?></th>
<th><?php echo $lang->testcase->precondition?></th>
<th class='w-300px'>
<table class='w-p100 table-borderless'>
<tr>
<th><?php echo $lang->testcase->stepDesc?></th>
<th><?php echo $lang->testcase->stepExpect?></th>
</tr>
</table>
</th>
</tr>
</thead>
<tbody>
<?php $insert = true;?>
<?php foreach($caseData as $key => $case):?>
<?php if(empty($case->title)) continue;?>
<tr valign='top' align='center'>
<td>
<?php
if(!empty($case->id))
{
echo $case->id . html::hidden("id[$key]", $case->id);
$insert = false;
}
else
{
echo $key . " <sub class='gray' style='vertical-align:sub;'>{$lang->testcase->new}</sub>";
}
echo html::hidden("product[$key]", $productID);
?>
</td>
<td><?php echo html::input("title[$key]", $case->title, "class='form-control' style='margin-top:2px' autocomplete='off'")?></td>
<?php if($branches):?>
<td class='text-left' style='overflow:visible'><?php echo html::select("branch[$key]", $branches, (isset($case->branch) and $case->branch !== '') ? $case->branch : (!empty($case->id) ? $cases[$case->id]->branch : $branch), "class='form-control chosen'")?></td>
<?php endif;?>
<td class='text-left' style='overflow:visible'><?php echo html::select("module[$key]", $modules, isset($case->module) ? $case->module : (!empty($case->id) ? $cases[$case->id]->module : ''), "class='form-control chosen'")?></td>
<td class='text-left' style='overflow:visible'><?php echo html::select("story[$key]", $stories, isset($case->story) ? $case->story : (!empty($case->id) ? $cases[$case->id]->story : ''), "class='form-control chosen'")?></td>
<td><?php echo html::select("pri[$key]", $lang->testcase->priList, isset($case->pri) ? $case->pri : (!empty($case->id) ? $cases[$case->id]->pri : ''), "class='form-control'")?></td>
<td><?php echo html::select("type[$key]", $lang->testcase->typeList, isset($case->type) ? $case->type : (!empty($case->id) ? $cases[$case->id]->type : ''), "class='form-control'")?></td>
<td><?php echo html::select("status[$key]", $lang->testcase->statusList, isset($case->status) ? $case->status : (!empty($case->id) ? $cases[$case->id]->status : 'normal'), "class='form-control'")?></td>
<td class='text-left' style='overflow:visible'><?php echo html::select("stage[$key][]", $lang->testcase->stageList, !empty($case->stage) ? $case->stage : (!empty($case->id) ? $cases[$case->id]->stage : ''), "multiple='multiple' class='form-control chosen'")?></td>
<td><?php echo html::input("keywords[$key]", isset($case->keywords) ? $case->keywords : "", "class='form-control' autocomplete='off'")?></td>
<td><?php echo html::textarea("precondition[$key]", isset($case->precondition) ? htmlspecialchars($case->precondition) : "", "class='form-control'")?></td>
<td>
<?php if(isset($stepData[$key]['desc'])):?>
<table class='w-p100 bd-0'>
<?php foreach($stepData[$key]['desc'] as $id => $desc):?>
<?php if(empty($desc['content'])) continue;?>
<tr class='step'>
<td><?php echo $id . html::hidden("stepType[$key][$id]", $desc['type'])?></td>
<td><?php echo html::textarea("desc[$key][$id]", htmlspecialchars($desc['content']), "class='form-control'")?></td>
<td><?php if($desc['type'] != 'group') echo html::textarea("expect[$key][$id]", isset($stepData[$key]['expect'][$id]['content']) ? htmlspecialchars($stepData[$key]['expect'][$id]['content']) : '', "class='form-control'")?></td>
</tr>
<table class='table table-fixed active-disabled table-custom'>
<thead>
<tr>
<th class='w-70px'><?php echo $lang->testcase->id?></th>
<th><?php echo $lang->testcase->title?></th>
<?php if($branches):?>
<th class='w-100px'><?php echo $lang->testcase->branch?></th>
<?php endif;?>
<th class='w-100px'><?php echo $lang->testcase->module?></th>
<th class='w-120px'><?php echo $lang->testcase->story?></th>
<th class='w-70px'><?php echo $lang->testcase->pri?></th>
<th class='w-100px'><?php echo $lang->testcase->type?></th>
<th><?php echo $lang->testcase->stage?></th>
<th class='w-80px'><?php echo $lang->testcase->keywords?></th>
<th><?php echo $lang->testcase->precondition?></th>
<th class='w-300px'>
<table class='w-p100 table-borderless'>
<tr>
<th><?php echo $lang->testcase->stepDesc?></th>
<th><?php echo $lang->testcase->stepExpect?></th>
</tr>
</table>
</th>
</tr>
</thead>
<tbody>
<?php $insert = true;?>
<?php foreach($caseData as $key => $case):?>
<?php if(empty($case->title)) continue;?>
<tr valign='top' align='center'>
<td>
<?php
if(!empty($case->id))
{
echo $case->id . html::hidden("id[$key]", $case->id);
$insert = false;
}
else
{
echo $key . " <sub class='gray' style='vertical-align:sub;'>{$lang->testcase->new}</sub>";
}
echo html::hidden("product[$key]", $productID);
?>
</td>
<td><?php echo html::input("title[$key]", htmlspecialchars($case->title, ENT_QUOTES), "class='form-control'")?></td>
<?php if($branches):?>
<td class='text-left' style='overflow:visible'><?php echo html::select("branch[$key]", $branches, (isset($case->branch) and $case->branch !== '') ? $case->branch : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->branch : $branch), "class='form-control chosen'")?></td>
<?php endif;?>
<td class='text-left' style='overflow:visible'><?php echo html::select("module[$key]", $modules, isset($case->module) ? $case->module : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->module : ''), "class='form-control chosen'")?></td>
<td class='text-left' style='overflow:visible'><?php echo html::select("story[$key]", $stories, isset($case->story) ? $case->story : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->story : ''), "class='form-control chosen'")?></td>
<td><?php echo html::select("pri[$key]", $lang->testcase->priList, isset($case->pri) ? $case->pri : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->pri : ''), "class='form-control'")?></td>
<td><?php echo html::select("type[$key]", $lang->testcase->typeList, $case->type, "class='form-control'")?></td>
<td class='text-left' style='overflow:visible'><?php echo html::select("stage[$key][]", $lang->testcase->stageList, !empty($case->stage) ? $case->stage : ((!empty($case->id) and isset($cases[$case->id])) ? $cases[$case->id]->stage : ''), "multiple='multiple' class='form-control chosen'")?></td>
<td><?php echo html::input("keywords[$key]", isset($case->keywords) ? $case->keywords : "", "class='form-control' autocomplete='off'")?></td>
<td><?php echo html::textarea("precondition[$key]", isset($case->precondition) ? htmlspecialchars($case->precondition) : "", "class='form-control'")?></td>
<td>
<?php if(isset($stepData[$key]['desc'])):?>
<table class='w-p100 bd-0'>
<?php foreach($stepData[$key]['desc'] as $id => $desc):?>
<?php if(empty($desc['content'])) continue;?>
<tr class='step'>
<td><?php echo $id . html::hidden("stepType[$key][$id]", $desc['type'])?></td>
<td><?php echo html::textarea("desc[$key][$id]", htmlspecialchars($desc['content']), "class='form-control'")?></td>
<td><?php if($desc['type'] != 'group') echo html::textarea("expect[$key][$id]", isset($stepData[$key]['expect'][$id]['content']) ? htmlspecialchars($stepData[$key]['expect'][$id]['content']) : '', "class='form-control'")?></td>
</tr>
<?php endforeach;?>
</table>
<?php endif;?>
</td>
</tr>
<?php endforeach;?>
</table>
<?php endif;?>
</td>
</tr>
<?php endforeach;?>
</tbody>
<tfoot>
<tr>
<td colspan='10' class='text-center'>
<?php
if(!$insert)
{
include '../../common/view/noticeimport.html.php';
echo "<button type='button' data-toggle='myModal' class='btn btn-primary'>{$lang->save}</button>";
}
else
{
echo html::submitButton();
}
echo ' &nbsp; ' . html::backButton()
?>
</td>
</tr>
</tfoot>
</table>
</tbody>
<tfoot>
<tr>
<td colspan='10' class='text-center'>
<?php
if(!$insert)
{
include '../../common/view/noticeimport.html.php';
echo "<button type='button' data-toggle='myModal' class='btn btn-primary'>{$lang->save}</button>";
}
else
{
echo html::submitButton();
}
echo ' &nbsp; ' . html::backButton()
?>
</td>
</tr>
</tfoot>
</table>
</form>
<?php endif;?>
<script>
+2 -2
View File
@@ -50,7 +50,7 @@
if($caseFails > 0) common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=$runID", '', 'button', 'bug', '', 'iframe', '', "data-width='90%'");
}
if($config->testcase->needReview) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'button', 'review', '', 'iframe');
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'>";
@@ -290,7 +290,7 @@
<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):?>
<?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>
+1 -1
View File
@@ -209,7 +209,7 @@ class testreportModel extends model
$bugInfo['legacyBugs'] = $legacyBugs;
$bugInfo['countBugByTask'] = count($bugsByTask);
$bugInfo['bugConfirmedRate'] = empty($resolvedBugs) ? 0 : round((count(zget($resolutionGroups, 'fixed', array())) + count(zget($resolutionGroups, 'postponed', array()))) / $resolvedBugs * 100, 2);
$bugInfo['bugConfirmedRate'] = empty($resolvedBugs) ? 0 : round((zget($resolutionGroups, 'fixed', 0) + zget($resolutionGroups, 'postponed', 0)) / $resolvedBugs * 100, 2);
$bugInfo['bugCreateByCaseRate'] = empty($byCaseNum) ? 0 : round($byCaseNum / count($newBugs) * 100, 2);
$this->app->loadLang('bug');
@@ -22,7 +22,7 @@
<?php if(isset($_POST["chart-{$infoKey}"])):?>
<img src='<?php echo $_POST["chart-{$infoKey}"]?>' />
<?php else:?>
<canvas id='chart-<?php echo $infoKey?>' width='100' height='14' data-responsive='true'></canvas>
<canvas id='chart-<?php echo $infoKey?>' width='90' height='20' data-responsive='true'></canvas>
<?php endif;?>
</div>
</div>
@@ -52,6 +52,7 @@
$label = $infoValue[$listKey]->name;
$data = $infoValue[$listKey]->value;
}
if(empty($label) and empty($data)) continue;
?>
<tr class='text-center'>
<td class='chart-color w-20px'><i class='chart-color-dot icon-circle'></i></td>
+2 -6
View File
@@ -678,8 +678,6 @@ class testsuite extends control
$this->loadModel('testcase');
if($_POST)
{
if(!$this->config->testcase->needReview) unset($this->lang->testcase->statusList['wait']);
$fields['module'] = $this->lang->testcase->module;
$fields['title'] = $this->lang->testcase->title;
$fields['stepDesc'] = $this->lang->testcase->stepDesc;
@@ -687,14 +685,12 @@ class testsuite extends control
$fields['keywords'] = $this->lang->testcase->keywords;
$fields['type'] = $this->lang->testcase->type;
$fields['pri'] = $this->lang->testcase->pri;
$fields['status'] = $this->lang->testcase->status;
$fields['stage'] = $this->lang->testcase->stage;
$fields['precondition'] = $this->lang->testcase->precondition;
$fields[''] = '';
$fields['typeValue'] = $this->lang->testcase->lblTypeValue;
$fields['stageValue'] = $this->lang->testcase->lblStageValue;
$fields['statusValue'] = $this->lang->testcase->lblStatusValue;
$modules = $this->loadModel('tree')->getOptionMenu($libID, $viewType = 'caselib', $startModuleID = 0);
$rows = array();
@@ -709,7 +705,6 @@ class testsuite extends control
{
$row->typeValue = join("\n", $this->lang->testcase->typeList);
$row->stageValue = join("\n", $this->lang->testcase->stageList);
$row->statusValue = join("\n", $this->lang->testcase->statusList);
}
$rows[] = $row;
}
@@ -942,10 +937,11 @@ class testsuite extends control
if(empty($caseData))
{
unlink($this->session->importFile);
unset($_SESSION['importFile']);
echo js::alert($this->lang->error->noData);
die(js::locate($this->createLink('testsuite', 'library', "libID=$libID")));
}
if(!$this->config->testcase->needReview) unset($this->lang->testcase->statusList['wait']);
/* Judge whether the editedTasks is too large and set session. */
$countInputVars = count($caseData) * 9 + $stepVars;
+1 -1
View File
@@ -1,6 +1,6 @@
$(document).ready(function()
{
if(onlyTest)
if(typeof(onlyTest) != 'undefined' && onlyTest)
{
toggleSearch();
}
+1 -1
View File
@@ -21,7 +21,7 @@ $lang->testsuite->unlinkCase = "Unlink";
$lang->testsuite->batchUnlinkCases = "Batch unlink cases";
$lang->testsuite->deleted = 'deleted';
$lang->testsuite->exportTemplet = 'Export template';
$lang->testsuite->importFile = 'Import CSV';
$lang->testsuite->importFile = 'Import';
$lang->testsuite->common = 'Test Suite';
$lang->testsuite->product = $lang->productCommon;
+1 -1
View File
@@ -21,7 +21,7 @@ $lang->testsuite->unlinkCase = "移除";
$lang->testsuite->batchUnlinkCases = "批量移除用例";
$lang->testsuite->deleted = '已删除';
$lang->testsuite->exportTemplet = '导出模板';
$lang->testsuite->importFile = '导入CSV';
$lang->testsuite->importFile = '导入';
$lang->testsuite->common = '套件';
$lang->testsuite->product = '所属' . $lang->productCommon;
+1 -2
View File
@@ -672,8 +672,7 @@ class testsuiteModel extends model
$caseData->version = 1;
$caseData->openedBy = $this->app->user->account;
$caseData->openedDate = $now;
$caseData->branch = isset($data->branch[$key]) ? $data->branch[$key] : $branch;
if($forceReview) $caseData->status = 'wait';
$caseData->status = $forceReview ? 'wait' : 'normal';
$this->dao->insert(TABLE_CASE)->data($caseData)->autoCheck()->exec();
if(!dao::isError())
+2 -2
View File
@@ -1,9 +1,9 @@
<?php include '../../common/view/header.lite.html.php';?>
<div class='container mw-600px'>
<form class='form-condensed' method='post' enctype='multipart/form-data' target='hiddenwin'>
<form class='form-condensed' method='post' enctype='multipart/form-data' target='hiddenwin' style="padding:30px">
<table class='table table-form'>
<tr>
<td align='center' style="padding:30px">
<td align='center'>
<input type='file' name='file' class='form-control'/>
</td>
<td>
+5 -5
View File
@@ -46,7 +46,7 @@ js::set('flow', $this->config->global->flow);
<?php $hasCasesPriv = common::hasPriv('testsuite', 'library'); ?>
<?php
if($hasCasesPriv) echo "<li id='allTab'>" . html::a($this->inlink('library', "libID=$libID&browseType=all"), $lang->testcase->allCases) . "</li>";
if($hasCasesPriv and $config->testcase->needReview) echo "<li id='waitTab'>" . html::a($this->inlink('library', "libID=$libID&browseType=wait"), $lang->testcase->statusList['wait']) . "</li>";
if($hasCasesPriv and ($config->testcase->needReview or !empty($config->testcase->forceReview))) echo "<li id='waitTab'>" . html::a($this->inlink('library', "libID=$libID&browseType=wait"), $lang->testcase->statusList['wait']) . "</li>";
echo "<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i>&nbsp;{$lang->testcase->bySearch}</a></li> ";
if(common::hasPriv('testsuite', 'libView')) echo '<li>' . html::a(inlink('libView', "libID=$libID"), $lang->testsuite->view) . '</li>';
?>
@@ -58,7 +58,7 @@ js::set('flow', $this->config->global->flow);
if(common::hasPriv('testsuite', 'exportTemplet')) echo html::a($link, "<i class='icon-download-alt'></i> " . $lang->testsuite->exportTemplet, '', "class='btn export'");
$link = common::hasPriv('testsuite', 'import') ? $this->createLink('testsuite', 'import', "libID=$libID") : '#';
if(common::hasPriv('testsuite', 'import')) echo html::a($link, "<i class='icon-upload-alt'></i> " . $lang->testsuite->importFile, '', "class='btn export'");
if(common::hasPriv('testsuite', 'import')) echo html::a($link, "<i class='icon-upload-alt'></i> " . $lang->testcase->importFile, '', "class='btn export'");
?>
</div>
<div class='btn-group'>
@@ -134,7 +134,7 @@ js::set('flow', $this->config->global->flow);
</td>
<td>
<?php
if($config->testcase->needReview) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'review', '', 'iframe');
if($config->testcase->needReview or !empty($config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'list', 'review', '', 'iframe');
common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list');
if(common::hasPriv('testcase', 'delete'))
{
@@ -168,7 +168,7 @@ js::set('flow', $this->config->global->flow);
$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)
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'");
@@ -181,7 +181,7 @@ js::set('flow', $this->config->global->flow);
}
echo '</ul></li>';
}
elseif($config->testcase->needReview)
elseif($config->testcase->needReview or !empty($config->testcase->forceReview))
{
echo '<li>' . html::a('javascript:;', $lang->testcase->review, '', $class) . '</li>';
}
+1 -3
View File
@@ -14,7 +14,6 @@
<th class='w-100px'><?php echo $lang->testcase->module?></th>
<th class='w-70px'><?php echo $lang->testcase->pri?></th>
<th class='w-100px'><?php echo $lang->testcase->type?></th>
<th class='w-100px'><?php echo $lang->testcase->status?></th>
<th><?php echo $lang->testcase->stage?></th>
<th class='w-80px'><?php echo $lang->testcase->keywords?></th>
<th><?php echo $lang->testcase->precondition?></th>
@@ -52,7 +51,6 @@
<td class='text-left' style='overflow:visible'><?php echo html::select("module[$key]", $modules, isset($case->module) ? $case->module : (!empty($case->id) ? $cases[$case->id]->module : ''), "class='form-control chosen'")?></td>
<td><?php echo html::select("pri[$key]", $lang->testcase->priList, isset($case->pri) ? $case->pri : (!empty($case->id) ? $cases[$case->id]->pri : ''), "class='form-control'")?></td>
<td><?php echo html::select("type[$key]", $lang->testcase->typeList, isset($case->type) ? $case->type : (!empty($case->id) ? $cases[$case->id]->type : ''), "class='form-control'")?></td>
<td><?php echo html::select("status[$key]", $lang->testcase->statusList, isset($case->status) ? $case->status : (!empty($case->id) ? $cases[$case->id]->status : 'normal'), "class='form-control'")?></td>
<td class='text-left' style='overflow:visible'><?php echo html::select("stage[$key][]", $lang->testcase->stageList, !empty($case->stage) ? $case->stage : (!empty($case->id) ? $cases[$case->id]->stage : ''), "multiple='multiple' class='form-control chosen'")?></td>
<td><?php echo html::input("keywords[$key]", isset($case->keywords) ? $case->keywords : "", "class='form-control' autocomplete='off'")?></td>
<td><?php echo html::textarea("precondition[$key]", isset($case->precondition) ? htmlspecialchars($case->precondition) : "", "class='form-control'")?></td>
@@ -75,7 +73,7 @@
</tbody>
<tfoot>
<tr>
<td colspan='10' class='text-center'>
<td colspan='9' class='text-center'>
<?php
if(!$insert)
{
+1 -1
View File
@@ -919,7 +919,7 @@ class testtask extends control
$results = $this->testtask->getResults($runID);
$testtaskID = $this->dao->select('task')->from(TABLE_TESTRUN)->where('id')->eq($runID)->fetch('task');
$testtask = $this->dao->select('build, project, product')->from(TABLE_TESTTASK)->where('id')->eq($testtaskID)->fetch();
$testtask = $this->dao->select('id, build, project, product')->from(TABLE_TESTTASK)->where('id')->eq($testtaskID)->fetch();
$this->view->testtask = $testtask;
}
+17 -2
View File
@@ -27,7 +27,7 @@
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th class='w-100px'><?php echo $lang->testcase->module;?></th>
<th width='200'> <?php echo $lang->testcase->title;?></th>
<th width='200'> <?php echo $lang->testcase->precondition;?></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>
@@ -39,7 +39,7 @@
<td><?php echo $lang->testcase->priList[$cases[$caseID]->pri]?></td>
<td class='text-left'><?php echo "<span title='" . $moduleOptionMenu[$cases[$caseID]->module] . "'>" . $moduleOptionMenu[$cases[$caseID]->module] . "</span>"?></td>
<td class='text-left'><?php echo "<span title='{$cases[$caseID]->title}'>{$cases[$caseID]->title}</span>"?></td>
<td class='text-left'><?php echo "<span title='{$cases[$caseID]->precondition}'>{$cases[$caseID]->precondition}</span>"?></td>
<td class='text-left precondition'><?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\")'")?></td>
<td>
<?php if(!empty($steps[$caseID])):?>
@@ -101,5 +101,20 @@ function showAction(value, obj)
}
}
}
$(function()
{
/* Readjust precondition width by cases precondition. */
preconditionWidth = $('th.precondition').width();
$('tbody td.precondition').each(function()
{
width = $(this).find('span:first').width();
if(width > preconditionWidth)
{
preconditionWidth = width;
if(preconditionWidth > 200) preconditionWidth = 200;
$('th.precondition').width(preconditionWidth);
}
});
})
</script>
<?php include '../../common/view/footer.html.php';?>
+3 -3
View File
File diff suppressed because one or more lines are too long