Merge branch 'zentaopms_239' into 'zentaopms_239_wangjianhua_70790'

# Conflicts:
#   db/update17.6.1.sql
This commit is contained in:
李玉春
2022-09-29 07:06:53 +00:00
20 changed files with 116 additions and 37 deletions
+1
View File
@@ -2,5 +2,6 @@ ALTER TABLE `zt_product` ADD `shadow` tinyint(1) unsigned NOT NULL AFTER `code`;
ALTER TABLE `zt_project` ADD `hasProduct` tinyint(1) unsigned NOT NULL DEFAULT 1 AFTER `code`;
ALTER TABLE `zt_product` MODIFY `name` varchar(110) NOT NULL;
CREATE OR REPLACE VIEW `ztv_normalproduct` AS SELECT * FROM `zt_product` WHERE `shadow` = 0;
ALTER TABLE `zt_repo` ADD `projects` varchar(255) NOT NULL AFTER `product`;
+1
View File
@@ -487,6 +487,7 @@ CREATE OR REPLACE VIEW `ztv_daytaskfinish` AS select count(*) AS `taskfinish`,le
CREATE OR REPLACE VIEW `ztv_daybugopen` AS select count(*) AS `bugopen`,left(`zt_action`.`date`,10) AS `day` from `zt_action` where ((`zt_action`.`objectType` = 'bug') and (`zt_action`.`action` = 'opened')) group by left(`zt_action`.`date`,10);
CREATE OR REPLACE VIEW `ztv_daybugresolve` AS select count(*) AS `bugresolve`,left(`zt_action`.`date`,10) AS `day` from `zt_action` where ((`zt_action`.`objectType` = 'bug') and (`zt_action`.`action` = 'resolved')) group by left(`zt_action`.`date`,10);
CREATE OR REPLACE VIEW `ztv_dayactions` AS select count(*) AS `actions`,left(`zt_action`.`date`,10) AS `day` from `zt_action` group by left(`zt_action`.`date`,10);
CREATE OR REPLACE VIEW `ztv_normalproduct` AS SELECT * FROM `zt_product` WHERE `shadow` = 0;
REPLACE INTO `zt_report` (`code`, `name`, `module`, `sql`, `vars`, `langs`, `params`, `step`, `desc`, `addedBy`, `addedDate`) VALUES
('product-invest', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u6295\\u5165\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u6295\\u5165\\u8868\",\"en\":\"Product Investment\"}', ',product', 'select t1.id,t1.name,1 as projects, round(t3.consumed,2) as consumed from TABLE_PRODUCT as t1\r\n left join TABLE_PROJECTPRODUCT as t2 on t1.id=t2.product\r\n left join ztv_projectsummary as t3 on t2.project=t3.project\r\n left join TABLE_PROJECT as t4 on t2.project=t4.id\r\n left join TABLE_PROGRAM as t5 on t1.program=t5.id\r\n where t1.deleted=\'0\' and t4.deleted=\'0\' and t4.type=\'project\'\r\norder by t5.`order` asc, t1.line desc, t1.`order` asc', '', '{\"projects\":{\"zh-cn\":\"\\u9879\\u76ee\\u6570\",\"zh-tw\":\"\\u9879\\u76ee\\u6570\",\"en\":\"Projects\"},\"consumed\":{\"zh-cn\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"zh-tw\":\"\\u5df2\\u6d88\\u8017\\u5de5\\u65f6\",\"en\":\"Cost(h)\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"projects\",\"consumed\"],\"reportType\":[\"sum\",\"sum\"],\"sumAppend\":[\"projects\",\"consumed\"]}', 2, '{\"zh-cn\":\"\\u5217\\u51fa\\u6bcf\\u4e2a\\u4ea7\\u54c1\\u7684\\u9879\\u76ee\\u603b\\u6570\\uff0c\\u5df2\\u7ecf\\u6d88\\u8017\\u7684\\u5de5\\u65f6\\u3002\",\"zh-tw\":\"\\u5217\\u51fa\\u6bcf\\u500b\\u7522\\u54c1\\u7684\\u9805\\u76ee\\u7e3d\\u6578\\uff0c\\u5df2\\u7d93\\u6d88\\u8017\\u7684\\u5de5\\u6642\\u3002\",\"en\":\"Number of projects and consumed hours.\"}', 'admin', '2015-07-20 14:21:30'),
+1
View File
@@ -7008,6 +7008,7 @@ CREATE OR REPLACE VIEW `ztv_daytaskfinish` AS select count(*) AS `taskfinish`,le
CREATE OR REPLACE VIEW `ztv_daybugopen` AS select count(*) AS `bugopen`,left(`zt_action`.`date`,10) AS `day` from `zt_action` where ((`zt_action`.`objectType` = 'bug') and (`zt_action`.`action` = 'opened')) group by left(`zt_action`.`date`,10);
CREATE OR REPLACE VIEW `ztv_daybugresolve` AS select count(*) AS `bugresolve`,left(`zt_action`.`date`,10) AS `day` from `zt_action` where ((`zt_action`.`objectType` = 'bug') and (`zt_action`.`action` = 'resolved')) group by left(`zt_action`.`date`,10);
CREATE OR REPLACE VIEW `ztv_dayactions` AS select count(*) AS `actions`,left(`zt_action`.`date`,10) AS `day` from `zt_action` group by left(`zt_action`.`date`,10);
CREATE OR REPLACE VIEW `ztv_normalproduct` AS SELECT * FROM `zt_product` WHERE `shadow` = 0;
REPLACE INTO `zt_report` (`code`, `name`, `module`, `sql`, `vars`, `langs`, `params`, `step`, `desc`, `addedBy`, `addedDate`) VALUES
('product-progress', '{\"zh-cn\":\"\\u4ea7\\u54c1\\u5b8c\\u6210\\u5ea6\\u7edf\\u8ba1\\u8868\",\"zh-tw\":\"\\u7522\\u54c1\\u5b8c\\u6210\\u5ea6\\u7d71\\u8a08\\u8868\",\"en\":\"Product Progress\"}', ',product', 'select t1.*,t2.name, (case when t1.status = \'closed\' or t1.stage = \'released\' then 1 else 0 end) as done, 1 as count from TABLE_STORY as t1 \r\nleft join TABLE_PRODUCT as t2 on t1.product=t2.id \r\nleft join TABLE_PROGRAM as t3 on t2.program=t3.id \r\nwhere t1.deleted=\'0\' and t2.deleted=\'0\'\r\norder by t3.`order` asc, t2.line desc, t2.`order` asc', '', '{\"count\":{\"zh-cn\":\"\\u9700\\u6c42\\u6570\",\"zh-tw\":\"\\u9700\\u6c42\\u6570\",\"en\":\"Stories\"},\"done\":{\"zh-cn\":\"\\u5b8c\\u6210\\u6570\",\"zh-tw\":\"\\u5b8c\\u6210\\u6570\",\"en\":\"Done\"}}', '{\"group1\":\"name\",\"group2\":\"\",\"reportField\":[\"count\",\"done\"],\"reportType\":[\"sum\",\"sum\"],\"sumAppend\":[\"count\",\"done\"],\"percent\":{\"1\":\"1\"},\"contrast\":{\"1\":\"count\"},\"showAlone\":{\"1\":\"1\"}}', 2, '{\"zh-cn\":\"\\u6309\\u7167\\u4ea7\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u603b\\u6570\\uff0c\\u5b8c\\u6210\\u7684\\u603b\\u6570(\\u72b6\\u6001\\u662f\\u5173\\u95ed\\uff0c\\u6216\\u8005\\u7814\\u53d1\\u9636\\u6bb5\\u662f\\u53d1\\u5e03)\\uff0c\\u5b8c\\u6210\\u7684\\u767e\\u5206\\u6bd4\\u3002\",\"zh-tw\":\"\\u6309\\u7167\\u7522\\u54c1\\u5217\\u51fa\\u9700\\u6c42\\u7e3d\\u6578\\uff0c\\u5b8c\\u6210\\u7684\\u7e3d\\u6578(\\u72c0\\u614b\\u662f\\u95dc\\u9589\\uff0c\\u6216\\u8005\\u7814\\u767c\\u968e\\u6bb5\\u662f\\u767c\\u5e03)\\uff0c\\u5b8c\\u6210\\u7684\\u767e\\u5206\\u6bd4\\u3002\",\"en\":\"Number of total stories,done stories(state is closed, or stage is released), percent of completion.\"}', 'admin', '2015-07-21 15:07:48'),
+5
View File
@@ -2328,6 +2328,11 @@ class bug extends control
$product = $this->loadModel('product')->getByID($productID);
if($product->type == 'normal') $this->config->bug->exportFields = str_replace('branch,', '', $this->config->bug->exportFields);
if($this->app->tab == 'project' or $this->app->tab == 'execution')
{
if($product->shadow) $this->config->bug->exportFields = str_replace('product,', '', $this->config->bug->exportFields);
}
$fileName = $this->lang->bug->common;
if($executionID)
{
+1 -1
View File
@@ -3639,7 +3639,7 @@ class bugModel extends model
public function getRelatedObjects($object, $pairs = '')
{
/* Get bugs. */
$bugs = $this->dao->select('*')->from(TABLE_BUG)->where($this->session->bugQueryCondition)->fetchAll('id');
$bugs = $this->loadModel('port')->getQueryDatas('bug');
/* Get related objects id lists. */
$relatedObjectIdList = array();
+11 -3
View File
@@ -983,9 +983,12 @@ class execution extends control
$executionID = $execution->id;
$products = $this->product->getProducts($execution->id);
$hasProduct = $this->dao->findByID($execution->project)->from(TABLE_PROJECT)->fetch('hasProduct');
if($execution->project and !$hasProduct) unset($this->config->bug->search['fields']['product']);
$productPairs = array('0' => $this->lang->product->all);
foreach($products as $productData) $productPairs[$productData->id] = $productData->name;
$this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'execution', 'bug', $executionID, $branch);
if($hasProduct) $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'execution', 'bug', $executionID, $branch);
/* Header and position. */
$title = $execution->name . $this->lang->colon . $this->lang->execution->bug;
@@ -1133,8 +1136,12 @@ class execution extends control
$products = $this->product->getProducts($executionID, 'all', '', false);
if(count($products) == 1) $productID = key($products);
$execution = $this->execution->getByID($executionID);
$hasProduct = $this->dao->findByID($execution->project)->from(TABLE_PROJECT)->fetch('hasProduct');
$extra = $executionID;
$this->lang->modulePageNav = $this->product->select(array('0' => $this->lang->product->all) + $products, $productID, 'execution', 'testcase', $extra, $branchID);
if($hasProduct) $this->lang->modulePageNav = $this->product->select(array('0' => $this->lang->product->all) + $products, $productID, 'execution', 'testcase', $extra, $branchID);
/* Load pager. */
$this->app->loadClass('pager', $static = true);
@@ -1167,7 +1174,7 @@ class execution extends control
$this->view->pager = $pager;
$this->view->type = $type;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->execution = $this->execution->getByID($executionID);
$this->view->execution = $execution;
$this->view->moduleTree = $moduleTree;
$this->view->modules = $modules;
$this->view->moduleID = $moduleID;
@@ -1318,6 +1325,7 @@ class execution extends control
$this->view->position[] = html::a($this->createLink('execution', 'testtask', "executionID=$executionID"), $this->executions[$executionID]);
$this->view->position[] = $this->lang->testtask->common;
$this->view->execution = $execution;
$this->view->project = $this->loadModel('project')->getByID($execution->project);
$this->view->executionID = $executionID;
$this->view->executionName = $this->executions[$executionID];
$this->view->pager = $pager;
+1 -1
View File
@@ -1,7 +1,7 @@
.table-group-btns {width: 200px;}
.table-footer,
.table-grouped {box-shadow: none !important;}
.table-footer {margin-left: 205px; margin-top: 10px;}
.table-footer {margin-top: 10px;}
.table-grouped > thead>tr>th.c-id,
.table-grouped > tbody>tr>td.c-id {padding-left: 15px;}
.table-grouped > tbody>tr>td {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
+1 -1
View File
@@ -347,7 +347,7 @@ class executionModel extends model
->setDefault('openedVersion', $this->config->version)
->setDefault('lastEditedBy', $this->app->user->account)
->setDefault('lastEditedDate', helper::now())
->setDefault('team', substr($this->post->name, 0, 30))
->setDefault('team', $this->post->name)
->setIF($this->post->heightType == 'auto', 'displayCards', 0)
->setIF(!isset($_POST['whitelist']), 'whitelist', '')
->setIF($this->config->systemMode == 'new', 'parent', $this->post->project)
+8 -4
View File
@@ -12,9 +12,13 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('confirmDelete', $lang->testtask->confirmDelete)?>
<?php $hideProduct = (isset($project->hasProduct) and $project->hasProduct == '0');?>
<?php if(!$hideProduct):?>
<style>.table-footer {margin-left: 205px}</style>
<?php endif;?>
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<?php if(!empty($tasks)):?>
<?php if(!empty($tasks) and !$hideProduct):?>
<div class="pull-left table-group-btns">
<button type="button" class="btn btn-link group-collapse-all"><?php echo $lang->testtask->collapseAll;?> <i class="icon-fold-all muted"></i></button>
<button type="button" class="btn btn-link group-expand-all"><?php echo $lang->testtask->expandAll;?> <i class="icon-unfold-all muted"></i></button>
@@ -49,8 +53,8 @@
<thead>
<?php $vars = "executionID=$executionID&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<?php $canTestReport = ($canBeChanged and common::hasPriv('testreport', 'browse'));?>
<tr class='<?php if($total) echo 'divider'; ?>'>
<th class='c-side text-center'><?php common::printOrderLink('product', $orderBy, $vars, $lang->testtask->product);?></th>
<tr class='<?php if($total and !$hideProduct) echo 'divider'; ?>'>
<th class='c-side text-center <?php if($hideProduct) echo 'hide';?>'><?php common::printOrderLink('product', $orderBy, $vars, $lang->testtask->product);?></th>
<th class="c-id">
<?php if($canTestReport):?>
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
@@ -74,7 +78,7 @@
<?php foreach($productTasks as $task):?>
<tr data-id='<?php echo $product;?>' <?php if($task == reset($productTasks)) echo "class='divider-top'";?>>
<?php if($task == reset($productTasks)):?>
<td rowspan='<?php echo count($productTasks);?>' class='c-side text-left group-toggle'>
<td rowspan='<?php echo count($productTasks);?>' class='c-side text-left group-toggle <?php if($hideProduct) echo 'hide';?>'>
<a class='text-primary' title='<?php echo $productName;?>'><i class='icon icon-caret-down'></i> <?php echo $productName;?></a>
<div class='small'><span class='text-muted'><?php echo $lang->testtask->allTasks;?></span> <?php echo count($productTasks);?></div>
</td>
+17
View File
@@ -469,6 +469,23 @@ class groupModel extends model
{
$actions = $this->post->actions;
$oldGroup = $this->getByID($groupID);
$projects = isset($actions['projects']) ? $actions['projects'] : array();
$sprints = isset($actions['sprints']) ? $actions['sprints'] : array();
/* Add shadow productID when select noProduct project or execution. */
if($projects or $sprints)
{
/* Get all noProduct projects and executions . */
$noProductList = $this->loadModel('project')->getNoProductList();
$shadowProductIDList = $this->dao->select('id')->from(TABLE_PRODUCT)->where('shadow')->eq(1)->fetchPairs();
$noProductObjects = array_merge($projects, $sprints);
foreach($noProductObjects as $objectID)
{
if(isset($noProductList[$objectID])) $actions['products'][] = $noProductList[$objectID]->product;
}
}
if(isset($_POST['allchecker']))$actions['views'] = array();
if(!isset($actions['actions']))$actions['actions'] = array();
+15 -2
View File
@@ -1195,9 +1195,22 @@ class kanban extends control
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$productPairs = $this->product->getPairs();
$productPairs = $this->product->getPairs('', 0, '', 'all');
$selectedProductID = empty($selectedProductID) ? key($productPairs) : $selectedProductID;
/* Waterfall project has no plan. */
$waterfallProducts = $this->dao->select('t1.product')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t2.type')->eq('project')
->andWhere('t2.model')->eq('waterfall')
->andWhere('t2.hasProduct')->eq('0')
->fetchPairs();
foreach($productPairs as $id => $name)
{
if(isset($waterfallProducts[$id])) unset($productPairs[$id]);
}
$this->view->products = $productPairs;
$this->view->selectedProductID = $selectedProductID;
$this->view->lanePairs = $this->kanban->getLanePairsByGroup($groupID);
@@ -1247,7 +1260,7 @@ class kanban extends control
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$this->view->products = array($this->lang->kanban->allProducts) + $this->product->getPairs();
$this->view->products = array($this->lang->kanban->allProducts) + $this->product->getPairs('', 0, '', 'all');
$this->view->selectedProductID = $selectedProductID;
$this->view->lanePairs = $this->kanban->getLanePairsByGroup($groupID);
$this->view->releases2Imported = $this->release->getList($selectedProductID, 'all', 'all', 't1.date_desc', $pager);
+1
View File
@@ -169,6 +169,7 @@ class port extends control
{
$product = $this->loadModel('product')->getByID($this->session->bugPortParams['productID']);
if($product->type == 'normal') unset($fields['branch']);
if($product->shadow and ($this->app->tab == 'execution' or $this->app->tab == 'project')) unset($fields['product']);
}
if($model == 'task') $datas = $this->task->processDatas4Task($datas);
$html = $this->port->buildNextList($datas->datas, $lastID, $fields, $pagerID, $model);
+3 -3
View File
@@ -1406,7 +1406,7 @@ class productModel extends model
public function getAllExecutionPairsByProduct($productID, $branch = 0, $projectID = 0)
{
if(empty($productID)) return array();
$executions = $this->dao->select('t2.id,t2.project,t2.name,t2.grade,t2.parent,t2.hasProduct')->from(TABLE_PROJECTPRODUCT)->alias('t1')
$executions = $this->dao->select('t2.id,t2.project,t2.name,t2.grade,t2.parent')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t1.product')->eq($productID)
->andWhere('t2.type')->in('stage,sprint,kanban')
@@ -1426,7 +1426,7 @@ class productModel extends model
{
if($execution->grade == 2 && isset($executions[$execution->parent]))
{
$execution->name = ($execution->hasProduct ? $projectPairs[$execution->project] . '/' : '') . $executions[$execution->parent]->name . '/' . $execution->name;
$execution->name = $projectPairs[$execution->project] . '/' . $executions[$execution->parent]->name . '/' . $execution->name;
$executions[$execution->parent]->children[$id] = $execution->name;
unset($executions[$id]);
}
@@ -1439,7 +1439,7 @@ class productModel extends model
$executionPairs = $executionPairs + $execution->children;
continue;
}
if($this->config->systemMode == 'new' and isset($projectPairs[$execution->project])) $executionPairs[$execution->id] = ($execution->hasProduct ? $projectPairs[$execution->project] . '/' : '') . $execution->name;
if($this->config->systemMode == 'new' and isset($projectPairs[$execution->project])) $executionPairs[$execution->id] = $projectPairs[$execution->project] . '/' . $execution->name;
if($this->config->systemMode == 'classic') $executionPairs[$execution->id] = $execution->name;
}
+3 -2
View File
@@ -66,10 +66,11 @@ class programModel extends model
* @param string $mode all|assign
* @param string $status all|noclosed
* @param string|array $append
* @param string|int $shadow all | 0 | 1
* @access public
* @return array
*/
public function getProductPairs($programID = 0, $mode = 'assign', $status = 'all', $append = '')
public function getProductPairs($programID = 0, $mode = 'assign', $status = 'all', $append = '', $shadow = 0)
{
/* Get the top programID. */
if($programID)
@@ -86,8 +87,8 @@ class programModel extends model
$views = empty($append) ? $this->app->user->view->products : $this->app->user->view->products . ",$append";
$products = $this->dao->select('*')->from(TABLE_PRODUCT)
->where('deleted')->eq(0)
->andWhere('shadow')->eq(0)
->andWhere('vision')->eq($this->config->vision)
->beginIF($shadow !== 'all')->andWhere('shadow')->eq((int)$shadow)->fi()
->beginIF($mode == 'assign')->andWhere('program')->eq($programID)->fi()
->beginIF(strpos($status, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi()
->beginIF(!$this->app->user->admin)->andWhere('id')->in($views)->fi()
+12 -4
View File
@@ -529,6 +529,7 @@ class project extends control
$products = array();
$productPlans = array();
$shadow = 0;
$parentProgram = $this->loadModel('program')->getByID($programID);
if($copyProjectID)
@@ -543,8 +544,9 @@ class project extends control
$programID = $copyProject->parent;
$model = $copyProject->model;
$hasProduct = $copyProject->hasProduct;
$products = $this->product->getProducts($copyProjectID);
$products = $this->product->getProducts($copyProjectID);
if(!$copyProject->hasProduct) $shadow = 1;
foreach($products as $product)
{
foreach($product->branches as $branch)
@@ -573,7 +575,7 @@ class project extends control
$this->view->users = $this->user->getPairs('noclosed|nodeleted');
$this->view->copyProjects = $this->project->getPairsByModel($model);
$this->view->products = $products;
$this->view->allProducts = array('0' => '') + $this->program->getProductPairs($programID, 'assign', 'noclosed');
$this->view->allProducts = array('0' => '') + $this->program->getProductPairs($programID, 'assign', 'noclosed', '', $shadow);
$this->view->productPlans = array('0' => '') + $productPlans;
$this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noclosed');
$this->view->programID = $programID;
@@ -1107,9 +1109,13 @@ class project extends control
$queryID = ($type == 'bysearch') ? (int)$param : 0;
$products = $this->product->getProducts($projectID);
if(!$project->hasProduct) unset($this->config->bug->search['fields']['product']);
$productPairs = array('0' => $this->lang->product->all);
foreach($products as $productData) $productPairs[$productData->id] = $productData->name;
$this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'project', 'bug', $projectID, $branchID);
$hasProduct = $this->dao->findByID($projectID)->from(TABLE_PROJECT)->fetch('hasProduct');
if($hasProduct) $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'project', 'bug', $projectID, $branchID);
/* Header and position. */
$title = $project->name . $this->lang->colon . $this->lang->bug->common;
@@ -1247,7 +1253,9 @@ class project extends control
$products = array('0' => $this->lang->product->all) + $this->product->getProducts($projectID, 'all', '', false);
$extra = "$projectID,$browseType";
$this->lang->modulePageNav = $this->product->select($products, $productID, 'project', 'testcase', $extra, $branch);
$hasProduct = $this->dao->findByID($projectID)->from(TABLE_PROJECT)->fetch('hasProduct');
if($hasProduct) $this->lang->modulePageNav = $this->product->select($products, $productID, 'project', 'testcase', $extra, $branch);
echo $this->fetch('testcase', 'browse', "productID=$productID&branch=$branch&browseType=$browseType&param=$param&orderBy=$orderBy&recTotal=$orderBy&recPerPage=$recPerPage&pageID=$pageID&projectID=$projectID");
}
+1 -1
View File
@@ -1,7 +1,7 @@
.table-group-btns {width: 200px;}
.table-footer,
.table-grouped {box-shadow: none !important;}
.table-footer {margin-left: 205px; margin-top: 10px;}
.table-footer {margin-top: 10px;}
.table-grouped > thead>tr>th.c-id,
.table-grouped > tbody>tr>td.c-id {padding-left: 15px;}
.table-grouped > tbody>tr>td {overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
+17
View File
@@ -173,6 +173,23 @@ class projectModel extends model
return $project;
}
/**
* Get a project by its shadow product.
*
* @param int $product
* @access public
* @return object
*/
public function getByShadowProduct($product)
{
return $this->dao->select('t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')
->where('t1.product')->eq($product)
->andWhere('t2.type')->eq('project')
->limit(1)
->fetch();
}
/**
* Get project info.
*
+7 -4
View File
@@ -12,9 +12,12 @@
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('confirmDelete', $lang->testtask->confirmDelete)?>
<?php if($project->hasProduct):?>
<style>.tfoot {margin-left: 205px}</style>
<?php endif;?>
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<?php if(!empty($tasks)):?>
<?php if(!empty($tasks) and $project->hasProduct):?>
<div class="pull-left table-group-btns">
<button type="button" class="btn btn-link group-collapse-all"><?php echo $lang->testtask->collapseAll;?> <i class="icon-fold-all muted"></i></button>
<button type="button" class="btn btn-link group-expand-all"><?php echo $lang->testtask->expandAll;?> <i class="icon-unfold-all muted"></i></button>
@@ -49,8 +52,8 @@
<thead>
<?php $vars = "projectID=$projectID&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<?php $canTestReport = ($canBeChanged and common::hasPriv('testreport', 'browse'));?>
<tr class='<?php if($total) echo 'divider'; ?>'>
<th class='c-side text-center'><?php common::printOrderLink('product', $orderBy, $vars, $lang->testtask->product);?></th>
<tr class='<?php if($total and $project->hasProduct) echo 'divider'; ?>'>
<th class='c-side text-center <?php if(!$project->hasProduct) echo 'hide';?>'><?php common::printOrderLink('product', $orderBy, $vars, $lang->testtask->product);?></th>
<th class="c-id">
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
</th>
@@ -69,7 +72,7 @@
<?php foreach($productTasks as $task):?>
<tr data-id='<?php echo $product;?>' <?php if($task == reset($productTasks)) echo "class='divider-top'";?>>
<?php if($task == reset($productTasks)):?>
<td rowspan='<?php echo count($productTasks);?>' class='c-side text-left group-toggle'>
<td rowspan='<?php echo count($productTasks);?>' class='c-side text-left group-toggle <?php if(!$project->hasProduct) echo 'hide';?>'>
<a class='text-primary' title='<?php echo $productName;?>'><i class='icon icon-caret-down'></i> <?php echo $productName;?></a>
<div class='small'><span class='text-muted'><?php echo $lang->testtask->allTasks;?></span> <?php echo count($productTasks);?></div>
</td>
+6 -11
View File
@@ -864,19 +864,14 @@ class story extends control
$this->view->hiddenURS = false;
$this->view->teamUsers = array();
if($this->app->tab === 'project' || $this->app->tab === 'execution')
if($product->shadow)
{
$project = $this->dao->findById((int)$objectID)->from(TABLE_PROJECT)->fetch();
if(!empty($project->project)) $project = $this->dao->findById((int)$project->project)->from(TABLE_PROJECT)->fetch();
$project = $this->project->getByShadowProduct($product->id);
$this->view->teamUsers = $this->project->getTeamMemberPairs($project->id);
$this->view->hiddenProduct = true;
if(empty($project->hasProduct))
{
$this->view->teamUsers = $this->project->getTeamMemberPairs($project->id);
$this->view->hiddenProduct = true;
if($project->model !== 'scrum') $this->view->hiddenPlan = true;
if($project->model === 'kanban') $this->view->hiddenURS = true;
}
if($project->model !== 'scrum') $this->view->hiddenPlan = true;
if($project->model === 'kanban') $this->view->hiddenURS = true;
}
/* Display status of branch. */
+4
View File
@@ -118,6 +118,8 @@ class testcase extends control
$linkedProducts = $this->product->getProducts($projectID, 'all', '', false);
$this->products = count($linkedProducts) > 1 ? array('0' => $this->lang->product->all) + $linkedProducts : $linkedProducts;
$productID = count($linkedProducts) > 1 ? $productID : key($linkedProducts);
$hasProduct = $this->dao->findById($projectID)->from(TABLE_PROJECT)->fetch('hasProduct');
if(!$hasProduct) unset($this->config->testcase->search['fields']['product']);
$this->loadModel('project')->setMenu($projectID);
}
@@ -1596,6 +1598,8 @@ class testcase extends control
$product = $this->loadModel('product')->getById($productID);
$products = $this->loadModel('product')->getPairs('', 0, '', 'all');
if($product->type != 'normal') $this->lang->testcase->branch = $this->lang->product->branchName[$product->type];
if($product->shadow and $this->app->tab == 'project') $this->config->testcase->exportFields = str_replace('product,', '', $this->config->testcase->exportFields);
if($_POST)
{
$this->loadModel('file');