* Finish task #72674.

This commit is contained in:
Yagami
2022-10-19 15:36:15 +08:00
parent c330b6bc06
commit 187d3b8ca4
11 changed files with 60 additions and 32 deletions
+3 -3
View File
@@ -344,7 +344,7 @@ $lang->execution->menu->view = array('link' => "$lang->view|execution|grouptas
if($config->edition != 'open') $lang->execution->menu->view = array('link' => "$lang->view|execution|gantt|executionID=%s", 'alias' => 'grouptask,tree,taskeffort,gantt,calendar,relation,maintainrelation');
$lang->execution->menu->storyGroup = array('link' => "{$lang->common->story}|execution|story|executionID=%s",'class' => 'dropdown dropdown-hover', 'subModule' => 'story', 'alias' => 'batchcreate,storykanban');
$lang->execution->menu->story = array('link' => "$lang->SRCommon|execution|story|executionID=%s", 'subModule' => 'story', 'alias' => 'batchcreate,linkstory,storykanban,batchtotask');
$lang->execution->menu->story = array('link' => "$lang->SRCommon|execution|story|executionID=%s", 'subModule' => 'story');
$lang->execution->menu->qa = array('link' => "{$lang->qa->common}|execution|bug|executionID=%s", 'subModule' => 'bug,testcase,testtask,testreport', 'alias' => 'qa,bug,testcase,testtask,testreport');
$lang->execution->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo');
$lang->execution->menu->doc = array('link' => "{$lang->doc->common}|doc|tableContents|type=execution&objectID=%s", 'subModule' => 'doc');
@@ -354,8 +354,8 @@ $lang->execution->menu->settings = array('link' => "$lang->settings|execution|
$lang->execution->menu->more = array('link' => "$lang->more|execution|more|%s");
$lang->execution->menu->storyGroup['dropMenu'] = new stdclass();
$lang->execution->menu->storyGroup['dropMenu']->story = array('link' => "{$lang->SRCommon}|execution|story|executionID=%s");
$lang->execution->menu->storyGroup['dropMenu']->requirement = array('link' => "{$lang->URCommon}|execution|story|executionID=%s&storyType=requirement");
$lang->execution->menu->storyGroup['dropMenu']->story = array('link' => "{$lang->SRCommon}|execution|story|executionID=%s", 'subModule' => 'story');
$lang->execution->menu->storyGroup['dropMenu']->requirement = array('link' => "{$lang->URCommon}|execution|story|executionID=%s&storyType=requirement", 'subModule' => 'story');
/* Execution menu order. */
$lang->execution->menuOrder[5] = 'task';
+7 -4
View File
@@ -113,10 +113,13 @@ class datatable extends control
{
$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']);
}
if(!$project->hasProduct and $project->model != 'scrum') unset($cols['plan']);
}
if($moduleName == 'execution' and $method == 'story')
{
$execution = $this->loadModel('execution')->getByID($this->session->execution);
if(!$execution->hasProduct and !$execution->multiple) unset($cols['plan']);
}
$this->view->cols = $cols;
-1
View File
@@ -128,7 +128,6 @@ class executionModel extends model
$this->loadModel('project')->setNoMultipleMenu($executionID);
if(isset($this->lang->execution->menu->storyGroup)) unset($this->lang->execution->menu->storyGroup);
if(isset($this->lang->project->menu->storyGroup)) unset($this->lang->project->menu->storyGroup);
}
/**
+14 -2
View File
@@ -224,6 +224,12 @@
$vars = "executionID={$execution->id}&orderBy=%s&type=$type&param=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
if($useDatatable) include '../../common/view/datatable.html.php';
if(!$execution->hasProduct and !$execution->multiple)
{
$planKey = array_search('plan', $config->story->datatable->defaultField);
if($planKey) unset($config->story->datatable->defaultField[$planKey]);
}
$setting = $this->datatable->getSetting('execution');
$widths = $this->datatable->setFixedFieldWidth($setting);
$columns = 0;
@@ -246,6 +252,7 @@
<?php
foreach($setting as $key => $value)
{
if(!$execution->hasProduct and !$execution->multiple and $value->id == 'plan') continue;
if($value->show)
{
$this->datatable->printHead($value, $orderBy, $vars, $canBatchAction);
@@ -263,6 +270,7 @@
<tr id="story<?php echo $story->id;?>" data-id='<?php echo $story->id;?>' data-order='<?php echo $story->order ?>' data-estimate='<?php echo $story->estimate?>' data-cases='<?php echo zget($storyCases, $story->id, 0)?>'>
<?php foreach($setting as $key => $value)
{
if(!$execution->hasProduct and !$execution->multiple and $value->id == 'plan') continue;
$this->story->printCell($value, $story, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', 'story', $execution, $showBranch);
}
?>
@@ -274,7 +282,11 @@
<?php $class = $i == 0 ? ' table-child-top' : '';?>
<?php $class .= ($i + 1 == count($story->children)) ? ' table-child-bottom' : '';?>
<tr class='table-children<?php echo $class;?> parent-<?php echo $story->id;?>' data-id='<?php echo $child->id?>' data-status='<?php echo $child->status?>' data-estimate='<?php echo $child->estimate?>' data-cases='<?php echo zget($storyCases, $story->id, 0);?>'>
<?php foreach($setting as $key => $value) $this->story->printCell($value, $child, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', $storyType, $execution);?>
<?php foreach($setting as $key => $value)
{
if(!$execution->hasProduct and !$execution->multiple and $value->id == 'plan') continue;
$this->story->printCell($value, $child, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', $storyType, $execution);
}?>
</tr>
<?php $i ++;?>
<?php endforeach;?>
@@ -291,7 +303,7 @@
<div class='btn-group dropup'>
<?php
$disabled = $canBatchEdit ? '' : "disabled='disabled'";
$actionLink = $this->createLink('story', 'batchEdit', "productID=0&executionID=$execution->id");
$actionLink = $this->createLink('story', 'batchEdit', "productID=0&executionID=$execution->id&branch=0&storyType=$storyType");
echo html::commonButton($lang->edit, "data-form-action='$actionLink' $disabled");
?>
<?php if($canBatchToTask):?>
+1 -1
View File
@@ -571,7 +571,7 @@ class programModel extends model
->leftJoin(TABLE_STAKEHOLDER)->alias('t3')->on('t1.id=t3.objectID')
->where('t1.deleted')->eq('0')
->andWhere('t1.vision')->eq($this->config->vision)
->beginIF($browseType == 'bysearch')->andWhere($query)->fi()
->beginIF($browseType == 'bysearch' and $query)->andWhere($query)->fi()
->andWhere('t1.type')->eq('project')
->beginIF($this->cookie->involved or $involved)->andWhere('t2.type')->eq('project')->fi()
->beginIF(!in_array($browseType, array('all', 'undone', 'bysearch', 'review', 'unclosed'), true))->andWhere('t1.status')->eq($browseType)->fi()
+1
View File
@@ -2739,6 +2739,7 @@ class projectModel extends model
}
}
if(isset($this->lang->$navGroup->menu->storyGroup)) unset($this->lang->$navGroup->menu->storyGroup);
foreach($this->lang->$navGroup->menu as $label => $menu)
{
$objectID = 0;
+23 -8
View File
@@ -411,6 +411,7 @@ class story extends control
$this->view->hiddenProduct = true;
if($project->model !== 'scrum') $this->view->hiddenPlan = true;
if(!$project->multiple) $this->view->hiddenPlan = true;
if($project->model === 'kanban') $this->view->hiddenURS = true;
}
}
@@ -509,9 +510,9 @@ class story extends control
$this->lang->navGroup->story = 'execution';
}
$this->view->execution = $execution;
/* Hidden some fields of projects without products. */
if(in_array($execution->type, array('project', 'kanban', 'stage'), true))
/* Hidden some fields of projects without products. */
if($this->app->tab == 'project' or $this->app->tab == 'execution')
{
$project = $this->dao->findById((int)$executionID)->from(TABLE_PROJECT)->fetch();
if(!empty($project->project)) $project = $this->dao->findById((int)$project->project)->from(TABLE_PROJECT)->fetch();
@@ -520,7 +521,8 @@ class story extends control
{
$this->view->hiddenProduct = true;
if($project->model !== 'scrum') $this->view->hiddenPlan = true;
if($project->model !== 'scrum') $this->view->hiddenPlan = true;
if(!$project->multiple) $this->view->hiddenPlan = true;
}
}
}
@@ -887,6 +889,7 @@ class story extends control
$this->view->hiddenProduct = true;
if($project->model !== 'scrum') $this->view->hiddenPlan = true;
if(!$project->multiple) $this->view->hiddenPlan = true;
if($project->model === 'kanban') $this->view->hiddenURS = true;
}
@@ -949,13 +952,23 @@ class story extends control
{
$this->story->replaceURLang($storyType);
$this->view->hiddenPlan = false;
if($this->app->tab == 'product')
{
$this->product->setMenu($productID);
}
else if($this->app->tab == 'project')
{
$this->project->setMenu($executionID);
$project = $this->dao->findByID($executionID)->from(TABLE_PROJECT)->fetch();
if($project->type == 'project')
{
$this->project->setMenu($executionID);
}
else
{
if(!$project->hasProduct and !$project->multiple) $this->view->hiddenPlan = true;
$this->execution->setMenu($executionID);
}
}
else if($this->app->tab == 'execution')
{
@@ -1346,21 +1359,23 @@ class story extends control
$this->view->hiddenURS = false;
if(!empty($product->shadow))
{
$projectModel = $this->dao->select('t2.model')->from(TABLE_PROJECTPRODUCT)->alias('t1')
$projectInfo = $this->dao->select('t2.model, t2.multiple')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t1.product')->eq($product->id)
->andWhere('t2.type')->eq('project')
->fetch('model');
->fetch();
if($projectModel === 'waterfall')
if($projectInfo->model == 'waterfall')
{
$this->view->hiddenPlan = true;
}
elseif($projectModel === 'kanban')
elseif($projectInfo->model == 'kanban')
{
$this->view->hiddenPlan = true;
$this->view->hiddenURS = true;
}
if(!$projectInfo->multiple) $this->view->hiddenPlan = true;
}
if($product->type != 'normal') $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]);
-6
View File
@@ -8,12 +8,6 @@ $(function()
hiddenRequireFields();
});
if($("#navbar>ul>li[data-id='story'] .dropdown-menu").length)
{
$("#navbar>ul>li[data-id='story']>ul>li[data-id!='" + storyType + "']").removeClass('active');
$("#navbar>ul>li[data-id='story']>a").html($("#navbar>ul>li[data-id='story']>ul>li[data-id='" + storyType + "']").text() + "<span class='caret'></span>");
}
/* Implement a custom form without feeling refresh. */
$('#formSettingForm .btn-primary').click(function()
{
+7 -1
View File
@@ -10,7 +10,13 @@ $(function()
if(app != 'my') $('#navbar .nav li[data-id!=' + storyType + ']').removeClass('active');
$('#navbar .nav li[data-id=story]').addClass('active');
$('#subNavbar li[data-id="' + storyType + '"]').addClass('active');
if($('#navbar .nav>li[data-id=story] .dropdown-menu').length) $('#navbar .nav>li[data-id=story]>a').html($('#navbar .nav>li[data-id=story] .dropdown-menu [data-id=' + storyType + ']').text() + '<span class="caret"></span>');
}
if($('#navbar .nav>li[data-id=story] .dropdown-menu').length)
{
$("#navbar>ul>li[data-id='story']>ul>li[data-id!='" + storyType + "']").removeClass('active');
$("#navbar>ul>li[data-id='story']>ul>li[data-id='" + storyType + "']").addClass('active');
$('#navbar .nav>li[data-id=story]>a').html($('.active [data-id=' + storyType + ']').text() + '<span class="caret"></span>');
}
$('#saveButton').on('click', function()
-6
View File
@@ -1,11 +1,5 @@
$(function()
{
if($('#navbar .nav>li[data-id=story] .dropdown-menu').length)
{
$("#navbar>ul>li[data-id='story']>ul>li[data-id!='" + storyType + "']").removeClass('active');
$('#navbar .nav>li[data-id=story]>a').html($('.active [data-id=' + storyType + ']').text() + '<span class="caret"></span>');
}
if(canCreate)
{
link = createLink('story', 'create', 'productID=' + productID + "&branch=" + branch + '&moduleID=' + moduleID);
+4
View File
@@ -47,7 +47,9 @@ foreach(explode(',', $showFields) as $field)
<th class='c-branch<?php echo zget($visibleFields, 'branch', ' hidden')?>'><?php echo $lang->story->branch;?></th>
<?php endif;?>
<th class='c-module'><?php echo $lang->story->module;?></th>
<?php if(!$hiddenPlan):?>
<th class='c-plan<?php echo zget($visibleFields, 'plan', ' hidden')?> col-plan'><?php echo $lang->story->planAB;?></th>
<?php endif;?>
<th class='c-title required'><?php echo $lang->story->title;?></th>
<th class='c-estimate<?php echo zget($visibleFields, 'estimate', ' hidden')?>'> <?php echo $lang->story->estimateAB;?></th>
<th class='c-category'><?php echo $lang->story->category;?></th>
@@ -80,9 +82,11 @@ foreach(explode(',', $showFields) as $field)
<td class='text-left<?php echo zget($visibleFields, 'module')?>'>
<?php echo html::select("modules[$storyID]", zget($moduleList, $story->id, array(0 => '/')), $story->module, "class='form-control picker-select' data-drop-width='auto'");?>
</td>
<?php if(!$hiddenPlan):?>
<td class='text-left<?php echo zget($visibleFields, 'plan', ' hidden')?>'>
<?php echo html::select("plans[$storyID]", isset($plans[$story->product][$story->branch]) ? array('' => '') + $plans[$story->product][$story->branch] : '', $story->plan, "class='form-control picker-select' data-drop-width='auto'");?>
</td>
<?php endif;?>
<td title='<?php echo $story->title?>'>
<div class="input-group">
<div class="input-control has-icon-right story-input">