From 14dd9807e9d1ecb7c312a3f2110a46cf8134d14d Mon Sep 17 00:00:00 2001 From: tanghucheng Date: Fri, 16 Sep 2022 13:13:26 +0800 Subject: [PATCH] * Finish task #69006. --- module/common/lang/de.php | 2 +- module/common/lang/en.php | 2 +- module/common/lang/fr.php | 2 +- module/common/lang/menu.php | 4 ++-- module/common/lang/zh-cn.php | 2 +- module/execution/control.php | 15 ++++++++++++--- module/execution/js/create.js | 2 +- module/execution/view/create.html.php | 7 +++++-- module/execution/view/edit.html.php | 7 +++++-- module/execution/view/view.html.php | 4 +++- 10 files changed, 32 insertions(+), 15 deletions(-) diff --git a/module/common/lang/de.php b/module/common/lang/de.php index 6518dd9646..2d3f67c397 100644 --- a/module/common/lang/de.php +++ b/module/common/lang/de.php @@ -156,6 +156,7 @@ $lang->pri = 'Priority'; $lang->delayed = 'Delayed'; $lang->common->common = 'Standard Module'; +$lang->common->story = 'Story' $lang->my->common = 'My'; $lang->program->common = 'Program'; $lang->product->common = 'Product'; @@ -170,7 +171,6 @@ $lang->report->common = 'Statistic'; $lang->system->common = 'System'; $lang->admin->common = 'Admin'; $lang->story->common = 'Story'; -$lang->story->story = 'Story' $lang->task->common = 'Task'; $lang->bug->common = 'Bug'; $lang->testcase->common = 'Testcase'; diff --git a/module/common/lang/en.php b/module/common/lang/en.php index c72a009bf2..ebc4c2cd37 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -156,6 +156,7 @@ $lang->pri = 'Priority'; $lang->delayed = 'Delayed'; $lang->common->common = 'Common Module'; +$lang->common->story = 'Story' $lang->my->common = 'My'; $lang->program->common = 'Program'; $lang->product->common = 'Product'; @@ -170,7 +171,6 @@ $lang->report->common = 'Statistic'; $lang->system->common = 'System'; $lang->admin->common = 'Admin'; $lang->story->common = 'Story'; -$lang->story->story = 'Story' $lang->task->common = 'Task'; $lang->bug->common = 'Bug'; $lang->testcase->common = 'Testcase'; diff --git a/module/common/lang/fr.php b/module/common/lang/fr.php index 5c94767774..c15320b1c9 100644 --- a/module/common/lang/fr.php +++ b/module/common/lang/fr.php @@ -156,6 +156,7 @@ $lang->pri = 'Priority'; $lang->delayed = 'Delayed'; $lang->common->common = 'Module Commun'; +$lang->common->story = 'Story' $lang->my->common = 'My'; $lang->program->common = 'Program'; $lang->product->common = 'Product'; @@ -170,7 +171,6 @@ $lang->report->common = 'Statistic'; $lang->system->common = 'System'; $lang->admin->common = 'Admin'; $lang->story->common = 'Story'; -$lang->story->story = 'Story' $lang->task->common = 'Task'; $lang->bug->common = 'Bug'; $lang->testcase->common = 'Testcase'; diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index d5daec84cb..c383464195 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -202,7 +202,7 @@ if($config->systemMode == 'new') $lang->project->homeMenu->kanban = array('link' $lang->scrum->menu = new stdclass(); $lang->scrum->menu->index = array('link' => "{$lang->dashboard}|project|index|project=%s"); $lang->scrum->menu->execution = array('link' => "$lang->executionCommon|project|execution|status=all&projectID=%s", 'exclude' => 'execution-testreport', 'subModule' => 'task'); -$lang->scrum->menu->storyGroup = array('link' => "{$lang->story->story}|projectstory|story|projectID=%s&product=%s",'class' => 'dropdown dropdown-hover'); +$lang->scrum->menu->storyGroup = array('link' => "{$lang->common->story}|projectstory|story|projectID=%s&product=%s",'class' => 'dropdown dropdown-hover'); $lang->scrum->menu->story = array('link' => "$lang->SRCommon|projectstory|story|projectID=%s|story", 'subModule' => 'projectstory,tree', 'alias' => 'story,track'); $lang->scrum->menu->doc = array('link' => "{$lang->doc->common}|doc|tableContents|type=project&objectID=%s", 'subModule' => 'doc'); $lang->scrum->menu->qa = array('link' => "{$lang->qa->common}|project|bug|projectID=%s", 'subModule' => 'testcase,testtask,bug,testreport,execution', 'alias' => 'bug,testtask,testcase,testreport', 'exclude' => 'execution-create,execution-batchedit'); @@ -253,7 +253,7 @@ $lang->scrum->menu->settings['subMenu']->module = array('link' => "{$lang-> $lang->waterfall->menu = new stdclass(); $lang->waterfall->menu->index = array('link' => "$lang->dashboard|project|index|project=%s"); $lang->waterfall->menu->execution = array('link' => "{$lang->stage->common}|project|execution|status=all&projectID=%s", 'subModule' => 'programplan,task'); -$lang->waterfall->menu->storyGroup = array('link' => "{$lang->story->story}|projectstory|story|projectID=%s",'class' => 'dropdown dropdown-hover'); +$lang->waterfall->menu->storyGroup = array('link' => "{$lang->common->story}|projectstory|story|projectID=%s",'class' => 'dropdown dropdown-hover'); $lang->waterfall->menu->story = array('link' => "$lang->SRCommon|projectstory|story|projectID=%s", 'subModule' => 'projectstory,tree', 'alias' => 'story,track'); $lang->waterfall->menu->design = array('link' => "{$lang->design->common}|design|browse|project=%s"); $lang->waterfall->menu->qa = array('link' => "{$lang->qa->common}|project|bug|projectID=%s", 'subModule' => 'testcase,testtask,bug,testreport', 'alias' => 'bug,testtask,testcase,testreport'); diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 9ebbc58379..36cdc57167 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -156,6 +156,7 @@ $lang->pri = '优先级'; $lang->delayed = '已延期'; $lang->common->common = '公有模块'; +$lang->common->story = '需求'; $lang->my->common = '地盘'; $lang->program->common = '项目集'; $lang->product->common = '产品'; @@ -170,7 +171,6 @@ $lang->report->common = '统计'; $lang->system->common = '组织'; $lang->admin->common = '后台'; $lang->story->common = $lang->SRCommon; -$lang->story->story = '需求'; $lang->task->common = '任务'; $lang->bug->common = 'Bug'; $lang->testcase->common = '用例'; diff --git a/module/execution/control.php b/module/execution/control.php index 140d8f0b7e..0576110f86 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -850,7 +850,10 @@ class execution extends control $projectID = $execution->project; $project = $this->loadModel('project')->getByID($projectID); - if(empty($project->hasProduct)) unset($this->config->product->search['fields']['product']); + + if(empty($project->hasProduct)) unset($this->config->product->search['fields']['product']); + if(empty($project->hasProduct) and $project->model != 'scrum') unset($this->config->product->search['fields']['plan']); + $this->execution->buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, 'executionStory', $executionID); /* Header and position. */ @@ -1659,7 +1662,8 @@ class execution extends control $this->execution->updateProducts($executionID); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - $this->loadModel('action')->create($this->objectType, $executionID, 'opened', '', join(',', $_POST['products'])); + $comment = $project->hasProduct ? join(',', $_POST['products']) : ''; + $this->loadModel('action')->create($this->objectType, $executionID, 'opened', '', $comment); $message = $this->executeHooks($executionID); if($message) $this->lang->saveSuccess = $message; @@ -1726,12 +1730,15 @@ class execution extends control $copyProjects = $this->loadModel('project')->getPairsByProgram(isset($project->parent) ? $project->parent : '', 'noclosed', '', 'order_asc', '', isset($project->model) ? $project->model : ''); $copyProjectID = ($projectID == 0) ? key($copyProjects) : $projectID; + if(!empty($project->hasProduct)) $allProducts = array(0 => '') + $allProducts; + if(isset($project->hasProduct) and $project->hasProduct == 0) $this->lang->execution->PO = $this->lang->common->story . $this->lang->execution->owner; + $this->view->title = (($this->app->tab == 'execution') and ($this->config->systemMode == 'new')) ? $this->lang->execution->createExec : $this->lang->execution->create; $this->view->position[] = $this->view->title; $this->view->gobackLink = (isset($output['from']) and $output['from'] == 'global') ? $this->createLink('execution', 'all') : ''; $this->view->executions = array('' => '') + $this->execution->getList($projectID); $this->view->groups = $this->loadModel('group')->getPairs(); - $this->view->allProducts = array(0 => '') + $allProducts; + $this->view->allProducts = $allProducts; $this->view->acl = $acl; $this->view->plan = $plan; $this->view->name = $name; @@ -1923,6 +1930,7 @@ class execution extends control if(!empty($this->config->user->moreLink)) $this->config->moreLinks["RD"] = $this->config->user->moreLink; $project = $this->project->getById($execution->project); + if(!$project->hasProduct) $this->lang->execution->PO = $this->lang->common->story . $this->lang->execution->owner; $this->view->title = $title; $this->view->position = $position; @@ -2349,6 +2357,7 @@ class execution extends control $pager = new pager(0, 30, 1); $this->executeHooks($executionID); + if(!$execution->projectInfo->hasProduct) $this->lang->execution->PO = $this->lang->common->story . $this->lang->execution->owner; $this->view->title = $this->lang->execution->view; $this->view->position[] = html::a($this->createLink('execution', 'browse', "executionID=$executionID"), $execution->name); diff --git a/module/execution/js/create.js b/module/execution/js/create.js index ecf65d9fc2..32fe77810a 100644 --- a/module/execution/js/create.js +++ b/module/execution/js/create.js @@ -42,7 +42,7 @@ $(function() var adjustMainCol = function() { - if(!isStage) $('.main-form .col-main').css('width', Math.max(250, Math.floor(($('#productsBox').outerWidth() - 50)/3) + 10)); + $('.main-form .col-main').css('width', Math.max(250, Math.floor(($('#tplBoxWrapper').parent('td').outerWidth() - 50)/3) + 10)); }; adjustMainCol(); $(window).on('resize', adjustMainCol); diff --git a/module/execution/view/create.html.php b/module/execution/view/create.html.php index 4da8c28962..cb796adfa2 100644 --- a/module/execution/view/create.html.php +++ b/module/execution/view/create.html.php @@ -132,7 +132,9 @@ printExtendFields('', 'table', 'columns=3');?> - + + hasProduct)) $hidden = ''?> + execution->manageProducts;?>
@@ -159,7 +161,8 @@
- + model) and $project->model == 'scrum') $hidden = '';?> + execution->linkPlan;?>
diff --git a/module/execution/view/edit.html.php b/module/execution/view/edit.html.php index 5f98f51b32..f9fe3468fe 100644 --- a/module/execution/view/edit.html.php +++ b/module/execution/view/edit.html.php @@ -139,7 +139,9 @@ attribute, array('request', 'design', 'review'))): ?> - + + hasProduct)) $hidden = ''?> + execution->manageProducts;?> grade == 2 ? "readonly='readonly'" : '';?> @@ -174,7 +176,8 @@
- + model) and $project->model == 'scrum') $hidden = '';?> + execution->linkPlan;?>
diff --git a/module/execution/view/view.html.php b/module/execution/view/view.html.php index 58e6974ed6..405d479d7a 100644 --- a/module/execution/view/view.html.php +++ b/module/execution/view/view.html.php @@ -327,7 +327,7 @@
- attribute, array('request', 'design', 'review'))): ?> + attribute, array('request', 'design', 'review')) and $execution->projectInfo->hasProduct): ?>
execution->manageProducts;?> @@ -347,6 +347,7 @@
+ projectInfo->hasProduct or $execution->projectInfo->model == 'scrum'):?>
execution->linkPlan;?>
@@ -367,6 +368,7 @@
+
execution->lblStats;?>