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

This commit is contained in:
wangyidong
2021-04-09 10:30:04 +08:00
11 changed files with 65 additions and 47 deletions
+3 -8
View File
@@ -1874,15 +1874,10 @@ class bug extends control
* @access public
* @return void
*/
public function ajaxGetDropMenu($productID, $module, $method, $extra = '', $from = '')
public function ajaxGetDropMenu($productID, $module, $method, $extra = '')
{
if($from == 'qa')
{
$this->app->loadConfig('qa');
foreach($this->config->qa->menuList as $menu) $this->lang->navGroup->$menu = 'qa';
}
$products = $this->product->getProducts($this->session->project, $this->config->CRProduct ? 'all' : 'noclosed', 'program desc, line desc, ');
$products = array();
if(!empty($extra)) $products = $this->product->getProducts($extra, $this->config->CRProduct ? 'all' : 'noclosed', 'program desc, line desc, ');
$this->view->link = $this->product->getProductLink($module, $method, $extra);
$this->view->productID = $productID;
+8 -8
View File
@@ -1401,6 +1401,7 @@ class bugModel extends model
* Get bugs of a project.
*
* @param int $projectID
* @param int $productID
* @param int $build
* @param string $type
* @param int $param
@@ -1410,14 +1411,12 @@ class bugModel extends model
* @access public
* @return array
*/
public function getProjectBugs($projectID, $build = 0, $type = '', $param = 0, $orderBy = 'id_desc', $excludeBugs = '', $pager = null)
public function getProjectBugs($projectID, $productID = 0, $build = 0, $type = '', $param = 0, $orderBy = 'id_desc', $excludeBugs = '', $pager = null)
{
$type = strtolower($type);
if($type == 'bysearch')
{
$queryID = (int)$param;
$products = $this->loadModel('project')->getProducts($projectID);
$queryID = (int)$param;
if($this->session->projectBugQuery == false) $this->session->set('projectBugQuery', ' 1 = 1');
if($queryID)
{
@@ -1450,6 +1449,7 @@ class bugModel extends model
$bugs = $this->dao->select('*')->from(TABLE_BUG)
->where('deleted')->eq(0)
->beginIF(empty($build))->andWhere('project')->eq($projectID)->fi()
->beginIF(!empty($productID))->andWhere('product')->eq($productID)->fi()
->beginIF($type == 'unresolved')->andWhere('status')->eq('active')->fi()
->beginIF($type == 'noclosed')->andWhere('status')->ne('closed')->fi()
->beginIF($build)->andWhere("CONCAT(',', openedBuild, ',') like '%,$build,%'")->fi()
@@ -1466,6 +1466,7 @@ class bugModel extends model
* Get bugs of a execution.
*
* @param int $executionID
* @param int $productID
* @param int $build
* @param string $type
* @param int $param
@@ -1475,14 +1476,12 @@ class bugModel extends model
* @access public
* @return array
*/
public function getExecutionBugs($executionID, $build = 0, $type = '', $param = 0, $orderBy = 'id_desc', $excludeBugs = '', $pager = null)
public function getExecutionBugs($executionID, $productID = 0, $build = 0, $type = '', $param = 0, $orderBy = 'id_desc', $excludeBugs = '', $pager = null)
{
$type = strtolower($type);
if($type == 'bysearch')
{
$queryID = (int)$param;
$products = $this->loadModel('execution')->getProducts($executionID);
$queryID = (int)$param;
if($this->session->executionBugQuery == false) $this->session->set('executionBugQuery', ' 1 = 1');
if($queryID)
{
@@ -1515,6 +1514,7 @@ class bugModel extends model
$bugs = $this->dao->select('*')->from(TABLE_BUG)
->where('deleted')->eq(0)
->beginIF(empty($build))->andWhere('execution')->eq($executionID)->fi()
->beginIF(!empty($productID))->andWhere('product')->eq($productID)->fi()
->beginIF($type == 'unresolved')->andWhere('status')->eq('active')->fi()
->beginIF($type == 'noclosed')->andWhere('status')->ne('closed')->fi()
->beginIF($build)->andWhere("CONCAT(',', openedBuild, ',') like '%,$build,%'")->fi()
+2 -2
View File
@@ -17,7 +17,7 @@ foreach($products as $product)
}
$productsPinYin = common::convert2Pinyin($productNames);
$linkHtml = $this->product->setParamsForLink($module, $link, $projectID, 0);
$productsHtml = html::a($linkHtml, $this->lang->bug->allProduct, '', "class='text-important' title='{$this->lang->bug->allProduct}' data-key='" . zget($productsPinYin, $this->lang->bug->allProduct, '') . "' data-group='project'");
$productsHtml = html::a($linkHtml, $this->lang->bug->allProduct, '', "class='text-important' title='{$this->lang->bug->allProduct}' data-key='" . zget($productsPinYin, $this->lang->bug->allProduct, '') . "' data-app='{$this->app->openApp}'");
foreach($products as $product)
{
@@ -26,7 +26,7 @@ foreach($products as $product)
$productName .= $product->line ? zget($lines, $product->line, '') . '/' . $product->name : $product->name;
$objectID = ($product->type != 'platform' && $module == 'branch' && $method == 'manage') ? $productID : $product->id;
$linkHtml = $this->product->setParamsForLink($module, $link, $projectID, $product->id);
$productsHtml .= html::a($linkHtml, $productName, '', "class='text-important $selected' title='{$productName}' data-key='" . zget($productsPinYin, $product->name, '') . "' data-group='project'");
$productsHtml .= html::a($linkHtml, $productName, '', "class='text-important $selected' title='{$productName}' data-key='" . zget($productsPinYin, $product->name, '') . "' data-app='{$this->app->openApp}'");
}
?>
<div class="table-row">
+9 -4
View File
@@ -836,6 +836,7 @@ class execution extends control
* Browse bugs of a execution.
*
* @param int $executionID
* @param int $productID
* @param string $orderBy
* @param int $build
* @param string $type
@@ -846,11 +847,12 @@ class execution extends control
* @access public
* @return void
*/
public function bug($executionID = 0, $orderBy = 'status,id_desc', $build = 0, $type = 'all', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
public function bug($executionID = 0, $productID = 0, $orderBy = 'status,id_desc', $build = 0, $type = 'all', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Load these two models. */
$this->loadModel('bug');
$this->loadModel('user');
$this->loadModel('product');
/* Save session. */
$this->session->set('bugList', $this->app->getURI(true), 'execution');
@@ -860,9 +862,12 @@ class execution extends control
$execution = $this->commonAction($executionID);
$executionID = $execution->id;
$products = $this->execution->getProducts($execution->id);
$productID = key($products); // Get the first product for creating bug.
$branchID = isset($products[$productID]) ? $products[$productID]->branch : 0;
$productPairs = array('0' => $this->lang->product->all);
foreach($products as $product) $productPairs[$product->id] = $product->name;
$this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'execution', 'bug', '', $branchID);
/* Header and position. */
$title = $execution->name . $this->lang->colon . $this->lang->execution->bug;
$position[] = html::a($this->createLink('execution', 'browse', "executionID=$executionID"), $execution->name);
@@ -872,7 +877,7 @@ class execution extends control
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$sort = $this->loadModel('common')->appendOrder($orderBy);
$bugs = $this->bug->getExecutionBugs($executionID, $build, $type, $param, $sort, '', $pager);
$bugs = $this->bug->getExecutionBugs($executionID, $productID, $build, $type, $param, $sort, '', $pager);
$users = $this->user->getPairs('noletter');
/* team member pairs. */
@@ -884,7 +889,7 @@ class execution extends control
}
/* Build the search form. */
$actionURL = $this->createLink('execution', 'bug', "executionID=$executionID&orderBy=$orderBy&build=$build&type=bysearch&queryID=myQueryID");
$actionURL = $this->createLink('execution', 'bug', "executionID=$executionID&productID=$productID&orderBy=$orderBy&build=$build&type=bysearch&queryID=myQueryID");
$this->execution->buildBugSearchForm($products, $queryID, $actionURL);
/* Assign. */
+7 -3
View File
@@ -11,12 +11,16 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<style>
#subHeader #dropMenu .col-left .list-group {margin-bottom: 0px; padding-top: 10px;}
#subHeader #dropMenu .col-left {padding-bottom: 0px;}
</style>
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<?php
$buildName = $build ? " <span class='label label-danger'>Build:{$build->name}</span>" : '';
echo html::a($this->inlink('bug', "executionID={$execution->id}&orderBy=status,id_desc&build=$buildID&type=all"), "<span class='text'>{$lang->bug->allBugs}</span>" . ($type == 'all' ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>$buildName" : ''), '', "id='allTab' class='btn btn-link" . ('all' == $type ? ' btn-active-text' : '') . "'");
echo html::a($this->inlink('bug', "executionID={$execution->id}&orderBy=status,id_desc&build=$buildID&type=unresolved"), "<span class='text'>{$lang->bug->unResolved}</span>" . ($type == 'unresolved' ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>$buildName" : ''), '', "id='unresolvedTab' class='btn btn-link" . ('unresolved' == $type ? ' btn-active-text' : '') . "'");
echo html::a($this->inlink('bug', "executionID={$execution->id}&productID={$productID}&orderBy=status,id_desc&build=$buildID&type=all"), "<span class='text'>{$lang->bug->allBugs}</span>" . ($type == 'all' ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>$buildName" : ''), '', "id='allTab' class='btn btn-link" . ('all' == $type ? ' btn-active-text' : '') . "'");
echo html::a($this->inlink('bug', "executionID={$execution->id}&productID={$productID}&orderBy=status,id_desc&build=$buildID&type=unresolved"), "<span class='text'>{$lang->bug->unResolved}</span>" . ($type == 'unresolved' ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>$buildName" : ''), '', "id='unresolvedTab' class='btn btn-link" . ('unresolved' == $type ? ' btn-active-text' : '') . "'");
?>
<a class="btn btn-link querybox-toggle" id="bysearchTab"><i class="icon icon-search muted"></i> <?php echo $lang->bug->search;?></a>
</div>
@@ -40,7 +44,7 @@
<form class='main-table' method='post' id='executionBugForm' data-ride="table">
<table class='table has-sort-head' id='bugList'>
<?php $canBatchAssignTo = common::hasPriv('bug', 'batchAssignTo');?>
<?php $vars = "executionID={$execution->id}&orderBy=%s&build=$buildID&type=$type&param=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<?php $vars = "executionID={$execution->id}&productID={$productID}&orderBy=%s&build=$buildID&type=$type&param=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<thead>
<tr>
<th class='c-id'>
+1 -1
View File
@@ -132,7 +132,7 @@
<?php $i++;?>
<?php endforeach;?>
<div class="col-xs-6">
<?php if($canBeChanged) common::printLink('doc', 'createLib', "type=execution&objectID=$execution->id", "<i class='icon icon-plus hl-primary text-primary'></i> &nbsp;" . $lang->doc->createlib, '', "class='text-muted iframe' data-width='1000px'");?>
<?php if($canBeChanged) common::printLink('doc', 'createLib', "type=execution&objectID=$execution->id", "<i class='icon icon-plus hl-primary text-primary'></i> &nbsp;" . $lang->doc->createLib, '', "class='text-muted iframe' data-width='1000px'");?>
</div>
<?php endif;?>
</div>
-1
View File
@@ -148,7 +148,6 @@
<?php if($child->parent > 0) echo '<span class="label label-badge label-light">' . $this->lang->task->childrenAB . '</span> ';?>
<?php echo html::a($this->createLink('task', 'view', "taskID=$child->id", '', '', $child->project), $child->name, null, "style='color: $child->color' data-group='project'");?>
</td>
<td class='c-project'><?php echo zget($projects, $child->project, '');?></td>
<td class='c-project' title="<?php echo $child->projectName;?>"><?php echo html::a($this->createLink('execution', 'task', "executionID=$child->project", '', '', $child->project), $child->executionName, '', "data-group='execution'");?></td>
<?php if($type != 'openedBy'): ?>
<td class='c-user'><?php echo zget($users, $child->openedBy);?></td>
+13 -7
View File
@@ -64,16 +64,19 @@ class productModel extends model
* @param string $currentModule
* @param string $currentMethod
* @param string $extra
* @param int $branch
* @param int $module
* @param string $moduleType
*
* @access public
* @return string
*/
public function select($products, $productID, $currentModule, $currentMethod, $extra = '', $branch = 0, $module = 0, $moduleType = '')
{
$isProject = ($this->app->openApp == 'project' and strpos('bug,testcase,testtask', $this->app->rawMethod) !== false and isset($products[0])) ? true : false;
$isBrowseBug = (strpos(',project,execution,', ",{$this->app->openApp},") !== false and strpos(',bug,testcase,testtask,', ",{$this->app->rawMethod},") !== false and isset($products[0])) ? true : false;
$this->app->loadLang('product');
if(!$isProject and !$productID)
if(!$isBrowseBug and !$productID)
{
unset($this->lang->product->menu->settings['subMenu']->branch);
return;
@@ -83,8 +86,10 @@ class productModel extends model
setcookie("lastProduct", $productID, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
if($productID) $currentProduct = $this->getById($productID);
if($isProject) $extra = $this->session->project;
if($isProject and !$productID)
if($isBrowseBug and $this->app->openApp == 'project') $extra = $this->session->project;
if($isBrowseBug and $this->app->openApp == 'execution') $extra = $this->session->execution;
if($isBrowseBug and !$productID)
{
$currentProduct = new stdclass();
$currentProduct->name = $products[$productID];
@@ -95,7 +100,7 @@ class productModel extends model
$output = '';
if(!empty($products))
{
$dropMenuLink = helper::createLink($isProject ? 'bug' : 'product', 'ajaxGetDropMenu', "objectID=$productID&module=$currentModule&method=$currentMethod&extra=$extra");
$dropMenuLink = helper::createLink($isBrowseBug ? 'bug' : 'product', 'ajaxGetDropMenu', "objectID=$productID&module=$currentModule&method=$currentMethod&extra=$extra");
$output = "<div class='btn-group angle-btn'><div class='btn-group'><button data-toggle='dropdown' type='button' class='btn btn-limit' id='currentItem' title='{$currentProduct->name}'><span class='text'>{$currentProduct->name}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label 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>';
$output .= "</div></div>";
@@ -1599,9 +1604,10 @@ class productModel extends model
{
return helper::createLink('design', 'browse', "productID=%s");
}
elseif($module == 'project')
elseif($module == 'project' or $module == 'execution')
{
return helper::createLink('project', $method, "projectID=$extra&productID=%s");
$objectID = $module == 'project' ? 'projectID' : 'executionID';
return helper::createLink($module, $method, "$objectID=$extra&productID=%s");
}
return $link;
+14 -9
View File
@@ -693,6 +693,7 @@ class project extends control
* Project bug list.
*
* @param int $projectID
* @param int $productID
* @param string $orderBy
* @param int $build
* @param string $type
@@ -703,22 +704,26 @@ class project extends control
* @access public
* @return void
*/
public function bug($projectID = 0, $orderBy = 'status,id_desc', $build = 0, $type = 'all', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
public function bug($projectID = 0, $productID = 0, $orderBy = 'status,id_desc', $build = 0, $type = 'all', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Load these two models. */
$this->loadModel('bug');
$this->loadModel('user');
$this->loadModel('product');
/* Save session. */
$this->session->set('bugList', $this->app->getURI(true), 'qa');
$this->project->setMenu($projectID);
$project = $this->project->getByID($projectID);
$type = strtolower($type);
$queryID = ($type == 'bysearch') ? (int)$param : 0;
$products = $this->project->getProducts($projectID);
$productID = key($products); // Get the first product for creating bug.
$branchID = isset($products[$productID]) ? $products[$productID]->branch : 0;
$project = $this->project->getByID($projectID);
$type = strtolower($type);
$queryID = ($type == 'bysearch') ? (int)$param : 0;
$products = $this->project->getProducts($projectID);
$branchID = isset($products[$productID]) ? $products[$productID]->branch : 0;
$productPairs = array('0' => $this->lang->product->all);
foreach($products as $product) $productPairs[$product->id] = $product->name;
$this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'project', 'bug', '', $branchID);
/* Header and position. */
$title = $project->name . $this->lang->colon . $this->lang->bug->common;
@@ -729,7 +734,7 @@ class project extends control
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$sort = $this->loadModel('common')->appendOrder($orderBy);
$bugs = $this->bug->getProjectBugs($projectID, $build, $type, $param, $sort, '', $pager);
$bugs = $this->bug->getProjectBugs($projectID, $productID, $build, $type, $param, $sort, '', $pager);
$users = $this->user->getPairs('noletter');
/* team member pairs. */
@@ -739,7 +744,7 @@ class project extends control
foreach($teamMembers as $key => $member) $memberPairs[$key] = $member->realname;
/* Build the search form. */
$actionURL = $this->createLink('project', 'bug', "projectID=$projectID&orderBy=$orderBy&build=$build&type=bysearch&queryID=myQueryID");
$actionURL = $this->createLink('project', 'bug', "projectID=$projectID&productID=$productID&orderBy=$orderBy&build=$build&type=bysearch&queryID=myQueryID");
$this->loadModel('execution')->buildBugSearchForm($products, $queryID, $actionURL, 'project');
/* Assign. */
+7 -3
View File
@@ -11,12 +11,16 @@
*/
?>
<?php include '../../common/view/header.html.php';?>
<style>
#subHeader #dropMenu .col-left .list-group {margin-bottom: 0px; padding-top: 10px;}
#subHeader #dropMenu .col-left {padding-bottom: 0px;}
</style>
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<?php
$buildName = $build ? " <span class='label label-danger'>Build:{$build->name}</span>" : '';
echo html::a($this->inlink('bug', "projectID={$project->id}&orderBy=status,id_desc&build=$buildID&type=all"), "<span class='text'>{$lang->bug->allBugs}</span>" . ($type == 'all' ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>$buildName" : ''), '', "id='allTab' class='btn btn-link" . ('all' == $type ? ' btn-active-text' : '') . "'");
echo html::a($this->inlink('bug', "projectID={$project->id}&orderBy=status,id_desc&build=$buildID&type=unresolved"), "<span class='text'>{$lang->bug->unResolved}</span>" . ($type == 'unresolved' ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>$buildName" : ''), '', "id='unresolvedTab' class='btn btn-link" . ('unresolved' == $type ? ' btn-active-text' : '') . "'");
echo html::a($this->inlink('bug', "projectID={$project->id}&productID={$productID}&orderBy=status,id_desc&build=$buildID&type=all"), "<span class='text'>{$lang->bug->allBugs}</span>" . ($type == 'all' ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>$buildName" : ''), '', "id='allTab' class='btn btn-link" . ('all' == $type ? ' btn-active-text' : '') . "'");
echo html::a($this->inlink('bug', "projectID={$project->id}&productID={$productID}&orderBy=status,id_desc&build=$buildID&type=unresolved"), "<span class='text'>{$lang->bug->unResolved}</span>" . ($type == 'unresolved' ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>$buildName" : ''), '', "id='unresolvedTab' class='btn btn-link" . ('unresolved' == $type ? ' btn-active-text' : '') . "'");
?>
<a class="btn btn-link querybox-toggle" id="bysearchTab"><i class="icon icon-search muted"></i> <?php echo $lang->bug->search;?></a>
</div>
@@ -40,7 +44,7 @@
<form class='main-table' method='post' id='projectBugForm' data-ride="table">
<table class='table has-sort-head' id='bugList'>
<?php $canBatchAssignTo = common::hasPriv('bug', 'batchAssignTo');?>
<?php $vars = "projectID={$project->id}&orderBy=%s&build=$buildID&type=$type&param=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<?php $vars = "projectID={$project->id}&productID=$productID&orderBy=%s&build=$buildID&type=$type&param=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<thead>
<tr>
<th class='c-id'>
+1 -1
View File
@@ -1,3 +1,3 @@
<?php
$config->qa->menuList = array('caselib', 'testreport', 'testsuite', 'testtask', 'testcase', 'bug', 'qa', 'automation');
$config->qa->noDropMenuModule = array('qa', 'caselib', 'automation');
$config->qa->noDropMenuModule = array('qa', 'caselib', 'automation', 'testsuite');