* Hide bug plan in waterfall project.

This commit is contained in:
sunguangming
2022-09-29 16:05:03 +08:00
parent b2dd00458a
commit 4f58d80d64
8 changed files with 59 additions and 15 deletions
+1
View File
@@ -1169,6 +1169,7 @@ class bug extends control
$this->view->productName = $this->products[$productID];
$this->view->plans = $this->loadModel('productplan')->getPairs($productID, $bug->branch, '', true);
$this->view->projects = array(0 => '') + $this->product->getProjectPairsByProduct($productID, $bug->branch, $bug->project);
$this->view->project = $this->loadModel('project')->getByID($bug->project);
$this->view->moduleOptionMenu = $moduleOptionMenu;
$this->view->currentModuleID = $currentModuleID;
$this->view->executions = array(0 => '') + $this->product->getExecutionPairsByProduct($bug->product, $bug->branch, 'id_desc', $bug->project);
+1 -1
View File
@@ -123,7 +123,7 @@ if($this->app->tab == 'project') js::set('objectID', $bug->project);
</div>
</td>
</tr>
<tr>
<tr class='<?php if(!$project->hasProduct and $project->model != 'scrum') echo 'hide'?>'>
<th><?php echo $lang->bug->productplan;?></th>
<td>
<span id="planIdBox"><?php echo html::select('plan', $plans, $bug->plan, "class='form-control chosen'");?></span>
+1 -1
View File
@@ -162,7 +162,7 @@
<th><?php echo $lang->bug->fromCase;?></th>
<td><?php if($bug->case) echo html::a(helper::createLink('testcase', 'view', "caseID=$bug->case&version=$bug->caseVersion", '', true), "<i class='icon icon-sitemap'></i> {$lang->bug->fromCase}$lang->colon$bug->case", '', isonlybody() ? '' : "data-toggle='modal' data-type='iframe' data-width='80%'");?></td>
</tr>
<tr valign='middle'>
<tr valign='middle' class='<?php if(!$project->hasProduct and $project->model != 'scrum') echo 'hide'?>'>
<th><?php echo $lang->bug->productplan;?></th>
<td><?php if(!$bug->plan or !common::printLink('productplan', 'view', "planID=$bug->plan&type=bug", $bug->planName)) echo $bug->planName;?></td>
</tr>
+23 -3
View File
@@ -57,9 +57,10 @@ class datatable extends control
*/
public function ajaxCustom($module, $method, $extra = '')
{
$target = $module . ucfirst($method);
$mode = isset($this->config->datatable->$target->mode) ? $this->config->datatable->$target->mode : 'table';
$key = $mode == 'datatable' ? 'cols' : 'tablecols';
$moduleName = $module;
$target = $module . ucfirst($method);
$mode = isset($this->config->datatable->$target->mode) ? $this->config->datatable->$target->mode : 'table';
$key = $mode == 'datatable' ? 'cols' : 'tablecols';
if($module == 'testtask')
{
@@ -100,6 +101,25 @@ class datatable extends control
$cols['title']['title'] = str_replace($this->lang->SRCommon, $this->lang->URCommon, $this->lang->story->title);
}
if($moduleName == 'project' and $method == 'bug')
{
$project = $this->loadModel('project')->getByID($this->session->project);
if(!$project->hasProduct and $project->model != 'scrum')
{
unset($cols['plan']);
}
}
if($moduleName == 'execution' and $method == 'bug')
{
$execution = $this->loadModel('execution')->getByID($this->session->execution);
$project = $this->loadModel('project')->getByID($execution->project);
if(!$project->hasProduct and $project->model != 'scrum')
{
unset($cols['plan']);
}
}
$this->view->cols = $cols;
$this->view->setting = $setting;
$this->display();
+11 -3
View File
@@ -980,15 +980,22 @@ class execution extends control
$type = strtolower($type);
$queryID = ($type == 'bysearch') ? (int)$param : 0;
$execution = $this->commonAction($executionID);
$project = $this->loadModel('project')->getByID($execution->project);
$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']);
if($execution->project and !$project->hasProduct)
{
unset($this->config->bug->search['fields']['product']);
if($project->model != 'scrum')
{
unset($this->config->bug->search['fields']['plan']);
}
}
$productPairs = array('0' => $this->lang->product->all);
foreach($products as $productData) $productPairs[$productData->id] = $productData->name;
if($hasProduct) $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'execution', 'bug', $executionID, $branch);
if($project->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;
@@ -1084,6 +1091,7 @@ class execution extends control
$this->view->orderBy = $orderBy;
$this->view->users = $users;
$this->view->productID = $productID;
$this->view->project = $project;
$this->view->branchID = empty($this->view->build->branch) ? $branch : $this->view->build->branch;
$this->view->memberPairs = $memberPairs;
$this->view->type = $type;
+7 -1
View File
@@ -124,6 +124,7 @@
<?php
foreach($setting as $value)
{
if(!$project->hasProduct and $project->model != 'scrum' and $value->id == 'plan') continue;
if($value->show)
{
if(common::checkNotCN() and $value->id == 'severity') $value->name = $lang->bug->severity;
@@ -150,7 +151,12 @@
}
}?>
<?php else:?>
<?php foreach($setting as $value) $this->bug->printCell($value, $bug, $users, $builds, $branchOption, $modulePairs, $executions, $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table', $projectPairs);?>
<?php foreach($setting as $value)
{
if(!$project->hasProduct and $project->model != 'scrum' and $value->id == 'plan') continue;
$this->bug->printCell($value, $bug, $users, $builds, $branchOption, $modulePairs, $executions, $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table', $projectPairs);
}
?>
<?php endif;?>
</tr>
<?php endforeach;?>
+7 -5
View File
@@ -1109,13 +1109,16 @@ 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']);
if(!$project->hasProduct)
{
unset($this->config->bug->search['fields']['product']);
if($project->model != 'scrum') unset($this->config->bug->search['fields']['plan']);
}
$productPairs = array('0' => $this->lang->product->all);
foreach($products as $productData) $productPairs[$productData->id] = $productData->name;
$hasProduct = $this->dao->findByID($projectID)->from(TABLE_PROJECT)->fetch('hasProduct');
if($hasProduct) $this->lang->modulePageNav = $this->product->select($productPairs, $productID, 'project', 'bug', $projectID, $branchID);
if($project->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;
@@ -1203,7 +1206,7 @@ class project extends control
$this->view->pager = $pager;
$this->view->orderBy = $orderBy;
$this->view->productID = $productID;
$this->view->project = $this->project->getById($projectID);
$this->view->project = $project;
$this->view->branchID = empty($this->view->build->branch) ? $branchID : $this->view->build->branch;
$this->view->memberPairs = $memberPairs;
$this->view->type = $type;
@@ -1225,7 +1228,6 @@ class project extends control
$this->view->setModule = true;
$this->view->showBranch = false;
$this->display();
}
+8 -1
View File
@@ -96,6 +96,8 @@
<?php
foreach($setting as $key => $value)
{
if(!$project->hasProduct and $project->model != 'scrum' and $value->id == 'plan') continue;
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars, $canBatchAssignTo);
@@ -112,7 +114,12 @@
$arrtibute = $canBeChanged ? '' : 'disabled';
?>
<tr data-id='<?php echo $bug->id?>'>
<?php foreach($setting as $value) $this->bug->printCell($value, $bug, $users, $builds, $branchOption, $modulePairs, $executions, $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table', $projectPairs);?>
<?php foreach($setting as $value)
{
if(!$project->hasProduct and $project->model != 'scrum' and $value->id == 'plan') continue;
$this->bug->printCell($value, $bug, $users, $builds, $branchOption, $modulePairs, $executions, $plans, $stories, $tasks, $useDatatable ? 'datatable' : 'table', $projectPairs);
}
?>
</tr>
<?php endforeach;?>
</tbody>