Merge branch 'zentaopms_239' into 'zentaopms_239_wangjianhua_70793'
# Conflicts: # module/project/lang/de.php # module/project/lang/en.php # module/project/lang/fr.php # module/project/lang/zh-cn.php
This commit is contained in:
+12
-1
@@ -1783,9 +1783,20 @@ class actionModel extends model
|
||||
}
|
||||
elseif(in_array($action->objectType, array('program', 'project', 'execution')))
|
||||
{
|
||||
$project = $this->dao->select('id,acl')->from(TABLE_PROJECT)->where('id')->eq($action->objectID)->fetch();
|
||||
$project = $this->dao->select('id,acl,name,hasProduct')->from(TABLE_PROJECT)->where('id')->eq($action->objectID)->fetch();
|
||||
$objecttype = $action->objectType == 'execution' ? 'sprint' : $action->objectType;
|
||||
if($project->acl != 'open') $this->loadModel('user')->updateUserView($project->id, $objecttype);
|
||||
|
||||
/* Reduction shadow product. */
|
||||
if(!$project->hasProduct and $action->objectType == 'project')
|
||||
{
|
||||
$productID = $this->loadModel('product')->getProductIDByProject($project->id);;
|
||||
$this->dao->update(TABLE_PRODUCT)
|
||||
->set('name')->eq($project->name)
|
||||
->set('deleted')->eq(0)
|
||||
->where('id')->eq($productID)
|
||||
->exec();
|
||||
}
|
||||
}
|
||||
elseif($action->objectType == 'module')
|
||||
{
|
||||
|
||||
@@ -856,13 +856,32 @@ class block extends control
|
||||
$productIdList = array();
|
||||
foreach($productStats as $product) $productIdList[] = $product->id;
|
||||
|
||||
$this->view->executions = $this->dao->select('t1.product,t2.name')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
$this->app->loadLang('project');
|
||||
$executions = $this->dao->select('t1.product,t2.id,t2.project,t2.name,t2.multiple')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project=t2.id')
|
||||
->where('t1.product')->in($productIdList)
|
||||
->andWhere('t2.type')->in('stage,sprint')
|
||||
->andWhere('t2.deleted')->eq(0)
|
||||
->orderBy('t1.project')
|
||||
->fetchPairs('product', 'name');
|
||||
->fetchAll('product');
|
||||
|
||||
$executionPairs = array();
|
||||
$noMultiples = array();
|
||||
foreach($executions as $execution)
|
||||
{
|
||||
if(empty($execution->multiple)) $noMultiples[$execution->product] = $execution->project;
|
||||
$executionPairs[$execution->product] = $execution->name;
|
||||
}
|
||||
if($noMultiples)
|
||||
{
|
||||
$noMultipleProjects = $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->in($noMultiples)->fetchPairs('id', 'name');
|
||||
foreach($noMultiples as $productID => $projectID)
|
||||
{
|
||||
if(isset($noMultipleProjects[$projectID])) $executionPairs[$productID] = $noMultipleProjects[$projectID] . "({$this->lang->project->disableExecution})";
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->executions = $executionPairs;
|
||||
$this->view->productStats = $productStats;
|
||||
}
|
||||
|
||||
@@ -1649,6 +1668,7 @@ class block extends control
|
||||
$total = 0;
|
||||
foreach($executions as $execution)
|
||||
{
|
||||
if(empty($execution->multiple)) continue;
|
||||
if(!isset($overview[$execution->status])) $overview[$execution->status] = 0;
|
||||
$overview[$execution->status]++;
|
||||
$total++;
|
||||
|
||||
@@ -197,7 +197,7 @@ $(function()
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if(!empty($project->executions)):?>
|
||||
<?php if(!empty($project->executions) and $project->multiple):?>
|
||||
<div class="table-row project-info">
|
||||
<div class="col-2 text-right"><h4><?php echo $lang->block->last;?></h4></div>
|
||||
<div class="table-row lastIteration">
|
||||
@@ -259,7 +259,7 @@ $(function()
|
||||
<div class="col-1-5"><?php echo $project->cv;?></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
|
||||
+24
-33
@@ -320,10 +320,6 @@ class bug extends control
|
||||
parse_str($extras, $output);
|
||||
$from = isset($output['from']) ? $output['from'] : '';
|
||||
|
||||
$project = new stdclass();
|
||||
|
||||
$productInfo = $this->product->getById($productID);
|
||||
$hiddenProduct = false;
|
||||
if($this->app->tab == 'execution')
|
||||
{
|
||||
if(isset($output['executionID'])) $this->loadModel('execution')->setMenu($output['executionID']);
|
||||
@@ -342,30 +338,17 @@ class bug extends control
|
||||
$this->view->regionPairs = $regionPairs;
|
||||
$this->view->lanePairs = $lanePairs;
|
||||
}
|
||||
|
||||
$projectID = $execution->project;
|
||||
$project = $this->loadModel('project')->getByID($projectID);
|
||||
$hiddenProduct = empty($project->hasProduct);
|
||||
}
|
||||
else if($this->app->tab == 'project')
|
||||
{
|
||||
if(isset($output['projectID']))
|
||||
{
|
||||
$this->loadModel('project')->setMenu($output['projectID']);
|
||||
|
||||
/* Replace language. */
|
||||
$project = $this->project->getByID($output['projectID']);
|
||||
if(!empty($project->model) and $project->model == 'waterfall')
|
||||
{
|
||||
$this->lang->bug->execution = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->bug->execution);
|
||||
}
|
||||
$hiddenProduct = empty($project->hasProduct);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->qa->setMenu($this->products, $productID, $branch);
|
||||
$hiddenProduct = $productInfo->shadow;
|
||||
}
|
||||
|
||||
$this->view->users = $this->user->getPairs('devfirst|noclosed|nodeleted');
|
||||
@@ -484,7 +467,8 @@ class bug extends control
|
||||
}
|
||||
|
||||
/* Get product, then set menu. */
|
||||
$productID = $this->product->saveState($productID, $this->products);
|
||||
$productID = $this->product->saveState($productID, $this->products);
|
||||
$currentProduct = $this->product->getById($productID);
|
||||
|
||||
if($branch === '') $branch = (int)$this->cookie->preBranch;
|
||||
|
||||
@@ -561,13 +545,13 @@ class bug extends control
|
||||
if($this->app->tab == 'execution' or $this->app->tab == 'project')
|
||||
{
|
||||
$objectID = $this->app->tab == 'project' ? $projectID : $executionID;
|
||||
$productBranches = $productInfo->type != 'normal' ? $this->loadModel('execution')->getBranchByProduct($productID, $objectID, 'noclosed|withMain') : array();
|
||||
$productBranches = $currentProduct->type != 'normal' ? $this->loadModel('execution')->getBranchByProduct($productID, $objectID, 'noclosed|withMain') : array();
|
||||
$branches = isset($productBranches[$productID]) ? $productBranches[$productID] : array();
|
||||
$branch = key($branches);
|
||||
}
|
||||
else
|
||||
{
|
||||
$branches = $productInfo->type != 'normal' ? $this->loadModel('branch')->getPairs($productID, 'active') : array();
|
||||
$branches = $currentProduct->type != 'normal' ? $this->loadModel('branch')->getPairs($productID, 'active') : array();
|
||||
}
|
||||
|
||||
/* If executionID is setted, get builds and stories of this execution. */
|
||||
@@ -601,12 +585,6 @@ class bug extends control
|
||||
$products = array();
|
||||
$linkedProducts = $this->loadModel('product')->getProducts($executionID);
|
||||
foreach($linkedProducts as $product) $products[$product->id] = $product->name;
|
||||
|
||||
if($projectID)
|
||||
{
|
||||
$project = $this->loadModel('project')->getByID($projectID);
|
||||
if(empty($bugID) or $this->app->tab != 'qa') $projects += array($projectID => $project->name);
|
||||
}
|
||||
}
|
||||
elseif($projectID)
|
||||
{
|
||||
@@ -614,9 +592,6 @@ class bug extends control
|
||||
$productList = $this->config->CRProduct ? $this->product->getOrderedProducts('all', 40, $projectID) : $this->product->getOrderedProducts('normal', 40, $projectID);
|
||||
foreach($productList as $product) $products[$product->id] = $product->name;
|
||||
|
||||
$project = $this->loadModel('project')->getByID($projectID);
|
||||
if(empty($bugID) or $this->app->tab != 'qa') $projects += array($projectID => $project->name);
|
||||
|
||||
/* Set project menu. */
|
||||
if($this->app->tab == 'project') $this->project->setMenu($projectID);
|
||||
}
|
||||
@@ -625,6 +600,21 @@ class bug extends control
|
||||
$projects += $this->product->getProjectPairsByProduct($productID, $branch);
|
||||
}
|
||||
|
||||
$projectModel = '';
|
||||
if($projectID)
|
||||
{
|
||||
$project = $this->loadModel('project')->getByID($projectID);
|
||||
if($project)
|
||||
{
|
||||
if(empty($bugID) or $this->app->tab != 'qa') $projects += array($projectID => $project->name);
|
||||
|
||||
/* Replace language. */
|
||||
if(!empty($project->model) and $project->model == 'waterfall') $this->lang->bug->execution = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->bug->execution);
|
||||
|
||||
$projectModel = $project->model;
|
||||
}
|
||||
}
|
||||
|
||||
/* Link all projects to product when copying bug under qa.*/
|
||||
if(!empty($bugID) and $this->app->tab == 'qa') $projects += $this->product->getProjectPairsByProduct($productID, $branch);
|
||||
|
||||
@@ -660,11 +650,11 @@ class bug extends control
|
||||
$this->view->moduleOptionMenu = $moduleOptionMenu;
|
||||
$this->view->stories = $stories;
|
||||
$this->view->projects = defined('TUTORIAL') ? $this->loadModel('tutorial')->getProjectPairs() : $projects;
|
||||
$this->view->project = $project;
|
||||
$this->view->executions = defined('TUTORIAL') ? $this->loadModel('tutorial')->getExecutionPairs() : $executions;
|
||||
$this->view->builds = $builds;
|
||||
$this->view->moduleID = (int)$moduleID;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->projectModel = $projectModel;
|
||||
$this->view->executionID = $executionID;
|
||||
$this->view->taskID = $taskID;
|
||||
$this->view->storyID = $storyID;
|
||||
@@ -685,8 +675,7 @@ class bug extends control
|
||||
$this->view->keywords = $keywords;
|
||||
$this->view->severity = $severity;
|
||||
$this->view->type = $type;
|
||||
$this->view->productInfo = $productInfo;
|
||||
$this->view->hiddenProduct = $hiddenProduct;
|
||||
$this->view->product = $currentProduct;
|
||||
$this->view->branch = $branch;
|
||||
$this->view->branches = $branches;
|
||||
$this->view->blockID = $blockID;
|
||||
@@ -833,6 +822,8 @@ class bug extends control
|
||||
}
|
||||
|
||||
$projectID = $this->lang->navGroup->bug == 'project' ? $this->session->project : (isset($execution) ? $execution->project : 0);
|
||||
$project = $this->loadModel('project')->getByID($projectID);
|
||||
if(isset($project->model) && $project->model == 'kanban') $customFields['execution'] = $this->lang->bug->kanban;
|
||||
|
||||
/* Get branches. */
|
||||
if($executionID)
|
||||
@@ -853,7 +844,7 @@ class bug extends control
|
||||
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]);
|
||||
$this->view->position[] = $this->lang->bug->batchCreate;
|
||||
|
||||
$this->view->project = $this->loadModel('project')->getByID($projectID);
|
||||
$this->view->project = $project;
|
||||
$this->view->product = $product;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->stories = $stories;
|
||||
|
||||
@@ -3609,7 +3609,8 @@ class bugModel extends model
|
||||
if($type == 'view') $menu .= $this->buildMenu('bug', 'activate', $params, $bug, $type, '', '', "text-success iframe showinonlybody", true);
|
||||
if($type == 'view' && $this->app->tab != 'product')
|
||||
{
|
||||
$menu .= $this->buildMenu('bug', 'toStory', $toStoryParams, $bug, $type, $this->lang->icons['story'], '', '', '', "data-app='product' id='tostory'", $this->lang->bug->toStory);
|
||||
$tab = $this->app->tab == 'qa' ? 'product' : $this->app->tab;
|
||||
$menu .= $this->buildMenu('bug', 'toStory', $toStoryParams, $bug, $type, $this->lang->icons['story'], '', '', '', "data-app='$tab' id='tostory'", $this->lang->bug->toStory);
|
||||
if(common::hasPriv('task', 'create') and !isonlybody()) $menu .= html::a('#toTask', "<i class='icon icon-check'></i><span class='text'>{$this->lang->bug->toTask}</span>", '', "data-app='qa' data-toggle='modal' class='btn btn-link'");
|
||||
$menu .= $this->buildMenu('bug', 'createCase', $convertParams, $bug, $type, 'sitemap');
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ foreach(explode(',', $config->bug->create->requiredFields) as $field)
|
||||
<th class='c-branch<?php echo zget($visibleFields, $product->type, ' hidden')?> branchBox'> <?php echo $lang->product->branch;?></th>
|
||||
<th class='c-module<?php echo zget($requiredFields, 'module', '', ' required');?>'> <?php echo $lang->bug->module;?></th>
|
||||
<?php if($config->systemMode == 'new'):?>
|
||||
<th class='c-project<?php echo zget($visibleFields, 'project', ' hidden') . zget($requiredFields, 'project', '', ' required');?> projectBox'><?php echo (isset($project->model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->project;?></th>
|
||||
<th class='c-project<?php echo zget($visibleFields, 'project', ' hidden') . zget($requiredFields, 'project', '', ' required');?> projectBox'><?php echo $lang->bug->project;?></th>
|
||||
<?php endif;?>
|
||||
<th class='c-execution<?php echo zget($visibleFields, 'execution', ' hidden') . zget($requiredFields, 'execution', '', ' required');?> executionBox'><?php echo (isset($project->model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->execution;?></th>
|
||||
<th class='c-build required'><?php echo $lang->bug->openedBuild;?></th>
|
||||
|
||||
@@ -51,18 +51,18 @@ if($this->app->tab == 'project') js::set('objectID', $projectID);
|
||||
<table class="table table-form">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class='w-110px'><?php echo $hiddenProduct ? $lang->bug->module : $lang->bug->product;?></th>
|
||||
<td class="<?php if($hiddenProduct) echo 'hidden';?>">
|
||||
<th class='w-110px'><?php echo $product->shadow ? $lang->bug->module : $lang->bug->product;?></th>
|
||||
<td class="<?php if($product->shadow) echo 'hidden';?>">
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('product', $products, $productID, "onchange='loadAll(this.value);' class='form-control chosen control-product'");?>
|
||||
<?php if($productInfo->type != 'normal' and isset($products[$productID])):?>
|
||||
<?php if($product->type != 'normal' and isset($products[$productID])):?>
|
||||
<?php echo html::select('branch', $branches, $branch, "onchange='loadBranch()' class='form-control chosen control-branch'");?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class='input-group' id='moduleIdBox'>
|
||||
<?php if(!$hiddenProduct):?>
|
||||
<?php if(!$product->shadow):?>
|
||||
<span class="input-group-addon"><?php echo $lang->bug->module?></span>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
@@ -118,7 +118,7 @@ if($this->app->tab == 'project') js::set('objectID', $projectID);
|
||||
</div>
|
||||
<div class='table-col'>
|
||||
<div class='input-group' id='executionIdBox'>
|
||||
<span class='input-group-addon fix-border' id='executionBox'><?php echo (isset($project->model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->execution;?></span>
|
||||
<span class='input-group-addon fix-border' id='executionBox'><?php echo $projectModel == 'kanban' ? $lang->bug->kanban : $lang->bug->execution;?></span>
|
||||
<?php echo html::select('execution', $executions, $executionID, "class='form-control chosen' onchange='loadExecutionRelated(this.value)'");?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -384,7 +384,7 @@ if($this->app->tab == 'project') js::set('objectID', $projectID);
|
||||
</div>
|
||||
</div>
|
||||
<?php js::set('bugModule', $lang->bug->module);?>
|
||||
<?php js::set('bugExecution', (isset($project->model) and $project->model == 'kanban') ? $lang->bug->kanban : $lang->bug->execution);?>
|
||||
<?php js::set('bugExecution', $projectModel == 'kanban' ? $lang->bug->kanban : $lang->bug->execution);?>
|
||||
<?php js::set('systemMode', $config->systemMode);?>
|
||||
<script>
|
||||
$(function(){parent.$('body.hide-modal-close').removeClass('hide-modal-close');})
|
||||
|
||||
@@ -100,8 +100,9 @@ $lang->custom->object['testtask'] = 'Build';
|
||||
$lang->custom->object['todo'] = 'Todo';
|
||||
$lang->custom->object['user'] = 'User';
|
||||
$lang->custom->object['block'] = 'ClosedBlock';
|
||||
$lang->custom->object['flow'] = '流程';
|
||||
$lang->custom->object['score'] = '积分';
|
||||
$lang->custom->object['flow'] = 'Flow';
|
||||
$lang->custom->object['score'] = 'Score';
|
||||
$lang->custom->object['mode'] = 'Mode';
|
||||
|
||||
$lang->custom->menuOrder[5] = 'project';
|
||||
$lang->custom->menuOrder[10] = 'product';
|
||||
@@ -117,9 +118,10 @@ $lang->custom->menuOrder[55] = 'user';
|
||||
$lang->custom->menuOrder[60] = 'block';
|
||||
$lang->custom->menuOrder[65] = 'flow';
|
||||
$lang->custom->menuOrder[70] = 'score';
|
||||
$lang->custom->menuOrder[85] = 'mode';
|
||||
|
||||
$lang->custom->dividerMenu = ',story,todo,block,';
|
||||
$lang->custom->separatePage = ',execution,product,kanban,flow,score,';
|
||||
$lang->custom->separatePage = ',execution,product,kanban,flow,score,mode,';
|
||||
|
||||
$lang->custom->block = new stdclass();
|
||||
$lang->custom->block->fields['closed'] = 'Closed Block';
|
||||
|
||||
@@ -100,8 +100,9 @@ $lang->custom->object['testtask'] = 'Request';
|
||||
$lang->custom->object['todo'] = 'Todo';
|
||||
$lang->custom->object['user'] = 'User';
|
||||
$lang->custom->object['block'] = 'Block';
|
||||
$lang->custom->object['flow'] = '流程';
|
||||
$lang->custom->object['score'] = '积分';
|
||||
$lang->custom->object['flow'] = 'Flow';
|
||||
$lang->custom->object['score'] = 'Score';
|
||||
$lang->custom->object['mode'] = 'Mode';
|
||||
|
||||
$lang->custom->menuOrder[5] = 'project';
|
||||
$lang->custom->menuOrder[10] = 'product';
|
||||
@@ -117,9 +118,10 @@ $lang->custom->menuOrder[55] = 'user';
|
||||
$lang->custom->menuOrder[60] = 'block';
|
||||
$lang->custom->menuOrder[65] = 'flow';
|
||||
$lang->custom->menuOrder[70] = 'score';
|
||||
$lang->custom->menuOrder[85] = 'mode';
|
||||
|
||||
$lang->custom->dividerMenu = ',story,todo,block,';
|
||||
$lang->custom->separatePage = ',execution,product,kanban,flow,score,';
|
||||
$lang->custom->separatePage = ',execution,product,kanban,flow,score,mode,';
|
||||
|
||||
$lang->custom->block = new stdclass();
|
||||
$lang->custom->block->fields['closed'] = 'Closed Block';
|
||||
|
||||
@@ -100,8 +100,9 @@ $lang->custom->object['testtask'] = 'Build';
|
||||
$lang->custom->object['todo'] = 'Agenda';
|
||||
$lang->custom->object['user'] = 'Utilisateur';
|
||||
$lang->custom->object['block'] = 'Bloc';
|
||||
$lang->custom->object['flow'] = '流程';
|
||||
$lang->custom->object['score'] = '积分';
|
||||
$lang->custom->object['flow'] = 'Flow';
|
||||
$lang->custom->object['score'] = 'Score';
|
||||
$lang->custom->object['mode'] = 'Mode';
|
||||
|
||||
$lang->custom->menuOrder[5] = 'project';
|
||||
$lang->custom->menuOrder[10] = 'product';
|
||||
@@ -117,9 +118,10 @@ $lang->custom->menuOrder[55] = 'user';
|
||||
$lang->custom->menuOrder[60] = 'block';
|
||||
$lang->custom->menuOrder[65] = 'flow';
|
||||
$lang->custom->menuOrder[70] = 'score';
|
||||
$lang->custom->menuOrder[85] = 'mode';
|
||||
|
||||
$lang->custom->dividerMenu = ',story,todo,block,';
|
||||
$lang->custom->separatePage = ',execution,product,kanban,flow,score,';
|
||||
$lang->custom->separatePage = ',execution,product,kanban,flow,score,mode,';
|
||||
|
||||
$lang->custom->block = new stdclass();
|
||||
$lang->custom->block->fields['closed'] = 'Bloc Fermé';
|
||||
|
||||
@@ -102,6 +102,7 @@ $lang->custom->object['user'] = '用户';
|
||||
$lang->custom->object['block'] = '区块';
|
||||
$lang->custom->object['flow'] = '流程';
|
||||
$lang->custom->object['score'] = '积分';
|
||||
$lang->custom->object['mode'] = '模式';
|
||||
|
||||
$lang->custom->menuOrder[5] = 'project';
|
||||
$lang->custom->menuOrder[10] = 'product';
|
||||
@@ -117,9 +118,10 @@ $lang->custom->menuOrder[55] = 'user';
|
||||
$lang->custom->menuOrder[60] = 'block';
|
||||
$lang->custom->menuOrder[65] = 'flow';
|
||||
$lang->custom->menuOrder[70] = 'score';
|
||||
$lang->custom->menuOrder[85] = 'mode';
|
||||
|
||||
$lang->custom->dividerMenu = ',story,todo,block,';
|
||||
$lang->custom->separatePage = ',execution,product,kanban,flow,score,';
|
||||
$lang->custom->separatePage = ',execution,product,kanban,flow,score,mode';
|
||||
|
||||
$lang->custom->block = new stdclass();
|
||||
$lang->custom->block->fields['closed'] = '关闭的区块';
|
||||
|
||||
@@ -951,7 +951,8 @@ class customModel extends model
|
||||
*/
|
||||
public function hasAssetlibData()
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_ASSETLIB)->where('deleted')->eq(0)->count();
|
||||
if($this->config->edition == 'max') return $this->dao->select('*')->from(TABLE_ASSETLIB)->where('deleted')->eq(0)->count();
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
}
|
||||
if($object == 'user') common::printLink('custom', 'required', "", "<span class='text'>{$lang->custom->required}</span>", '', "class='btn btn-link' id='requiredTab'");
|
||||
}
|
||||
|
||||
common::printLink('custom', 'mode', "", "<span class='text'>{$lang->custom->mode}</span>", '', "class='btn btn-link' id='modeTab'");
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -865,7 +865,7 @@ class execution extends control
|
||||
if($project->model != 'scrum') unset($this->config->product->search['fields']['plan']);
|
||||
}
|
||||
|
||||
$this->execution->buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, 'executionStory', $executionID);
|
||||
$this->execution->buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, 'executionStory', $execution);
|
||||
|
||||
/* Header and position. */
|
||||
$title = $execution->name . $this->lang->colon . $this->lang->execution->story;
|
||||
@@ -3271,7 +3271,7 @@ class execution extends control
|
||||
/* Build the search form. */
|
||||
$actionURL = $this->createLink($this->app->rawModule, 'linkStory', "objectID=$objectID&browseType=bySearch&queryID=myQueryID");
|
||||
$branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products));
|
||||
$this->execution->buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, 'linkStory', $objectID);
|
||||
$this->execution->buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, 'linkStory', $object);
|
||||
|
||||
if($browseType == 'bySearch')
|
||||
{
|
||||
@@ -3317,6 +3317,7 @@ class execution extends control
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->branchGroups = $branchGroups;
|
||||
$this->view->browseLink = $browseLink;
|
||||
$this->view->project = $this->loadModel('project')->getByID($object->project);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -1260,7 +1260,7 @@ class executionModel extends model
|
||||
*
|
||||
* @param int $projectID
|
||||
* @param string $type all|sprint|stage|kanban
|
||||
* @param string $mode all|noclosed|stagefilter or empty
|
||||
* @param string $mode all|noclosed|stagefilter|withdelete or empty
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -1673,6 +1673,18 @@ class executionModel extends model
|
||||
return $executions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get no multiple execution id.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function getNoMultipleID($projectID)
|
||||
{
|
||||
return $this->dao->select('id')->from(TABLE_EXECUTION)->where('project')->eq($projectID)->andWhere('multiple')->eq(0)->andWhere('deleted')->eq(0)->fetch('id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the link from module,method,extra
|
||||
*
|
||||
@@ -2149,19 +2161,18 @@ class executionModel extends model
|
||||
* @param int $queryID
|
||||
* @param string $actionURL
|
||||
* @param string $type
|
||||
* @param int $objectID
|
||||
* @param object $execution
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, $type = 'executionStory', $objectID = 0)
|
||||
public function buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, $type = 'executionStory', $execution = null)
|
||||
{
|
||||
$this->app->loadLang('branch');
|
||||
$branchPairs = array(BRANCH_MAIN => $this->lang->branch->main);
|
||||
$productType = 'normal';
|
||||
$productNum = count($products);
|
||||
$productPairs = array(0 => '');
|
||||
$branches = $this->loadModel('project')->getBranchesByProject($objectID);
|
||||
$hasProduct = $this->dao->select('hasProduct')->from(TABLE_EXECUTION)->where('id')->eq($objectID)->fetch('hasProduct');
|
||||
$branches = $this->loadModel('project')->getBranchesByProject($execution->id);
|
||||
|
||||
foreach($products as $product)
|
||||
{
|
||||
@@ -2213,7 +2224,13 @@ class executionModel extends model
|
||||
}
|
||||
$this->config->product->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $this->lang->story->statusList);
|
||||
|
||||
if(empty($hasProduct)) unset($this->config->product->search['fields']['product']);
|
||||
$project = $this->loadModel('project')->getByID($execution->project);
|
||||
if(empty($project->hasProduct))
|
||||
{
|
||||
unset($this->config->product->search['fields']['product']);
|
||||
|
||||
if($project->model == 'kanban') unset($this->config->product->search['fields']['plan']);
|
||||
}
|
||||
|
||||
$this->loadModel('search')->setSearchParams($this->config->product->search);
|
||||
}
|
||||
|
||||
@@ -43,13 +43,15 @@
|
||||
</th>
|
||||
<th class='c-pri' title=<?php echo $lang->execution->pri;?>><?php echo $lang->priAB;?></th>
|
||||
<th><?php echo $lang->story->title;?></th>
|
||||
<?php if(!empty($object->hasProduct)):?>
|
||||
<?php if($project->hasProduct):?>
|
||||
<th class='c-object'><?php echo $lang->story->product;?></th>
|
||||
<?php endif;?>
|
||||
<th class='c-module'><?php echo $lang->story->module;?></th>
|
||||
<?php if($project->hasProduct || (!$project->hasProduct && $project->model != 'kanban')):?>
|
||||
<th class='c-plan'><?php echo $lang->story->plan;?></th>
|
||||
<?php endif;?>
|
||||
<th class='c-stage'><?php echo $lang->story->stage;?></th>
|
||||
<?php if(!empty($object->hasProduct) && $productType != 'normal'):?>
|
||||
<?php if($project->hasProduct && $productType != 'normal'):?>
|
||||
<th class='c-branch'><?php echo $lang->product->branchName[$productType];?></th>
|
||||
<?php endif;?>
|
||||
<th class='c-user'><?php echo $lang->openedByAB;?></th>
|
||||
@@ -79,13 +81,15 @@
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php if(!empty($object->hasProduct)):?>
|
||||
<?php if($project->hasProduct):?>
|
||||
<td class='text-left' title='<?php echo $products[$story->product]->name?>'><?php echo html::a($this->createLink('product', 'browse', "productID=$story->product&branch=$story->branch"), $products[$story->product]->name);?></td>
|
||||
<?php endif;?>
|
||||
<td class='c-module text-left' title='<?php echo zget($modules, $story->module, '')?>'><?php echo zget($modules, $story->module, '')?></td>
|
||||
<?php if($project->hasProduct || (!$project->hasProduct && $project->model != 'kanban')):?>
|
||||
<td class='text-ellipsis' title='<?php echo $story->planTitle;?>'><?php echo $story->planTitle;?></td>
|
||||
<?php endif;?>
|
||||
<td><?php echo zget($lang->story->stageList, $story->stage);?></td>
|
||||
<?php if(!empty($object->hasProduct) && $productType != 'normal'):?>
|
||||
<?php if($project->hasProduct && $productType != 'normal'):?>
|
||||
<td><?php if(isset($branchGroups[$story->product][$story->branch])) echo $branchGroups[$story->product][$story->branch];?></td>
|
||||
<?php endif;?>
|
||||
<td class='c-user'><?php echo zget($users, $story->openedBy);?></td>
|
||||
|
||||
@@ -96,14 +96,14 @@
|
||||
|
||||
$hidden = empty($buttonLink) ? 'hidden' : '';
|
||||
echo "<div class='btn-group dropdown' title='{$buttonTitle}'>";
|
||||
echo html::a($buttonLink, "<i class='icon icon-plus'></i> $buttonTitle", '', "class='btn btn-secondary $hidden'");
|
||||
echo html::a($buttonLink, "<i class='icon icon-plus'></i> $buttonTitle", '', "class='btn btn-secondary $hidden' data-app='$app->tab'");
|
||||
|
||||
if($common::hasPriv('story', 'create') and common::hasPriv('story', 'batchCreate'))
|
||||
{
|
||||
if(!($isAllProduct and count($products) > 1)) echo "<button type='button' class='btn btn-secondary dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>";
|
||||
echo "<ul class='dropdown-menu pull-right'>";
|
||||
echo '<li>' . html::a($createStoryLink, $lang->story->create) . '</li>';
|
||||
echo '<li>' . html::a($batchCreateLink, $lang->story->batchCreate) . '</li>';
|
||||
echo '<li>' . html::a($createStoryLink, $lang->story->create, '', "data-app=$app->tab") . '</li>';
|
||||
echo '<li>' . html::a($batchCreateLink, $lang->story->batchCreate, '', "data-app=$app->tab") . '</li>';
|
||||
echo '</ul>';
|
||||
}
|
||||
|
||||
|
||||
@@ -425,7 +425,8 @@ class groupModel extends model
|
||||
{
|
||||
$methodList = (array)zget($this->lang->resource, $moduleName, array());
|
||||
$methodList = array_keys($methodList);
|
||||
$this->dao->delete()->from(TABLE_GROUPPRIV)->where('`group`')->eq($groupID)
|
||||
$this->dao->delete()->from(TABLE_GROUPPRIV)
|
||||
->where('`group`')->eq($groupID)
|
||||
->andWhere('module')->eq($moduleName)
|
||||
->beginIF($methodList)->andWhere('method')->in($methodList)->fi()
|
||||
->exec();
|
||||
|
||||
@@ -876,7 +876,6 @@ class productModel extends model
|
||||
public function close($productID)
|
||||
{
|
||||
$oldProduct = $this->getById($productID);
|
||||
$now = helper::now();
|
||||
$product = fixer::input('post')
|
||||
->add('id', $productID)
|
||||
->setDefault('status', 'closed')
|
||||
@@ -894,6 +893,25 @@ class productModel extends model
|
||||
if(!dao::isError()) return common::createChanges($oldProduct, $product);
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate a product.
|
||||
*
|
||||
* @param int $productID.
|
||||
* @access public
|
||||
* @return bool | array
|
||||
*/
|
||||
public function activate($productID)
|
||||
{
|
||||
$oldProduct = $this->getById($productID);
|
||||
$product = (object)array('status' => 'normal');
|
||||
|
||||
$this->dao->update(TABLE_PRODUCT)->data($product)->where('id')->eq((int)$productID)->exec();
|
||||
|
||||
if(dao::isError()) return false;
|
||||
|
||||
return common::createChanges($oldProduct, $product);
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage line.
|
||||
*
|
||||
@@ -1328,7 +1346,7 @@ class productModel extends model
|
||||
$executions = $this->dao->select('t2.id,t2.name,t2.grade,t2.parent,t2.attribute')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
|
||||
->where('t1.product')->eq($productID)
|
||||
->andWhere('t2.project')->eq($projectID)
|
||||
->beginIF($projectID)->andWhere('t2.project')->eq($projectID)->fi()
|
||||
->beginIF($branch !== '')->andWhere('t1.branch')->in($branch)->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi()
|
||||
->beginIF(strpos($mode, 'noclosed') !== false)->andWhere('t2.status')->ne('closed')->fi()
|
||||
|
||||
@@ -550,7 +550,7 @@
|
||||
<?php if($plan->parent > 0):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->productplan->parent;?></th>
|
||||
<td><?php echo html::a(inlink('view', "planID={$parentPlan->id}"), "#{$parentPlan->id} " . $parentPlan->title);?></td>
|
||||
<td><?php echo html::a(inlink('view', "planID={$parentPlan->id}"), "#{$parentPlan->id} " . $parentPlan->title, '', "data-app={$app->tab}");?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php if($product->type != 'normal'):?>
|
||||
@@ -572,7 +572,7 @@
|
||||
<th><?php echo $lang->productplan->children;?></th>
|
||||
<td>
|
||||
<?php foreach($childrenPlans as $childrenPlan):?>
|
||||
<?php echo html::a(inlink('view', "planID={$childrenPlan->id}"), "#{$childrenPlan->id} " . $childrenPlan->title) . '<br />';?>
|
||||
<?php echo html::a(inlink('view', "planID={$childrenPlan->id}"), "#{$childrenPlan->id} " . $childrenPlan->title, '', "data-app={$app->tab}") . '<br />';?>
|
||||
<?php endforeach;?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -1645,19 +1645,25 @@ class project extends control
|
||||
$this->loadModel('dept');
|
||||
$this->loadModel('execution');
|
||||
$this->project->setMenu($projectID);
|
||||
$project = $this->project->getById($projectID);
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->project->manageMembers($projectID);
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
if(empty($project->multiple))
|
||||
{
|
||||
$executionID = $this->execution->getNoMultipleID($projectID);
|
||||
if($executionID) $this->execution->manageMembers($executionID);
|
||||
}
|
||||
|
||||
$this->loadModel('action')->create('team', $projectID, 'ManagedTeam');
|
||||
|
||||
$link = $this->session->teamList ? $this->session->teamList : $this->createLink('project', 'team', "projectID=$projectID");
|
||||
return $this->send(array('message' => $this->lang->saveSuccess, 'result' => 'success', 'locate' => $link));
|
||||
}
|
||||
|
||||
$project = $this->project->getById($projectID);
|
||||
$users = $this->user->getPairs('noclosed|nodeleted|devfirst');
|
||||
$roles = $this->user->getUserRoles(array_keys($users));
|
||||
$deptUsers = $dept === '' ? array() : $this->dept->getDeptUserPairs($dept);
|
||||
@@ -1990,6 +1996,13 @@ class project extends control
|
||||
/* Delete the execution under the project. */
|
||||
$executionIdList = $this->loadModel('execution')->getPairs($projectID);
|
||||
|
||||
/* Delete shadow product.*/
|
||||
if(!$project->hasProduct)
|
||||
{
|
||||
$productID = $this->loadModel('product')->getProductIDByProject($projectID);
|
||||
$this->dao->update(TABLE_PRODUCT)->set('deleted')->eq(1)->where('id')->eq($productID)->exec();
|
||||
}
|
||||
|
||||
$message = $this->executeHooks($projectID);
|
||||
if($message) $this->lang->saveSuccess = $message;
|
||||
|
||||
@@ -2106,6 +2119,8 @@ class project extends control
|
||||
{
|
||||
$this->loadModel('product');
|
||||
$this->loadModel('program');
|
||||
$this->loadModel('execution');
|
||||
$project = $this->project->getById($projectID);
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
@@ -2119,6 +2134,12 @@ class project extends control
|
||||
$this->project->updateProducts($projectID);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
if(empty($project->multiple))
|
||||
{
|
||||
$executionID = $this->execution->getNoMultipleID($projectID);
|
||||
if($executionID) $this->execution->updateProducts($executionID);
|
||||
}
|
||||
|
||||
$oldProducts = array_keys($oldProducts);
|
||||
$newProducts = $this->product->getProducts($projectID);
|
||||
$newProducts = array_keys($newProducts);
|
||||
@@ -2130,7 +2151,6 @@ class project extends control
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locateLink));
|
||||
}
|
||||
|
||||
$project = $this->project->getById($projectID);
|
||||
if($this->app->tab == 'program')
|
||||
{
|
||||
$this->program->setMenu($project->parent);
|
||||
@@ -2170,7 +2190,7 @@ class project extends control
|
||||
|
||||
/* Assign. */
|
||||
$this->view->title = $this->lang->project->manageProducts . $this->lang->colon . $project->name;
|
||||
$this->view->position[] = $this->lang->project->manageProducts;
|
||||
$this->view->project = $project;
|
||||
$this->view->allProducts = $allProducts;
|
||||
$this->view->linkedProducts = $linkedProducts;
|
||||
$this->view->linkedBranches = $linkedBranches;
|
||||
|
||||
@@ -67,6 +67,7 @@ $lang->project->ignore = 'Ignore';
|
||||
$lang->project->manageRepo = 'Manage Repo';
|
||||
$lang->project->linkedRepo = 'Link Repo';
|
||||
$lang->project->unlinkedRepo = 'Unlink Repo';
|
||||
$lang->project->disableExecution = 'Project of disable iteration';
|
||||
|
||||
/* Fields. */
|
||||
$lang->project->common = 'Project';
|
||||
|
||||
@@ -67,6 +67,7 @@ $lang->project->ignore = 'Ignore';
|
||||
$lang->project->manageRepo = 'Manage Repo';
|
||||
$lang->project->linkedRepo = 'Link Repo';
|
||||
$lang->project->unlinkedRepo = 'Unlink Repo';
|
||||
$lang->project->disableExecution = 'Project of disable iteration';
|
||||
|
||||
/* Fields. */
|
||||
$lang->project->common = 'Project';
|
||||
|
||||
@@ -67,7 +67,7 @@ $lang->project->ignore = 'Ignorer';
|
||||
$lang->project->manageRepo = 'Manage Repo';
|
||||
$lang->project->linkedRepo = 'Link Repo';
|
||||
$lang->project->unlinkedRepo = 'Unlink Repo';
|
||||
|
||||
$lang->project->disableExecution = 'Project of disable iteration';
|
||||
/* Fields. */
|
||||
$lang->project->common = 'Projets';
|
||||
$lang->project->id = 'ID';
|
||||
|
||||
@@ -67,6 +67,7 @@ $lang->project->ignore = '忽略';
|
||||
$lang->project->manageRepo = '关联代码库';
|
||||
$lang->project->linkedRepo = '已关联代码库';
|
||||
$lang->project->unlinkedRepo = '未关联代码库';
|
||||
$lang->project->disableExecution = '不启用迭代的项目';
|
||||
|
||||
/* Fields. */
|
||||
$lang->project->common = '项目';
|
||||
|
||||
@@ -559,8 +559,10 @@ class projectModel extends model
|
||||
public function getProjectLink($module, $method, $projectID)
|
||||
{
|
||||
$link = helper::createLink('project', 'index', "projectID=%s");
|
||||
$project = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch();
|
||||
|
||||
if(strpos(',project,product,projectstory,story,bug,doc,testcase,testtask,testreport,repo,build,projectrelease,stakeholder,issue,risk,meeting,report,measrecord', ',' . $module . ',') !== false)
|
||||
if(empty($project->multiple)) return $link;
|
||||
if(strpos(',project,product,projectstory,story,bug,doc,testcase,testtask,testreport,repo,build,projectrelease,stakeholder,issue,risk,meeting,report,measrecord,', ',' . $module . ',') !== false)
|
||||
{
|
||||
if($module == 'project' and $method == 'execution')
|
||||
{
|
||||
@@ -922,7 +924,7 @@ class projectModel extends model
|
||||
{
|
||||
unset($privs->$module);
|
||||
}
|
||||
else
|
||||
elseif($methods)
|
||||
{
|
||||
foreach($methods as $method => $label)
|
||||
{
|
||||
@@ -1568,6 +1570,14 @@ class projectModel extends model
|
||||
$oldProject->linkedProducts = implode(',', $linkedProducts);
|
||||
$project->linkedProducts = implode(',', $_POST['products']);
|
||||
|
||||
/* Activate or close the shadow product of the project. */
|
||||
if(!$oldProject->hasProduct && $oldProject->status != $project->status && strpos('doing,closed', $project->status) !== false)
|
||||
{
|
||||
$productID = $this->loadModel('product')->getProductIDByProject($projectID);
|
||||
if($project->status == 'doing') $this->product->activate($productID);
|
||||
if($project->status == 'closed') $this->product->close($productID);
|
||||
}
|
||||
|
||||
return common::createChanges($oldProject, $project);
|
||||
}
|
||||
}
|
||||
@@ -1803,6 +1813,8 @@ class projectModel extends model
|
||||
->where('id')->eq((int)$projectID)
|
||||
->exec();
|
||||
|
||||
if(dao::isError()) return false;
|
||||
|
||||
/* Readjust task. */
|
||||
if($this->post->readjustTime and $this->post->readjustTask)
|
||||
{
|
||||
@@ -1838,7 +1850,14 @@ class projectModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
if(!dao::isError()) return common::createChanges($oldProject, $project);
|
||||
/* Activate the shadow product of the project. */
|
||||
if(!$oldProject->hasProduct)
|
||||
{
|
||||
$productID = $this->loadModel('product')->getProductIDByProject($projectID);
|
||||
$this->product->activate($productID);
|
||||
}
|
||||
|
||||
return common::createChanges($oldProject, $project);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1881,13 +1900,23 @@ class projectModel extends model
|
||||
->exec();
|
||||
|
||||
/* When it has multiple errors, only the first one is prompted */
|
||||
if(dao::isError() and count(dao::$errors['realEnd']) > 1) dao::$errors['realEnd'] = dao::$errors['realEnd'][0];
|
||||
|
||||
if(!dao::isError())
|
||||
if(dao::isError())
|
||||
{
|
||||
$this->loadModel('score')->create('project', 'close', $oldProject);
|
||||
return common::createChanges($oldProject, $project);
|
||||
if(count(dao::$errors['realEnd']) > 1) dao::$errors['realEnd'] = dao::$errors['realEnd'][0];
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Close the shadow product of the project. */
|
||||
if(!$oldProject->hasProduct)
|
||||
{
|
||||
$productID = $this->loadModel('product')->getProductIDByProject($projectID);
|
||||
unset($_POST);
|
||||
$this->product->close($productID);
|
||||
}
|
||||
|
||||
$this->loadModel('score')->create('project', 'close', $oldProject);
|
||||
return common::createChanges($oldProject, $project);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2031,7 +2060,7 @@ class projectModel extends model
|
||||
if(!empty($linkedProducts)) $this->user->updateUserView(array_keys($linkedProducts), 'product', $changedAccounts);
|
||||
|
||||
/* Remove execution members. */
|
||||
if($removeExecution == 'yes' and !empty($childSprints) and !empty($removedAccounts))
|
||||
if($this->post->removeExecution == 'yes' and !empty($childSprints) and !empty($removedAccounts))
|
||||
{
|
||||
$this->dao->delete()->from(TABLE_TEAM)
|
||||
->where('root')->in($childSprints)
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
<?php $isDisabled = '';?>
|
||||
<?php if($branchID == BRANCH_MAIN and isset($unmodifiableMainBranches[$productID])) $isDisabled = "disabled='disabled'";?>
|
||||
<?php if($branchID != BRANCH_MAIN and in_array($productID, $unmodifiableProducts) and in_array($branchID, $unmodifiableBranches)) $isDisabled = "disabled='disabled'";?>
|
||||
<?php if(empty($project->multiple)) $isDisabled = '';?>
|
||||
<?php $title = (in_array($productID, $unmodifiableProducts) and in_array($branchID, $unmodifiableBranches)) ? $lang->project->notAllowRemoveProducts : $productName;?>
|
||||
<?php $checked = 'checked';?>
|
||||
<div class='col-sm-4'>
|
||||
|
||||
@@ -203,8 +203,7 @@ class repo extends control
|
||||
$this->view->projects = $options;
|
||||
}
|
||||
|
||||
$products = explode(',', $repo->product);
|
||||
$projectOptions = $this->filterProject($products);
|
||||
$projectOptions = $this->filterProject(explode(',', $repo->product), explode(',', $repo->projects));
|
||||
|
||||
$this->view->title = $this->lang->repo->common . $this->lang->colon . $this->lang->repo->edit;
|
||||
$this->view->repo = $repo;
|
||||
@@ -1226,6 +1225,7 @@ class repo extends control
|
||||
* Remove projects without privileges.
|
||||
*
|
||||
* @param array $productIDList
|
||||
* @param array $projectIDList
|
||||
* @access private
|
||||
* @return array
|
||||
*/
|
||||
|
||||
+17
-22
@@ -554,7 +554,7 @@ class story extends control
|
||||
}
|
||||
|
||||
/* Project or execution linked stories. */
|
||||
if($executionID)
|
||||
if($executionID and $storyType == 'story')
|
||||
{
|
||||
$products = array();
|
||||
foreach($mails as $story) $products[$story->storyID] = $productID;
|
||||
@@ -2638,36 +2638,23 @@ class story extends control
|
||||
}
|
||||
|
||||
$fileName = $storyType == 'requirement' ? $this->lang->URCommon : $this->lang->SRCommon;
|
||||
$project = null;
|
||||
if($executionID)
|
||||
{
|
||||
$execution = $this->loadModel('execution')->getByID($executionID);
|
||||
$executionName = $execution->name;
|
||||
$hasProduct = true;
|
||||
if($execution->type == 'project')
|
||||
{
|
||||
$hasProduct = $execution->hasProduct;
|
||||
}
|
||||
else
|
||||
{
|
||||
$project = $this->loadModel('project')->getById($execution->project);
|
||||
$hasProduct = $project->hasProduct;
|
||||
}
|
||||
|
||||
/* Unset product field when in single project. */
|
||||
if(!$hasProduct)
|
||||
{
|
||||
$this->config->story->exportFields = str_replace(array('product,', 'branch,'), array('', ''), $this->config->story->exportFields);
|
||||
}
|
||||
|
||||
$fileName = $executionName . $this->lang->dash . $fileName;
|
||||
$execution = $this->loadModel('execution')->getByID($executionID);
|
||||
$fileName = $execution->name . $this->lang->dash . $fileName;
|
||||
$project = $execution;
|
||||
if($execution->type == 'execution') $project = $this->project->getById($execution->project);
|
||||
}
|
||||
else
|
||||
{
|
||||
$productName = $this->lang->product->all;
|
||||
if($productID)
|
||||
{
|
||||
$product = $this->product->getById($productID);
|
||||
$product = $this->product->getById($productID);
|
||||
$productName = $product->name;
|
||||
|
||||
if($product->shadow) $project = $this->project->getByShadowProduct($productID);
|
||||
}
|
||||
if(isset($this->lang->product->featureBar['browse'][$browseType]))
|
||||
{
|
||||
@@ -2681,6 +2668,14 @@ class story extends control
|
||||
$fileName = $productName . $this->lang->dash . $browseType . $fileName;
|
||||
}
|
||||
|
||||
/* Unset product field when in single project. */
|
||||
if(isset($project->hasProduct) && !$project->hasProduct)
|
||||
{
|
||||
$filterFields = array('product,', 'branch,');
|
||||
if($project->model != 'scrum') $filterFields[] = 'plan';
|
||||
$this->config->story->exportFields = str_replace($filterFields, '', $this->config->story->exportFields);
|
||||
}
|
||||
|
||||
$this->view->fileName = $fileName;
|
||||
$this->view->allExportFields = $this->config->story->exportFields;
|
||||
$this->view->customExport = true;
|
||||
|
||||
@@ -300,7 +300,7 @@ class storyModel extends model
|
||||
}
|
||||
|
||||
/* Project or execution linked story. */
|
||||
if($executionID != 0)
|
||||
if($executionID != 0 and $story->type == 'story')
|
||||
{
|
||||
$this->linkStory($executionID, $this->post->product, $storyID);
|
||||
if($this->config->systemMode == 'new' and $executionID != $this->session->project) $this->linkStory($this->session->project, $this->post->product, $storyID);
|
||||
@@ -3359,6 +3359,7 @@ class storyModel extends model
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id')
|
||||
->where('t1.project')->eq((int)$executionID)
|
||||
->andWhere('t2.deleted')->eq(0)
|
||||
->andWhere('t2.type')->eq('story')
|
||||
->beginIF($productID)->andWhere('t2.product')->eq((int)$productID)->fi()
|
||||
->beginIF($branch !== 'all')->andWhere('t2.branch')->in("0,$branch")->fi()
|
||||
->beginIF($moduleIdList)->andWhere('t2.module')->in($moduleIdList)->fi()
|
||||
@@ -4294,7 +4295,7 @@ class storyModel extends model
|
||||
if($canClose and ($canBatchCreate or $canCreateCase)) $menu .= "<div class='dividing-line'></div>";
|
||||
}
|
||||
|
||||
if($storyType == 'requirement') $menu .= $this->buildMenu('story', 'batchCreate', "productID=$story->product&branch=$story->branch&module=$story->module&$params&executionID=0&plan=0&storyType=story", $story, $type, 'split', '', 'showinonlybody', '', '', $title);
|
||||
if($storyType == 'requirement') $menu .= $this->buildMenu('story', 'batchCreate', "productID=$story->product&branch=$story->branch&module=$story->module&$params&executionID=0&plan=0&storyType=story", $story, $type, 'split', '', 'showinonlybody', '', '', $this->lang->story->subdivide);
|
||||
|
||||
$tab = $this->app->tab == 'project' ? 'project' : 'qa';
|
||||
if($story->type != 'requirement' and $this->config->vision != 'lite') $menu .= $this->buildMenu('testcase', 'create', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$params", $story, $type, 'sitemap', '', 'showinonlybody', false, "data-app='$tab'");
|
||||
@@ -4325,7 +4326,7 @@ class storyModel extends model
|
||||
if($canCreateCase and ($canClose or $canUnlinkStory)) $menu .= "<div class='dividing-line'></div>";
|
||||
|
||||
$menu .= $this->buildMenu('story', 'close', $params . "&from=&storyType=$story->type", $story, $type, '', '', 'iframe', true);
|
||||
$menu .= $this->buildMenu('projectstory', 'unlinkStory', "projectID={$this->session->project}&$params", $story, $type, 'unlink', 'hiddenwin', 'showinonlybody');
|
||||
if($execution->hasProduct) $menu .= $this->buildMenu('projectstory', 'unlinkStory', "projectID={$this->session->project}&$params", $story, $type, 'unlink', 'hiddenwin', 'showinonlybody');
|
||||
}
|
||||
|
||||
if($this->app->tab == 'product' and $storyType == 'story')
|
||||
@@ -4334,7 +4335,6 @@ class storyModel extends model
|
||||
|
||||
$menu .= $this->buildMenu('story', 'close', $params . "&from=&storyType=$story->type", $story, $type, '', '', 'iframe', true);
|
||||
}
|
||||
if($this->app->rawModule == 'projectstory' and $this->config->vision != 'lite' and $execution->hasProduct) $menu .= $this->buildMenu('projectstory', 'unlinkStory', "projectID={$this->session->project}&$params", $story, $type, 'unlink', 'hiddenwin', 'showinonlybody');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1065,7 +1065,7 @@ class taskModel extends model
|
||||
}
|
||||
|
||||
/* If a multiple task is assigned to a team member who is not the task, assign to the team member instead. */
|
||||
if(!$this->post->assignedTo and !empty($_POST['team'])) $_POST['assignedTo'] = $this->getAssignedTo4Multi($_POST['team'], $oldTask);
|
||||
if(!$this->post->assignedTo and !empty($oldTask->team) and !empty($_POST['team'])) $_POST['assignedTo'] = $this->getAssignedTo4Multi($_POST['team'], $oldTask);
|
||||
|
||||
/* When the selected parent task is a common task and has consumption, select other parent tasks. */
|
||||
if($this->post->parent > 0)
|
||||
|
||||
@@ -1393,6 +1393,8 @@ class testcase extends control
|
||||
$objectID = 0;
|
||||
if($this->app->tab == 'project') $objectID = $case->project;
|
||||
if($this->app->tab == 'execution') $objectID = $case->execution;
|
||||
|
||||
unset($this->config->testcase->search['fields']['product']);
|
||||
$this->testcase->buildSearchForm($case->product, $this->products, $queryID, $actionURL, $objectID);
|
||||
|
||||
/* Get cases to link. */
|
||||
@@ -1442,6 +1444,15 @@ class testcase extends control
|
||||
$objectID = 0;
|
||||
if($this->app->tab == 'project') $objectID = $case->project;
|
||||
if($this->app->tab == 'execution') $objectID = $case->execution;
|
||||
|
||||
/* Unset search field 'plan' in single project. */
|
||||
unset($this->config->bug->search['fields']['product']);
|
||||
if($case->project and ($this->app->tab == 'project' or $this->app->tab == 'execution'))
|
||||
{
|
||||
$project = $this->loadModel('project')->getById($case->project);
|
||||
if(!$project->hasProduct and $project->model == 'waterfall') unset($this->config->bug->search['fields']['plan']);
|
||||
}
|
||||
|
||||
$this->bug->buildSearchForm($case->product, $this->products, $queryID, $actionURL, $objectID);
|
||||
|
||||
/* Get cases to link. */
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
.thWidth {width: 86px !important;}
|
||||
.thWidth {width: 94px !important;}
|
||||
.lifeThWidth {width: 70px !important;}
|
||||
|
||||
@@ -1935,6 +1935,7 @@ class testcaseModel extends model
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->app->loadLang('branch');
|
||||
$productInfo = $this->loadModel('product')->getByID($productID);
|
||||
$this->config->testcase->search['fields']['branch'] = sprintf($this->lang->product->branch, $this->lang->product->branchName[$productInfo->type]);
|
||||
$this->config->testcase->search['params']['branch']['values'] = array('' => '', '0' => $this->lang->branch->main) + $this->loadModel('branch')->getPairs($productID, '', $projectID) + array('all' => $this->lang->branch->all);
|
||||
|
||||
@@ -182,7 +182,7 @@ js::set('suiteID', $suiteID);
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php if(common::hasPriv('testcase', 'batchChangeBranch') and $this->session->currentProductType != 'normal'):?>
|
||||
<?php if(common::hasPriv('testcase', 'batchChangeBranch') and $this->session->currentProductType and $this->session->currentProductType != 'normal'):?>
|
||||
<div class="btn-group dropup">
|
||||
<button data-toggle="dropdown" type="button" class="btn"><?php echo $lang->product->branchName[$this->session->currentProductType];?> <span class="caret"></span></button>
|
||||
<?php $withSearch = count($branchTagOption) > 6;?>
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
<?php echo $lang->idAB;?>
|
||||
</th>
|
||||
<th class='c-pri' title=<?php echo $lang->pri;?>><?php echo $lang->priAB;?></th>
|
||||
<th><?php echo $lang->bug->product;?></th>
|
||||
<th><?php echo $lang->bug->title;?></th>
|
||||
<th class='c-type'><?php echo $lang->bug->type;?></th>
|
||||
<th class='c-user'><?php echo $lang->openedByAB;?></th>
|
||||
@@ -52,7 +51,6 @@
|
||||
<?php printf('%03d', $bug2Link->id);?>
|
||||
</td>
|
||||
<td><span class='<?php echo 'pri' . zget($lang->bug->priList, $bug2Link->pri, $bug2Link->pri)?>'><?php echo zget($lang->bug->priList, $bug2Link->pri, $bug2Link->pri)?></span></td>
|
||||
<td class='c-name'><?php echo html::a($this->createLink('product', 'browse', "productID={$bug2Link->product}&branch={$bug2Link->branch}"), $products[$bug2Link->product], '_blank');?></td>
|
||||
<td class='c-name' title='<?php echo $bug2Link->title;?>'><?php echo html::a($this->createLink('bug', 'view', "bugID=$bug2Link->id"), $bug2Link->title, '_blank');?></td>
|
||||
<td><?php echo zget($lang->bug->typeList, $bug2Link->type);?></td>
|
||||
<td><?php echo zget($users, $bug2Link->openedBy);?></td>
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
<?php echo $lang->idAB;?>
|
||||
</th>
|
||||
<th class='c-pri' title=<?php echo $lang->pri;?>><?php echo $lang->priAB;?></th>
|
||||
<th><?php echo $lang->testcase->product;?></th>
|
||||
<th><?php echo $lang->testcase->title;?></th>
|
||||
<th class='c-type'><?php echo $lang->testcase->type;?></th>
|
||||
<th class='c-user'><?php echo $lang->openedByAB;?></th>
|
||||
@@ -52,7 +51,6 @@
|
||||
<?php printf('%03d', $case2Link->id);?>
|
||||
</td>
|
||||
<td><span class='<?php echo 'pri' . zget($lang->testcase->priList, $case2Link->pri, $case2Link->pri)?>'><?php echo zget($lang->testcase->priList, $case2Link->pri, $case2Link->pri)?></span></td>
|
||||
<td class='c-name'><?php echo html::a($this->createLink('product', 'browse', "productID={$case2Link->product}&branch={$case2Link->branch}"), $products[$case2Link->product], '_blank');?></td>
|
||||
<td class='c-name' title='<?php echo $case2Link->title;?>'><?php echo html::a($this->createLink('testcase', 'view', "caseID=$case2Link->id"), $case2Link->title, '_blank');?></td>
|
||||
<td><?php echo $lang->testcase->typeList[$case2Link->type];?></td>
|
||||
<td><?php echo zget($users, $case2Link->openedBy);?></td>
|
||||
|
||||
@@ -146,12 +146,10 @@
|
||||
<td><?php echo common::hasPriv('caselib', 'browse') ? html::a($this->createLink('caselib', 'browse', "libID=$case->lib"), $libName) : $libName;?></td>
|
||||
</tr>
|
||||
<?php else:?>
|
||||
<?php if(!$product->shadow):?>
|
||||
<tr>
|
||||
<tr class='<?php if(!$product->shadow) echo 'hide';?>'>
|
||||
<th class='thWidth'><?php echo $lang->testcase->product;?></th>
|
||||
<td><?php echo (common::hasPriv('product', 'browse') and $productName) ? html::a($this->createLink('product', 'browse', "productID=$case->product"), $productName) : $productName;?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php if($product->type != 'normal'):?>
|
||||
<tr>
|
||||
<th><?php echo sprintf($lang->product->branch, $lang->product->branchName[$product->type]);?></th>
|
||||
|
||||
@@ -375,7 +375,7 @@ $config->delete['17_2'][] = 'extension/lite/workflowrelation/ext/view/admin.flow
|
||||
$config->delete['17_2'][] = 'extension/lite/extension/lite/workflowrule/ext/view/browse.flow.html.hook.php';
|
||||
$config->delete['17_2'][] = 'extension/lite/extension/lite/workflowrule/ext/view/view.flow.html.hook.php';
|
||||
|
||||
$config->upgrade->openModules = array('action', 'admin', 'api', 'automation', 'backup', 'block', 'branch', 'budget', 'bug', 'build', 'caselib', 'ci', 'client', 'common', 'company', 'compile', 'convert', 'cron', 'custom', 'datatable', 'dept', 'design', 'dev', 'doc', 'durationestimation', 'entry', 'execution', 'extension', 'file', 'git', 'gitlab', 'group', 'holiday', 'im', 'index', 'index.html', 'install', 'issue', 'jenkins', 'job', 'kanban', 'license', 'mail', 'message', 'misc', 'mr', 'my', 'personnel', 'pipeline', 'product', 'productplan', 'productset', 'program', 'programplan', 'project', 'projectbuild', 'projectrelease', 'projectstory', 'qa', 'release', 'repo', 'report', 'risk', 'score', 'search', 'setting', 'sonarqube', 'sso', 'stage', 'stakeholder', 'story', 'subject', 'svn', 'task', 'testcase', 'testreport', 'testsuite', 'testtask', 'todo', 'tree', 'tutorial', 'upgrade', 'user', 'webhook', 'weekly', 'workestimation', 'gitea', 'gogs', 'port');
|
||||
$config->upgrade->openModules = array('action', 'admin', 'api', 'automation', 'backup', 'block', 'branch', 'budget', 'bug', 'build', 'caselib', 'ci', 'client', 'common', 'company', 'compile', 'convert', 'cron', 'custom', 'datatable', 'dept', 'design', 'dev', 'doc', 'durationestimation', 'entry', 'execution', 'extension', 'file', 'git', 'gitlab', 'group', 'holiday', 'im', 'index', 'index.html', 'install', 'issue', 'jenkins', 'job', 'kanban', 'license', 'mail', 'message', 'misc', 'mr', 'my', 'personnel', 'pipeline', 'product', 'productplan', 'productset', 'program', 'programplan', 'project', 'projectbuild', 'projectplan', 'projectrelease', 'projectstory', 'qa', 'release', 'repo', 'report', 'risk', 'score', 'search', 'setting', 'sonarqube', 'sso', 'stage', 'stakeholder', 'story', 'subject', 'svn', 'task', 'testcase', 'testreport', 'testsuite', 'testtask', 'todo', 'tree', 'tutorial', 'upgrade', 'user', 'webhook', 'weekly', 'workestimation', 'gitea', 'gogs', 'port');
|
||||
|
||||
$config->upgrade->unsetModules = array('design', 'program', 'programplan', 'projectbuild', 'projectrelease', 'stage', 'stakeholder', 'product', 'branch', 'productplan', 'release', 'build', 'qa', 'bug', 'testcase', 'testtask', 'testreport', 'testsuite', 'caselib', 'automation', 'repo', 'ci', 'compile', 'jenkins', 'job', 'svn', 'gitlab', 'sonarqube', 'mr', 'git', 'report', 'sqlbuilder', 'feedback', 'faq', 'attend', 'holiday', 'leave', 'makeup', 'overtime', 'lieu', 'ops', 'host', 'serverroom', 'account', 'domain', 'service', 'deploy', 'conference', 'traincourse', 'pssp', 'baseline', 'classify', 'cm', 'cmcl', 'auditcl', 'reviewcl', 'process', 'activity', 'zoutput', 'auditplan', 'nc', 'subject', 'weekly', 'workestimation', 'issue', 'durationestimation', 'risk', 'opportunity', 'trainplan', 'gapanalysis', 'researchplan', 'researchreport', 'meeting', 'meetingroom', 'budget', 'reviewissue', 'reviewsetting', 'review', 'milestone', 'measurement', 'measrecord', 'assetlib', 'setting', 'im', 'client', 'ldap', 'dev', 'api', 'gitea', 'gogs');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user