* Finish task #70015.

This commit is contained in:
tianshujie
2022-09-21 15:02:17 +08:00
parent d7f9b703af
commit 26a21964f8
3 changed files with 51 additions and 27 deletions
+2 -2
View File
@@ -346,11 +346,11 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : '';
{
if($value->id == 'title' || $value->id == 'id' || $value->id == 'pri' || $value->id == 'status')
{
$this->story->printCell($value, $story, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table');
$this->story->printCell($value, $story, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', $storyType);
}
}?>
<?php else:?>
<?php foreach($setting as $key => $value) $this->story->printCell($value, $story, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table');?>
<?php foreach($setting as $key => $value) $this->story->printCell($value, $story, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', $storyType);?>
<?php endif;?>
</tr>
<?php if(!empty($story->children)):?>
+1 -1
View File
@@ -259,5 +259,5 @@ $config->story->datatable->fieldList['caseCount']['name'] = $lang->story->ca
$config->story->datatable->fieldList['actions']['title'] = 'actions';
$config->story->datatable->fieldList['actions']['fixed'] = 'right';
$config->story->datatable->fieldList['actions']['width'] = $app->tab == 'project' ? '220' : '200';
$config->story->datatable->fieldList['actions']['width'] = $app->tab == 'project' ? '220' : '210';
$config->story->datatable->fieldList['actions']['required'] = 'yes';
+48 -24
View File
@@ -4207,10 +4207,12 @@ class storyModel extends model
*
* @param object $story
* @param string $type
* @param object $execution
* @param string $storyType story|requirement
* @access public
* @return string
*/
public function buildOperateMenu($story, $type = 'view', $execution = '')
public function buildOperateMenu($story, $type = 'view', $execution = '', $storyType = 'story')
{
$menu = '';
$params = "storyID=$story->id";
@@ -4255,30 +4257,30 @@ class storyModel extends model
$isClick = $this->isClickable($story, 'recall');
$title = $story->status == 'changing' ? $this->lang->story->recallChange : $this->lang->story->recall;
$title = $isClick ? $title : $this->lang->story->recallTip['actived'];
$storyPriv = array(common::hasPriv('story', 'change'), common::hasPriv('story', 'submitReview'), common::hasPriv('story', 'review'), common::hasPriv('story', 'close'));
$storyPrivCount = array_sum($storyPriv);
if($this->app->tab == 'product' and common::hasPriv('story', 'recall') && ($storyPrivCount > 1))
{
$menu .= "<div class='btn-group dropup' style='margin-left:-5px;'>";
$menu .= "<button type='button' class='btn icon-caret-down dropdown-toggle' data-toggle='dropdown' title='{$this->lang->more}' style='width: 16px; padding-left: 0px;'></button>";
$menu .= "<ul class='dropdown-menu pull-right text-center' role='menu' style='min-width:auto; padding: 5px;'>";
$menu .= $this->buildMenu('story', 'recall', $params . "&from=list&confirm=no&storyType=$story->type", $story, $type, 'undo', 'hiddenwin', 'showinonlybody', false, '', $title);
$menu .= "</ul>";
$menu .= "</div>";
} else {
$menu .= $this->buildMenu('story', 'recall', $params . "&from=list&confirm=no&storyType=$story->type", $story, $type, 'undo', 'hiddenwin', 'showinonlybody', false, '', $title);
}
$menu .= $this->buildMenu('story', 'close', $params . "&from=&storyType=$story->type", $story, $type, '', '', 'iframe', true);
if($this->app->tab == 'product' and (common::hasPriv('story', 'recall') or $storyPrivCount > 0) and (common::hasPriv('story', 'edit') or common::hasPriv('story', 'createCase') or common::hasPriv('story', 'batchCreate')))
{
$menu .= "<div class='dividing-line'></div>";
}
$menu .= $this->buildMenu('story', 'recall', $params . "&from=list&confirm=no&storyType=$story->type", $story, $type, 'undo', 'hiddenwin', 'showinonlybody', false, '', $title);
$menu .= $this->buildMenu('story', 'edit', $params . "&kanbanGroup=default&storyType=$story->type", $story, $type, '', '', 'showinonlybody');
if(in_array($this->app->tab, array('product', 'project')))
{
if((common::hasPriv('story', 'change') or common::hasPriv('story', 'review') or common::hasPriv('story', 'recall') or common::hasPriv('story', 'edit')) and ($storyType == 'story' and common::hasPriv('story', 'batchCreate') or common::hasPriv('testcase', 'create') or ($storyType == 'requirement' and common::hasPriv('story', 'close'))))
{
$menu .= "<div class='dividing-line'></div>";
}
}
if($this->app->tab == 'product' and $storyType == 'requirement')
{
$menu .= $this->buildMenu('story', 'close', $params . "&from=&storyType=$story->type", $story, $type, '', '', 'iframe', true);
if(common::hasPriv('story', 'close') and (common::hasPriv('testcase', 'create') or common::hasPriv('story', 'createCase')))
{
$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);
$tab = $this->app->tab == 'project' ? 'project' : 'qa';
if($story->type != 'requirement' and $this->config->vision != 'lite') $menu .= $this->buildMenu('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=&param=0&$params", $story, $type, 'sitemap', '', 'showinonlybody', false, "data-app='$tab'");
if($story->type != 'requirement' and $this->config->vision != 'lite') $menu .= $this->buildMenu('testcase', 'create', "productID=$story->product&branch=$story->branch&module=0&from=&param=0&$params", $story, $type, 'sitemap', '', 'showinonlybody', false, "data-app='$tab'");
if($this->app->rawModule != 'projectstory' OR $this->config->vision == 'lite')
{
@@ -4296,15 +4298,37 @@ class storyModel extends model
if($story->status == 'active' and $story->stage != 'wait') $title = sprintf($this->lang->story->subDivideTip['notWait'], zget($this->lang->story->stageList, $story->stage));
}
}
$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 == 'story' and common::hasPriv('story', 'batchCreate')) $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($this->app->rawModule == 'projectstory' and $this->config->vision != 'lite')
{
if(common::hasPriv('testcase', 'create') and (common::hasPriv('story', 'close') or common::hasPriv('projectstory', 'unlinkStory')))
{
$menu .= "<div class='dividing-line'></div>";
}
$menu .= $this->buildMenu('projectstory', 'unlinkStory', "projectID={$this->session->project}&$params", $story, $type, 'unlink', 'hiddenwin', 'showinonlybody');
$menu .= $this->buildMenu('story', 'close', $params . "&from=&storyType=$story->type", $story, $type, '', '', 'iframe', true);
}
if($this->app->tab == 'product' and $storyType == 'story')
{
if((common::hasPriv('story', 'batchCreate') or common::hasPriv('testcase', 'create')) and common::hasPriv('story', 'close'))
{
$menu .= "<div class='dividing-line'></div>";
}
$menu .= $this->buildMenu('story', 'close', $params . "&from=&storyType=$story->type", $story, $type, '', '', 'iframe', true);
}
if($this->app->rawModule == 'projectstory' and $this->config->vision != 'lite') $menu .= $this->buildMenu('projectstory', 'unlinkStory', "projectID={$this->session->project}&$params", $story, $type, 'unlink', 'hiddenwin', 'showinonlybody');
}
else
{
return $this->buildMenu('story', 'close', $params . "&from=&storyType=$story->type", $story, 'list', '', '', 'iframe', true);
}
}
if($type == 'view')
@@ -4889,7 +4913,7 @@ class storyModel extends model
$menuType = 'browse';
$execution = '';
}
echo $this->buildOperateMenu($story, $menuType, $execution);
echo $this->buildOperateMenu($story, $menuType, $execution, $storyType);
break;
}
echo '</td>';