From 2e5d2d563ca0a7bb3c4a3c7e8d8f37d43ec90a56 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Mon, 7 Nov 2022 16:50:21 +0800 Subject: [PATCH 1/6] * fix bug #29363 --- module/programplan/view/gantt.html.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/module/programplan/view/gantt.html.php b/module/programplan/view/gantt.html.php index 6b1f88c074..f813da4215 100644 --- a/module/programplan/view/gantt.html.php +++ b/module/programplan/view/gantt.html.php @@ -113,7 +113,15 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;} $typeHtml .= ''; ?> From bdfb04fabfde1f265d6af69cbac0bb7d18ec0907 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 8 Nov 2022 09:49:17 +0800 Subject: [PATCH 2/6] * finish task #75318 --- module/story/lang/de.php | 1 + module/story/lang/en.php | 1 + module/story/lang/fr.php | 1 + module/story/lang/zh-cn.php | 1 + module/story/model.php | 11 +++++++++++ 5 files changed, 15 insertions(+) diff --git a/module/story/lang/de.php b/module/story/lang/de.php index d5e3e08eb7..16c752a2f1 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -321,6 +321,7 @@ $lang->story->errorDuplicateStory = $lang->SRCommon . '%s not exist'; $lang->story->confirmRecallChange = "After undo the change, the story content will revert to the version before the change. Are you sure you want to undo?"; $lang->story->confirmRecallReview = "Are you sure you want to withdraw the review?"; $lang->story->noStoryToTask = "Only the activated {$lang->SRCommon} can be converted into a task!"; +$lang->story->ignoreClosedStory = "{$lang->SRCommon} %s status is closed, and the operation has been filtered."; $lang->story->form = new stdclass(); $lang->story->form->area = 'Story Bereich'; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 10e9e56319..d9ebecd239 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -321,6 +321,7 @@ $lang->story->errorDuplicateStory = $lang->SRCommon . '%s not exist'; $lang->story->confirmRecallChange = "After undo the change, the story content will revert to the version before the change. Are you sure you want to undo?"; $lang->story->confirmRecallReview = "Are you sure you want to withdraw the review?"; $lang->story->noStoryToTask = "Only the activated {$lang->SRCommon} can be converted into a task!"; +$lang->story->ignoreClosedStory = "{$lang->SRCommon} %s status is closed, and the operation has been filtered."; $lang->story->form = new stdclass(); $lang->story->form->area = 'Scope'; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index 9f33cdc716..33fd6110bf 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -321,6 +321,7 @@ $lang->story->errorDuplicateStory = $lang->SRCommon . '%s not exist'; $lang->story->confirmRecallChange = "After undo the change, the story content will revert to the version before the change. Are you sure you want to undo?"; $lang->story->confirmRecallReview = "Are you sure you want to withdraw the review?"; $lang->story->noStoryToTask = "Only the activated {$lang->SRCommon} can be converted into a task!"; +$lang->story->ignoreClosedStory = "{$lang->SRCommon} %s status is closed, and the operation has been filtered."; $lang->story->form = new stdclass(); $lang->story->form->area = 'Périmètre'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 8e5b9c9e70..5606abccc7 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -321,6 +321,7 @@ $lang->story->errorDuplicateStory = $lang->SRCommon . '%s不存在'; $lang->story->confirmRecallChange = "撤销变更后,需求内容会回退至变更前的版本,您确定要撤销吗?"; $lang->story->confirmRecallReview = "您确定要撤回评审吗?"; $lang->story->noStoryToTask = "只有激活的{$lang->SRCommon}才能转为任务!"; +$lang->story->ignoreClosedStory = "{$lang->SRCommon} %s 状态为已关闭,本次操作已被过滤。"; $lang->story->form = new stdclass(); $lang->story->form->area = "该{$lang->SRCommon}所属范围"; diff --git a/module/story/model.php b/module/story/model.php index d733cd0a2b..f3ec4081a3 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2512,9 +2512,15 @@ class storyModel extends model $storyIdList = $this->post->storyIdList; $assignedTo = $this->post->assignedTo; $oldStories = $this->getByList($storyIdList); + $ignoreStories = ''; foreach($storyIdList as $storyID) { $oldStory = $oldStories[$storyID]; + if($oldStory->status == 'closed') + { + $ignoreStories .= "#{$storyID},"; + continue; + } if($assignedTo == $oldStory->assignedTo) continue; $story = new stdclass(); @@ -2527,6 +2533,11 @@ class storyModel extends model $allChanges[$storyID] = common::createChanges($oldStory, $story); } + if($ignoreStories) + { + $ignoreStories = trim($ignoreStories, ','); + echo js::alert(sprintf($this->lang->story->ignoreClosedStory, $ignoreStories)); + } return $allChanges; } From 7a693a22b4f3b647061c64284c3835f11b52201d Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 8 Nov 2022 09:51:08 +0800 Subject: [PATCH 3/6] * finish task #75318 --- module/programplan/view/gantt.html.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/module/programplan/view/gantt.html.php b/module/programplan/view/gantt.html.php index f813da4215..8a0d38f739 100644 --- a/module/programplan/view/gantt.html.php +++ b/module/programplan/view/gantt.html.php @@ -113,15 +113,7 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;} $typeHtml .= ''; ?> From cd3c59b56b88828282c92524720d7267d2615d09 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 8 Nov 2022 09:51:30 +0800 Subject: [PATCH 4/6] * finish task #75318 --- module/programplan/view/gantt.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/programplan/view/gantt.html.php b/module/programplan/view/gantt.html.php index 8a0d38f739..6b1f88c074 100644 --- a/module/programplan/view/gantt.html.php +++ b/module/programplan/view/gantt.html.php @@ -113,7 +113,7 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;} $typeHtml .= ''; ?> From 70fd4798018dcf41329869a515d345e3e5ffa591 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 8 Nov 2022 13:58:34 +0800 Subject: [PATCH 5/6] * finish task #75327 --- module/product/control.php | 9 ++++++++- module/story/control.php | 2 +- module/story/js/create.js | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index 76a023a307..0adc83f41a 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -1078,7 +1078,14 @@ class product extends control public function ajaxGetPlans($productID, $branch = 0, $planID = 0, $fieldID = '', $needCreate = false, $expired = '', $param = '') { $param = strtolower($param); - $plans = $this->loadModel('productplan')->getPairs($productID, $branch, $expired, strpos($param, 'skipparent') !== false); + if(strpos($param, 'getpairsforstory') === false) + { + $plans = $this->loadModel('productplan')->getPairs($productID, $branch, $expired, strpos($param, 'skipparent') !== false); + } + else + { + $plans = $this->loadModel('productplan')->getPairsForStory($productID, $branch, $param); + } $field = $fieldID !== '' ? "plans[$fieldID]" : 'plan'; $multiple = strpos($param, 'multiple') === false ? '' : 'multiple'; $output = html::select($field, $plans, $planID, "class='form-control chosen' $multiple"); diff --git a/module/story/control.php b/module/story/control.php index 95eef188c1..3cd185d431 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -408,7 +408,7 @@ class story extends control $this->view->users = $users; $this->view->moduleID = $moduleID; $this->view->moduleOptionMenu = $moduleOptionMenu; - $this->view->plans = str_replace('2030-01-01', $this->lang->story->undetermined, $this->loadModel('productplan')->getPairsForStory($productID, $branch, 'skipParent|unexpired|noclosed')); + $this->view->plans = str_replace('2030-01-01', $this->lang->story->undetermined, $this->loadModel('productplan')->getPairsForStory($productID, $branch == 0 ? '' : $branch, 'skipParent|unexpired|noclosed')); $this->view->planID = $planID; $this->view->source = $source; $this->view->sourceNote = $sourceNote; diff --git a/module/story/js/create.js b/module/story/js/create.js index a2eb3e7f67..eab048da18 100644 --- a/module/story/js/create.js +++ b/module/story/js/create.js @@ -238,7 +238,7 @@ function loadPlanForSiblings(productID, branch, branchIndex) { /* Load plan */ if(branch == '0') branch = ''; - planLink = createLink('product', 'ajaxGetPlans', 'productID=' + productID + '&branch=' + branch + '&planID=' + $('#plan').val() + '&fieldID=' + branchIndex + '&needCreate=false&expired=unexpired¶m=skipParent,' + config.currentMethod); + planLink = createLink('product', 'ajaxGetPlans', 'productID=' + productID + '&branch=' + branch + '&planID=0&fieldID=' + branchIndex + '&needCreate=false&expired=unexpired¶m=skipParent|getpairsforstory,' + config.currentMethod); if(branchIndex > 0) { var $planIdBox = $('.addBranchesBox'+ branchIndex +' #planIdBox'); From 6367ecd138426e8fedbd3d41c8cc6b8933271bf8 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Tue, 8 Nov 2022 14:12:37 +0800 Subject: [PATCH 6/6] * finish task #75328 --- module/story/view/header.html.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/module/story/view/header.html.php b/module/story/view/header.html.php index 0603e0dc7b..0cbe4db07e 100644 --- a/module/story/view/header.html.php +++ b/module/story/view/header.html.php @@ -128,6 +128,11 @@ function loadProductBranches(productID) loadModuleForSiblings(productID, 0, 0) loadPlanForSiblings(productID, 0, 0) } + else + { + loadProductModules(productID, 0); + loadProductPlans(productID, 0); + } } else { @@ -191,7 +196,7 @@ function loadProductPlans(productID, branch) if(!branch) branch = 0; var expired = config.currentMethod == 'create' ? 'unexpired' : ''; planLink = createLink('product', 'ajaxGetPlans', 'productID=' + productID + '&branch=' + branch + '&planID=' + $('#plan').val() + '&fieldID=&needCreate=true&expired='+ expired +'¶m=skipParent,' + config.currentMethod); - var $planIdBox = $('#planIdBox'); + var $planIdBox = $('.switchBranch #planIdBox'); $planIdBox.load(planLink, function() { $planIdBox.find('#plan').chosen();