From 14dc9002cb293c06470b755c5f761ea9bad6a0c6 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Mon, 18 Mar 2024 17:13:56 +0800 Subject: [PATCH] * Finish task #113255. --- module/story/control.php | 1 + module/story/js/edit.ui.js | 9 +++++++++ module/story/lang/de.php | 3 +++ module/story/lang/en.php | 3 +++ module/story/lang/fr.php | 3 +++ module/story/lang/zh-cn.php | 1 + module/story/model.php | 8 ++++++++ module/story/ui/edit.html.php | 1 + 8 files changed, 29 insertions(+) diff --git a/module/story/control.php b/module/story/control.php index 1ca73336d0..84514b26ef 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -276,6 +276,7 @@ class story extends control $this->loadModel('file'); $this->app->loadLang('bug'); $this->commonAction($storyID); + $this->story->getAllChildId($storyID); if(!empty($_POST)) { diff --git a/module/story/js/edit.ui.js b/module/story/js/edit.ui.js index 4d51e79337..6e60b397e4 100644 --- a/module/story/js/edit.ui.js +++ b/module/story/js/edit.ui.js @@ -13,6 +13,15 @@ window.loadProduct = function() } } + if(productID != oldProductID) + { + if(!confirm(changeProductTips)) + { + $product.$.setValue(oldProductID.toString()); + return false; + } + } + if(parentStory) { confirmLoadProduct = confirm(moveChildrenTips); diff --git a/module/story/lang/de.php b/module/story/lang/de.php index 1a6407a3b5..d897898848 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -339,7 +339,10 @@ $lang->story->confirmRecallChange = "After undo the change, the story content w $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->allChildrenClosed = "All sub-requirements under the %s requirement have been closed. Whether to automatically close these requirements?"; +$lang->story->changeProductTips = "Are you sure you want to modify the product? After modification, all sub-level requirements of the requirement will also be changed accordingly."; $lang->story->gradeOverflow = "The system detects that the maximum level of sub-requirements under this requirement is %s. After synchronization modification, it is %s. It exceeds the level range set by the system and cannot be modified."; +$lang->story->batchGradeOverflow = "After the sub-requirements of the %s requirement are modified synchronously, they exceed the level range set by the system and cannot be modified."; $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 0981d03953..273160ec11 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -339,7 +339,10 @@ $lang->story->confirmRecallChange = "After undo the change, the story content w $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->allChildrenClosed = "All sub-requirements under the %s requirement have been closed. Whether to automatically close these requirements?"; +$lang->story->changeProductTips = "Are you sure you want to modify the product? After modification, all sub-level requirements of the requirement will also be changed accordingly."; $lang->story->gradeOverflow = "The system detects that the maximum level of sub-requirements under this requirement is %s. After synchronization modification, it is %s. It exceeds the level range set by the system and cannot be modified."; +$lang->story->batchGradeOverflow = "After the sub-requirements of the %s requirement are modified synchronously, they exceed the level range set by the system and cannot be modified."; $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 e16afd6cc1..3a994d838c 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -339,7 +339,10 @@ $lang->story->confirmRecallChange = "After undo the change, the story content w $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->allChildrenClosed = "All sub-requirements under the %s requirement have been closed. Whether to automatically close these requirements?"; +$lang->story->changeProductTips = "Are you sure you want to modify the product? After modification, all sub-level requirements of the requirement will also be changed accordingly."; $lang->story->gradeOverflow = "The system detects that the maximum level of sub-requirements under this requirement is %s. After synchronization modification, it is %s. It exceeds the level range set by the system and cannot be modified."; +$lang->story->batchGradeOverflow = "After the sub-requirements of the %s requirement are modified synchronously, they exceed the level range set by the system and cannot be modified."; $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 6ba57ca2a5..a5e0c1ac38 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -342,6 +342,7 @@ $lang->story->confirmRecallReview = "您确定要撤回评审吗?"; $lang->story->noStoryToTask = "只有激活的{$lang->SRCommon}才能转为任务!"; $lang->story->ignoreClosedStory = "{$lang->SRCommon} %s 状态为已关闭,本次操作已被过滤。"; $lang->story->allChildrenClosed = "%s需求下的子需求均已关闭,是否自动关闭这些需求?"; +$lang->story->changeProductTips = "确认修改所属产品吗,修改后,需求的所有子级需求也会跟随变更。"; $lang->story->gradeOverflow = "系统检测该需求下子需求的最大层级为%s,同步修改后为%s,超出系统设置的层级范围,无法修改。"; $lang->story->batchGradeOverflow = "%s需求的子需求同步修改后,超出系统设置的层级范围,无法修改。"; diff --git a/module/story/model.php b/module/story/model.php index 29b0b11eb0..4265e134d8 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2112,7 +2112,15 @@ class storyModel extends model $children = $this->dao->select('id')->from(TABLE_STORY) ->where('deleted')->eq(0) ->andWhere('top')->eq($story->top) + ->beginIF($story->type == 'requirement') + ->andWhere("((type = 'requirement' and grade > {$story->grade}) or (type = 'story'))") + ->fi() + ->beginIF($story->type == 'epic') + ->andWhere("((type = 'epic' and grade > {$story->grade}) or (type = 'story') or (type = 'requirement'))") + ->fi() + ->beginIF($story->type == 'story') ->andWhere('grade')->gt($story->grade) + ->fi() ->fetchPairs(); return array_keys($children); diff --git a/module/story/ui/edit.html.php b/module/story/ui/edit.html.php index 136c2021a7..487f3ce404 100644 --- a/module/story/ui/edit.html.php +++ b/module/story/ui/edit.html.php @@ -44,6 +44,7 @@ jsVar('reviewerNotEmpty', $lang->story->notice->reviewerNotEmpty); jsVar('oldProductID', $story->product); jsVar('twins', $story->twins); jsVar('relievedTwinsTip', $lang->story->relievedTwinsTip); +jsVar('changeProductTips', $lang->story->changeProductTips); jsVar('parentStory', !empty($story->children)); jsVar('moveChildrenTips', $lang->story->moveChildrenTips); jsVar('executionID', isset($objectID) ? $objectID : 0);