Merge branch '15.0.beta3' of http://gitlab.zcorp.cc/easycorp/zentaopms into 15.0.beta3

This commit is contained in:
zhujinyong
2021-03-29 11:31:30 +08:00
25 changed files with 115 additions and 69 deletions
+7 -2
View File
@@ -37,6 +37,8 @@ class testtask extends control
{
parent::__construct($moduleName, $methodName);
$this->loadModel('product');
/* Get product data. */
$projectID = 0;
if($this->app->openApp == 'project')
@@ -45,7 +47,7 @@ class testtask extends control
$products = $this->loadModel('project')->getProducts($projectID, false);
}
if($this->app->openApp == 'execution') $products = $this->loadModel('execution')->getProducts($this->session->execution, false);
if($this->app->openApp == 'qa' or $this->app->openApp == 'my') $products = $this->loadModel('product')->getPairs();
if($this->app->openApp == 'qa' or $this->app->openApp == 'my') $products = $this->product->getPairs();
$this->view->products = $this->products = $products;
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "moduleName={$this->app->openApp}&activeMenu=testtask&projectID=$projectID")));
}
@@ -211,6 +213,10 @@ class testtask extends control
{
$this->loadModel('execution')->setMenu($executionID);
}
elseif($this->app->openApp == 'qa')
{
$this->loadModel('qa')->setMenu($this->products, $productID);
}
/* Create testtask from testtask of test.*/
$productID = $productID ? $productID : key($this->products);
@@ -219,7 +225,6 @@ class testtask extends control
/* Set menu. */
$productID = $this->product->saveState($productID, $this->products);
$this->loadModel('qa')->setMenu($this->products, $productID);
$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]);
+25 -1
View File
@@ -6,7 +6,31 @@
*/
function loadProductRelated()
{
loadExecutionBuilds(parseInt($('#execution').val()));
loadExecutions($('#product').val());
data = '<select id="build" name="build" class="form-control"></select>';
$('#build').replaceWith(data);
$('#build_chosen').remove();
$("#build").chosen();
$('#build').trigger("chosen:updated");
}
/**
* Load executions.
*
* @param int productID
* @access public
* @return void
*/
function loadExecutions(productID)
{
link = createLink('product', 'ajaxGetExecutions', 'productID=' + productID + '&projectID=' + projectID);
$.get(link, function(data)
{
if(!data) data = '<select id="execution" name="execution" class="form-control"></select>';
$('#execution').replaceWith(data);
$('#execution_chosen').remove();
$("#execution").chosen();
});
}
/* If the mouse hover over the manage contacts button, give tip. */
+1 -1
View File
@@ -72,7 +72,7 @@ class testtaskModel extends model
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t5')->on('t1.execution = t5.project and t1.product = t5.product')
->where('t1.deleted')->eq(0)
->beginIF($this->config->systemMode == 'new' and $this->lang->navGroup->testtask != 'qa')->andWhere('t1.project')->eq($this->session->project)->fi()
->beginIF($this->config->systemMode == 'new' and $this->app->openApp != 'qa')->andWhere('t1.project')->eq($this->session->project)->fi()
->andWhere('t1.auto')->ne('unit')
->beginIF(!$this->app->user->admin)->andWhere('t3.id')->in("0,{$this->app->user->view->sprints}")->fi()
->beginIF($scopeAndStatus[0] == 'local')->andWhere('t1.product')->eq((int)$productID)->fi()
+1 -1
View File
@@ -14,7 +14,7 @@
<?php include '../../common/view/datepicker.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php js::import($jsRoot . 'misc/date.js');?>
<?php js::set('projectID', $this->session->project);?>
<?php js::set('projectID', $projectID);?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>