Merge branch 'zentaopms_239'

This commit is contained in:
wangyidong
2022-11-08 08:41:28 +08:00
458 changed files with 9419 additions and 4940 deletions
+35 -27
View File
@@ -57,13 +57,13 @@ class testtask extends control
}
else
{
$products = $this->product->getPairs();
$products = $this->product->getPairs('', 0, '', 'all');
}
if(empty($products) and !helper::isAjaxRequest()) helper::end($this->locate($this->createLink('product', 'showErrorNone', "moduleName=$tab&activeMenu=testtask&objectID=$objectID")));
}
else
{
$products = $this->product->getPairs();
$products = $this->product->getPairs('', 0, '', 'all');
}
$this->view->products = $this->products = $products;
}
@@ -230,10 +230,12 @@ class testtask extends control
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link));
}
$this->loadModel('project');
/* Set menu. */
if($this->app->tab == 'project')
{
$this->loadModel('project')->setMenu($projectID);
$this->project->setMenu($projectID);
}
elseif($this->app->tab == 'execution')
{
@@ -255,12 +257,15 @@ class testtask extends control
/* Set menu. */
$productID = $this->product->saveState($productID, $this->products);
$project = $this->project->getByID($projectID);
if($project && !$project->multiple) $this->view->noMultipleExecutionID = $this->loadModel('execution')->getNoMultipleID($project->id);
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->create;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->common;
$this->view->position[] = $this->lang->testtask->create;
$this->view->productID = $productID;
$this->view->product = $this->product->getByID($productID);
$this->view->projectID = $projectID;
$this->view->executionID = $executionID;
$this->view->executions = $executions;
@@ -333,11 +338,9 @@ class testtask extends control
$this->executeHooks($taskID);
$this->view->title = "TASK #$task->id $task->name/" . $this->products[$productID];
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->common;
$this->view->position[] = $this->lang->testtask->view;
if($task->execution) $this->view->execution = $this->loadModel('project')->getById($task->execution);
$this->view->title = "TASK #$task->id $task->name/" . $this->products[$productID];
$this->view->productID = $productID;
$this->view->task = $task;
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
@@ -475,11 +478,8 @@ class testtask extends control
if(!$task) return print(js::error($this->lang->testtask->checkLinked) . js::locate('back'));
$productID = $task->product;
if(!isset($this->products[$productID]))
{
$product = $this->product->getByID($productID);
$this->products[$productID] = $product->name;
}
$product = $this->product->getByID($productID);
if(!isset($this->products[$productID])) $this->products[$productID] = $product->name;
if($this->app->tab == 'project')
{
@@ -545,6 +545,7 @@ class testtask extends control
$this->config->testcase->search['params']['assignedTo'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
$this->config->testcase->search['actionURL'] = inlink('cases', "taskID=$taskID&browseType=bySearch&queryID=myQueryID");
if(!$this->config->testcase->needReview) unset($this->config->testcase->search['params']['status']['values']['wait']);
if($product->shadow) unset($this->config->testcase->search['fields']['product']);
unset($this->config->testcase->search['fields']['branch']);
unset($this->config->testcase->search['params']['branch']);
$this->loadModel('search')->setSearchParams($this->config->testcase->search);
@@ -775,10 +776,12 @@ class testtask extends control
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $link));
}
$this->loadModel('project');
/* Set menu. */
if($this->app->tab == 'project')
{
$this->loadModel('project')->setMenu($task->project);
$this->project->setMenu($task->project);
}
elseif($this->app->tab == 'execution')
{
@@ -795,23 +798,28 @@ class testtask extends control
$this->products[$productID] = $product->name;
}
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->edit;
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = $this->lang->testtask->common;
$this->view->position[] = $this->lang->testtask->edit;
/* Create testtask from testtask of test.*/
$productID = $productID ? $productID : key($this->products);
$projectID = $this->lang->navGroup->testtask == 'qa' ? 0 : $this->session->project;
$executions = empty($productID) ? array() : $this->product->getExecutionPairsByProduct($productID, 0, 'id_desc', $projectID);
$executionID = $task->execution;
if(!isset($executions[$executionID]))
if($executionID)
{
$appendExecution = $this->loadModel('execution')->getByID($executionID);
$executions[$executionID] = $appendExecution->name;
$execution = $this->loadModel('execution')->getById($executionID);
if(!isset($executions[$executionID]))
{
$executions[$executionID] = $execution->name;
if(empty($execution->multiple))
{
$project = $this->loadModel('project')->getById($execution->project);
$executions[$executionID] = $project->name . "({$this->lang->project->disableExecution})";
}
}
}
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->edit;
$this->view->task = $task;
$this->view->project = $this->project->getByID($projectID);
$this->view->executions = $executions;
$this->view->builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk', $executionID, 'execution');
$this->view->testreports = $this->loadModel('testreport')->getPairs($task->product, $task->testreport);
@@ -1061,11 +1069,9 @@ class testtask extends control
/* Get task and product id. */
$task = $this->testtask->getById($taskID);
$productID = $this->product->saveState($task->product, $this->products);
if(!isset($this->products[$productID]))
{
$product = $this->product->getByID($productID);
$this->products[$productID] = $product->name;
}
$product = $this->product->getByID($productID);
if(!isset($this->products[$productID])) $this->products[$productID] = $product->name;
/* Save session. */
if($this->app->tab == 'project')
@@ -1093,6 +1099,8 @@ class testtask extends control
$this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, 'case', 0, $task->branch);
$this->config->testcase->search['actionURL'] = inlink('linkcase', "taskID=$taskID&type=$type&param=$param");
$this->config->testcase->search['style'] = 'simple';
if($product->shadow) unset($this->config->testcase->search['fields']['product']);
if($task->productType == 'normal')
{
unset($this->config->testcase->search['fields']['branch']);
+1 -1
View File
@@ -38,5 +38,5 @@ function loadExecutions(productID)
$(function()
{
adjustPriBoxWidth();
if($('#execution').val() != 0) loadExecutionBuilds($('#execution').val());
if($('#execution').val() != 0 && multiple) loadExecutionBuilds($('#execution').val());
});
+1 -1
View File
@@ -45,7 +45,7 @@ $lang->testtask->testingAB = "Testing";
$lang->testtask->blocked = "Blockiert";
$lang->testtask->done = "Getestet";
$lang->testtask->totalStatus = "Alle";
$lang->testtask->all = "Alle " . $lang->productCommon;
$lang->testtask->all = 'Alle';
$lang->testtask->allTasks = 'Alle';
$lang->testtask->collapseAll = 'Zuklappen';
$lang->testtask->expandAll = 'Aufklappen';
+1 -1
View File
@@ -45,7 +45,7 @@ $lang->testtask->testingAB = "Testing";
$lang->testtask->blocked = "Blocked";
$lang->testtask->done = "Tested";
$lang->testtask->totalStatus = "All";
$lang->testtask->all = "All " . $lang->productCommon . "s";
$lang->testtask->all = 'All';
$lang->testtask->allTasks = 'All Requests';
$lang->testtask->collapseAll = 'Collapse';
$lang->testtask->expandAll = 'Expand';
+1 -1
View File
@@ -45,7 +45,7 @@ $lang->testtask->testingAB = "Testing";
$lang->testtask->blocked = "Bloquée";
$lang->testtask->done = "Jouée";
$lang->testtask->totalStatus = "Toutes";
$lang->testtask->all = "Tous " . $lang->productCommon . "s";
$lang->testtask->all = 'Toutes';
$lang->testtask->allTasks = 'Toutes Recettes';
$lang->testtask->collapseAll = 'Replier';
$lang->testtask->expandAll = 'Déplier';
+1 -1
View File
@@ -49,7 +49,7 @@ $lang->testtask->testing = "Đang Test";
$lang->testtask->blocked = "Blocked";
$lang->testtask->done = "Đã test";
$lang->testtask->totalStatus = "Tất cả";
$lang->testtask->all = "Tất cả " . $lang->productCommon . "s";
$lang->testtask->all = 'Tất cả';
$lang->testtask->allTasks = 'Tất cả yêu cầu';
$lang->testtask->collapseAll = 'Co lại';
$lang->testtask->expandAll = 'Mở ra';
+1 -1
View File
@@ -45,7 +45,7 @@ $lang->testtask->testingAB = "测试中";
$lang->testtask->blocked = "被阻塞测试单";
$lang->testtask->done = "已测测试单";
$lang->testtask->totalStatus = "全部";
$lang->testtask->all = "全部" . $lang->productCommon;
$lang->testtask->all = '所有';
$lang->testtask->allTasks = '所有测试';
$lang->testtask->collapseAll = '全部折叠';
$lang->testtask->expandAll = '全部展开';
+1 -1
View File
@@ -45,7 +45,7 @@ $lang->testtask->testingAB = "測試中";
$lang->testtask->blocked = "被阻塞測試單";
$lang->testtask->done = "已測測試單";
$lang->testtask->totalStatus = "全部";
$lang->testtask->all = "全部" . $lang->productCommon;
$lang->testtask->all = '所有';
$lang->testtask->allTasks = '所有測試';
$lang->testtask->collapseAll = '全部摺疊';
$lang->testtask->expandAll = '全部展開';
+9 -10
View File
@@ -30,7 +30,7 @@ class testtaskModel extends model
$task = fixer::input('post')
->setDefault('build', '')
->setIF($this->config->systemMode == 'new', 'project', $projectID)
->setDefault('project', $projectID)
->setDefault('createdBy', $this->app->user->account)
->setDefault('createdDate', helper::now())
->stripTags($this->config->testtask->editor->create['id'], $this->config->allowedTags)
@@ -76,8 +76,8 @@ class testtaskModel extends model
$products = $scopeAndStatus[0] == 'all' ? $this->app->user->view->products : array();
$branch = $scopeAndStatus[0] == 'all' ? 'all' : $branch;
$executionNameField = $this->config->systemMode == 'new' ? "IF(t5.id IS NOT NULL, CONCAT(t5.name, ' / ', t3.name), t3.name)" : 't3.name';
return $this->dao->select("t1.*, t2.name AS productName, $executionNameField AS executionName, t4.name AS buildName, t4.branch AS branch")
$executionNameField = "IF(t5.id IS NOT NULL && t5.multiple = '1', CONCAT(t5.name, ' / ', t3.name), IF(t5.id IS NOT NULL, t5.name, t3.name))";
return $this->dao->select("t1.*, t5.multiple, IF(t2.shadow = 1, t5.name, t2.name) AS productName, $executionNameField AS executionName, t4.name AS buildName, t4.branch AS branch")
->from(TABLE_TESTTASK)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->leftJoin(TABLE_EXECUTION)->alias('t3')->on('t1.execution = t3.id')
@@ -131,7 +131,7 @@ class testtaskModel extends model
->leftJoin(TABLE_BUILD)->alias('t4')->on('t1.build = t4.id')
->where('t1.deleted')->eq(0)
->andWhere('t1.product')->eq($productID)
->beginIF($this->config->systemMode == 'new' and $this->lang->navGroup->testtask != 'qa')->andWhere('t1.project')->eq($this->session->project)->fi()
->beginIF($this->lang->navGroup->testtask != 'qa')->andWhere('t1.project')->eq($this->session->project)->fi()
->andWhere('t1.auto')->eq('unit')
->beginIF($browseType != 'all' and $browseType != 'newest' and $beginAndEnd)
->andWhere('t1.end')->ge($beginAndEnd['begin'])
@@ -296,8 +296,7 @@ class testtaskModel extends model
*/
public function getByUser($account, $pager = null, $orderBy = 'id_desc', $type = '')
{
$executionNameField = $this->config->systemMode == 'new' ? "IF(t5.id IS NOT NULL, CONCAT(t5.name, ' / ', t2.name), t2.name)" : 't2.name';
return $this->dao->select("t1.*, $executionNameField AS executionName, t3.name AS buildName")
return $this->dao->select("t1.*, t2.name AS executionName, t2.multiple as executionMultiple, t5.name as projectName, t3.name AS buildName")
->from(TABLE_TESTTASK)->alias('t1')
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution = t2.id')
->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build = t3.id')
@@ -403,7 +402,7 @@ class testtaskModel extends model
{
$cases = $this->dao->select('*')->from(TABLE_CASE)
->where($query)
->beginIF($this->config->systemMode == 'new' and $this->lang->navGroup->testtask != 'qa')->andWhere('project')->eq($this->session->project)->fi()
->beginIF($this->lang->navGroup->testtask != 'qa')->andWhere('project')->eq($this->session->project)->fi()
->andWhere('product')->eq($productID)
->andWhere('status')->ne('wait')
->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()
@@ -436,7 +435,7 @@ class testtaskModel extends model
if($bugs)
{
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($query)
->beginIF($this->config->systemMode == 'new' and $this->lang->navGroup->testtask != 'qa')->andWhere('project')->eq($this->session->project)->fi()
->beginIF($this->lang->navGroup->testtask != 'qa')->andWhere('project')->eq($this->session->project)->fi()
->andWhere('product')->eq($productID)
->andWhere('status')->ne('wait')
->beginIF($linkedCases)->andWhere('id')->notIN($linkedCases)->fi()
@@ -469,7 +468,7 @@ class testtaskModel extends model
return $this->dao->select('t1.*,t2.version as version')->from(TABLE_CASE)->alias('t1')
->leftJoin(TABLE_SUITECASE)->alias('t2')->on('t1.id=t2.case')
->where($query)
->beginIF($this->config->systemMode == 'new' and $this->lang->navGroup->testtask != 'qa')->andWhere('t1.project')->eq($this->session->project)->fi()
->beginIF($this->lang->navGroup->testtask != 'qa')->andWhere('t1.project')->eq($this->session->project)->fi()
->andWhere('t2.suite')->eq((int)$suite)
->andWhere('t1.product')->eq($productID)
->andWhere('status')->ne('wait')
@@ -504,7 +503,7 @@ class testtaskModel extends model
->where($query)
->andWhere('t1.id')->notin($linkedCases)
->andWhere('t2.task')->eq($testTask)
->beginIF($this->config->systemMode == 'new' and $this->lang->navGroup->testtask != 'qa')->andWhere('t1.project')->eq($this->session->project)->fi()
->beginIF($this->lang->navGroup->testtask != 'qa')->andWhere('t1.project')->eq($this->session->project)->fi()
->andWhere('t1.status')->ne('wait')
->page($pager)
->fetchAll();
+21 -12
View File
@@ -15,6 +15,7 @@
<?php include '../../common/view/kindeditor.html.php';?>
<?php js::import($jsRoot . 'misc/date.js');?>
<?php js::set('projectID', $projectID);?>
<?php js::set('multiple', isset($noMultipleExecutionID) ? false : true);?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>
@@ -23,33 +24,41 @@
<form method='post' class="main-form form-ajax" enctype="multipart/form-data" id='dataform'>
<table class='table table-form'>
<?php if(isset($executionID)):?>
<tr>
<tr <?php if(!empty($product->shadow)) echo "class='hide'";?>>
<th class='w-100px'><?php echo $lang->testtask->product;?></th>
<td class='w-p35-f'><?php echo html::select('product', $products, $productID, "class='form-control chosen' onchange='loadProductRelated()'");?></td><td></td>
<td class='w-p35-f'><?php echo html::select('product', $products, $product->id, "class='form-control chosen' onchange='loadProductRelated()'");?></td><td></td>
</tr>
<?php else:?>
<tr class='hide'>
<th class='w-80px'><?php echo $lang->testtask->product;?></th>
<td class='w-p35-f'><?php echo html::input('product', $productID, "class='form-control' onchange='loadTestReports(this.value)'");?></td><td></td>
<th class='w-100px'><?php echo $lang->testtask->product;?></th>
<td class='w-p35-f'><?php echo html::input('product', $product->id, "class='form-control' onchange='loadTestReports(this.value)'");?></td><td></td>
</tr>
<?php endif;?>
<?php if(isset($noMultipleExecutionID)):?>
<?php echo html::hidden('execution', $noMultipleExecutionID);?>
<?php else:?>
<tr>
<th class='w-80px'><?php echo $lang->testtask->execution;?></th>
<th class='w-100px'><?php echo $lang->testtask->execution;?></th>
<td class='w-p35-f'><?php echo html::select('execution', $executions, $executionID, "class='form-control chosen' onchange='loadExecutionRelated(this.value)'");?></td><td></td>
</tr>
<?php endif;?>
<tr>
<th class='w-80px'><?php echo $lang->testtask->build;?></th>
<td class='w-p35-f'>
<th><?php echo $lang->testtask->build;?></th>
<td>
<div class='input-group' id='buildBox'>
<?php echo html::select('build', empty($builds) ? '' : $builds, $build, "class='form-control chosen'");?>
<?php if(isset($executionID) and $executionID and empty($builds)):?>
<span class='input-group-addon'><?php echo html::a(helper::createLink('build', 'create', "executionID=$executionID&productID=$productID&projectID=$projectID", '', true), $lang->build->create, '', "data-toggle='modal' data-type='iframe' data-width='95%'")?> </span>
<?php echo html::select('build', empty($builds) ? '' : $builds, $build, "class='form-control chosen'");?>
<?php if(isset($executionID) and $executionID and empty($builds)):?>
<span class='input-group-addon'><?php echo html::a(helper::createLink('build', 'create', "executionID=$executionID&productID={$product->id}&projectID={$projectID}", '', true), $lang->build->create, '', "data-toggle='modal' data-type='iframe' data-width='95%'")?> </span>
<div class='hidden'><?php echo '&nbsp; ' . html::a("javascript:void(0)", $lang->refresh, '', "class='refresh' onclick='loadExecutionBuilds($executionID)'");?></div>
<?php endif;?>
</div>
<div class='hidden'><?php echo '&nbsp; ' . html::a("javascript:void(0)", $lang->refresh, '', "class='refresh' onclick='loadExecutionBuilds($executionID)'");?></div>
<?php endif;?>
</td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testtask->type;?></th>
<td><?php echo html::select('type[]', $lang->testtask->typeList, '', "class='form-control picker-select' multiple");?></td>
+6 -6
View File
@@ -24,18 +24,18 @@
</div>
<form method='post' class="main-form form-ajax" enctype="multipart/form-data" id='dataform'>
<table class='table table-form'>
<tr>
<tr class="<?php if(isset($project) and !$project->multiple) echo 'hide';?>">
<th class='w-100px'><?php echo $lang->testtask->execution;?></th>
<td class='w-p35-f'>
<?php
echo html::select('execution', $executions, $task->execution, "class='form-control chosen' onchange='loadExecutionRelated(this.value)'");
echo html::hidden('product', $task->product);
?>
<?php
echo html::select('execution', $executions, $task->execution, "class='form-control chosen' onchange='loadExecutionRelated(this.value)'");
echo html::hidden('product', $task->product);
?>
</td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testtask->build;?></th>
<th class='w-100px'><?php echo $lang->testtask->build;?></th>
<td class='w-p35-f'><span id='buildBox'><?php echo html::select('build', $builds, $task->build, "class='form-control chosen'");?></span></td>
<td></td>
</tr>
+3 -1
View File
@@ -62,12 +62,14 @@
<div class="detail-content">
<table class="table table-data table-fixed">
<?php $isOnlybody = helper::inOnlyBodyMode(); ?>
<?php if(!empty($execution->multiple)):?>
<tr>
<th class='w-90px'><?php echo $lang->testtask->execution;?></th>
<td><?php echo $isOnlybody ? $task->executionName : html::a($this->createLink('execution', 'story', "executionID=$task->execution"), $task->executionName, '', "title='{$task->executionName}'");?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->testtask->build;?></th>
<th class='w-90px'><?php echo $lang->testtask->build;?></th>
<td>
<?php
if($task->build == 'trunk')