From 26a21964f86b60c05d066dee672d4ff7ec22297c Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 21 Sep 2022 15:02:17 +0800 Subject: [PATCH 01/79] * Finish task #70015. --- module/product/view/browse.html.php | 4 +- module/story/config.php | 2 +- module/story/model.php | 72 +++++++++++++++++++---------- 3 files changed, 51 insertions(+), 27 deletions(-) diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index dc25677ab2..d0855db0fa 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -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); } }?> - $value) $this->story->printCell($value, $story, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table');?> + $value) $this->story->printCell($value, $story, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', $storyType);?> children)):?> diff --git a/module/story/config.php b/module/story/config.php index a494269437..3bb727d5fc 100644 --- a/module/story/config.php +++ b/module/story/config.php @@ -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'; diff --git a/module/story/model.php b/module/story/model.php index da1161f4a3..ccddf5ed9d 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -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 .= "
"; - $menu .= ""; - $menu .= ""; - $menu .= "
"; - } 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 .= "
"; - } + $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 .= "
"; + } + } + + 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 .= "
"; + } + } + + 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=¶m=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=¶m=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 .= "
"; + } + $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 .= "
"; + } + + $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 ''; From 0e0d13b0a0875ebc52fe47a31eb0cd25b0089e45 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 26 Sep 2022 10:52:36 +0800 Subject: [PATCH 02/79] * Finish task #70015. --- module/execution/css/story.css | 1 + module/product/view/browse.html.php | 2 +- module/story/model.php | 31 ++++++++++++++++------------- 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/module/execution/css/story.css b/module/execution/css/story.css index 3c75842a66..9213919db3 100644 --- a/module/execution/css/story.css +++ b/module/execution/css/story.css @@ -20,3 +20,4 @@ th.c-pri{width:50px;} .switchBtn {background-color: #fff !important;} .switchBtn > i {padding-left: 7px;} #main>.container {padding: 0 20px 20px 23px;} +#executionStoryForm table tbody tr td.c-actions .dividing-line {width: 1px; height: 16px; display: inline-block; vertical-align: middle; background: #EDEEF2; margin: 0 4px 0 0;} diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index bc8f27eac6..fafa8067c9 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -43,7 +43,7 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : ''; .btn-group button.dropdown-toggle.btn-secondary, .btn-group button.dropdown-toggle.btn-primary {padding:6px;} #productStoryForm table tbody tr td.c-actions {overflow: visible;} -#productStoryForm table tbody tr td.c-actions .dividing-line {width: 1px; height: 16px; display: inline-block; vertical-align: middle; background: #E4E4E4; margin: 0 4px 0 0;} +#productStoryForm table tbody tr td.c-actions .dividing-line {width: 1px; height: 16px; display: inline-block; vertical-align: middle; background: #EDEEF2; margin: 0 4px 0 0;}