diff --git a/module/custom/css/set.ui.css b/module/custom/css/set.ui.css index 218d449dec..48318d8dec 100644 --- a/module/custom/css/set.ui.css +++ b/module/custom/css/set.ui.css @@ -5,3 +5,4 @@ .lang-row .form-group > .form-label {width: var(--form-horz-label-width);} .unit-box .checkbox-primary {flex: 0 1 15%;} #gradeList {width: 50%} +.gradeRuleNotice {margin-left: 4.25rem} diff --git a/module/custom/lang/de.php b/module/custom/lang/de.php index f2187484c6..24f08e802f 100644 --- a/module/custom/lang/de.php +++ b/module/custom/lang/de.php @@ -68,6 +68,9 @@ $lang->custom->closeGrade = 'Close Story Grade'; $lang->custom->activateGrade = 'Activate Story Grade'; $lang->custom->deleteGrade = 'Delete Story Grade'; +$lang->custom->gradeRuleList['cross'] = 'Allow cross-level segmentation'; +$lang->custom->gradeRuleList['stepwise'] = 'Restriction level-by-level subdivision'; + $lang->custom->unitList['efficiency'] = 'Working Hours/'; $lang->custom->unitList['manhour'] = 'Man-hour/'; $lang->custom->unitList['cost'] = 'Yuan/Hour'; @@ -129,7 +132,8 @@ $lang->custom->story->fields['statusList'] = 'Status'; $lang->custom->story->fields['reviewRules'] = 'Review Rules'; $lang->custom->story->fields['reviewResultList'] = 'Review Result'; $lang->custom->story->fields['review'] = 'Review Required'; -if($config->edition != 'open' || 1) $lang->custom->story->fields['grade'] = 'Grade Setting'; +$lang->custom->story->fields['grade'] = 'Grade Setting'; +$lang->custom->story->fields['gradeRule'] = 'Grade Rule'; $lang->custom->epic = clone $lang->custom->story; $lang->custom->requirement = clone $lang->custom->story; @@ -221,6 +225,8 @@ $lang->custom->notice->closeGrade = "After closing, the grade cannot be $lang->custom->notice->activateGrade = "After activating, the grade can be used to create new stories."; $lang->custom->notice->gradeNotEmpty = 'There are stories in this grade, and it cannot be deleted!'; $lang->custom->notice->deleteGrade = 'Are you sure you want to delete this grade?'; +$lang->custom->notice->stepwise = 'Level-by-level subdivision: It needs to be created starting from the top requirement level and subdivided layer by layer to the last requirement level.'; +$lang->custom->notice->cross = 'Cross-level segmentation: Requirements can be created from any requirement level and support cross-level association of parent-child relationships.'; $lang->custom->notice->indexPage['product'] = "ZenTao 8.2+ has Product Homepage. Do you want to go to Product Homepage?"; $lang->custom->notice->indexPage['project'] = "ZenTao 8.2+ has {$lang->projectCommon} Home. Do you want to go to {$lang->projectCommon} Home?"; diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index 4b58b54392..0cab57e5ff 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -68,6 +68,9 @@ $lang->custom->closeGrade = 'Close Story Grade'; $lang->custom->activateGrade = 'Activate Story Grade'; $lang->custom->deleteGrade = 'Delete Story Grade'; +$lang->custom->gradeRuleList['cross'] = 'Allow cross-level segmentation'; +$lang->custom->gradeRuleList['stepwise'] = 'Restriction level-by-level subdivision'; + $lang->custom->unitList['efficiency'] = 'Working Hours/'; $lang->custom->unitList['manhour'] = 'Man-hour/'; $lang->custom->unitList['cost'] = 'USD/Hour'; @@ -129,7 +132,8 @@ $lang->custom->story->fields['statusList'] = 'Status'; $lang->custom->story->fields['reviewRules'] = 'Review Rules'; $lang->custom->story->fields['reviewResultList'] = 'Review Result'; $lang->custom->story->fields['review'] = 'Need Review'; -if($config->edition != 'open' || 1) $lang->custom->story->fields['grade'] = 'Grade Setting'; +$lang->custom->story->fields['grade'] = 'Grade Setting'; +$lang->custom->story->fields['gradeRule'] = 'Grade Rule'; $lang->custom->epic = clone $lang->custom->story; $lang->custom->requirement = clone $lang->custom->story; @@ -221,6 +225,8 @@ $lang->custom->notice->closeGrade = "After closing, the grade cannot be $lang->custom->notice->activateGrade = "After activating, the grade can be used to create new stories."; $lang->custom->notice->gradeNotEmpty = 'There are stories in this grade, and it cannot be deleted!'; $lang->custom->notice->deleteGrade = 'Are you sure you want to delete this grade?'; +$lang->custom->notice->stepwise = 'Level-by-level subdivision: It needs to be created starting from the top requirement level and subdivided layer by layer to the last requirement level.'; +$lang->custom->notice->cross = 'Cross-level segmentation: Requirements can be created from any requirement level and support cross-level association of parent-child relationships.'; $lang->custom->notice->indexPage['product'] = "ZenTao 8.2+ has Product Home. Do you want to go to Product Home?"; $lang->custom->notice->indexPage['project'] = "ZenTao 8.2+ has {$lang->projectCommon} Home. Do you want to go to {$lang->projectCommon} Home?"; diff --git a/module/custom/lang/fr.php b/module/custom/lang/fr.php index faf7660b53..e0043eb458 100644 --- a/module/custom/lang/fr.php +++ b/module/custom/lang/fr.php @@ -68,6 +68,9 @@ $lang->custom->closeGrade = 'Close Story Grade'; $lang->custom->activateGrade = 'Activate Story Grade'; $lang->custom->deleteGrade = 'Delete Story Grade'; +$lang->custom->gradeRuleList['cross'] = 'Allow cross-level segmentation'; +$lang->custom->gradeRuleList['stepwise'] = 'Restriction level-by-level subdivision'; + $lang->custom->unitList['efficiency'] = 'Working Hours/'; $lang->custom->unitList['manhour'] = 'Man-hour/'; $lang->custom->unitList['cost'] = 'Yuan/Hour'; @@ -129,7 +132,8 @@ $lang->custom->story->fields['statusList'] = 'Statut'; $lang->custom->story->fields['reviewRules'] = 'Review Rules'; $lang->custom->story->fields['reviewResultList'] = 'Valider Résultats'; $lang->custom->story->fields['review'] = 'Validation Requise'; -if($config->edition != 'open' || 1) $lang->custom->story->fields['grade'] = 'Grade Setting'; +$lang->custom->story->fields['grade'] = 'Grade Setting'; +$lang->custom->story->fields['gradeRule'] = 'Grade Rule'; $lang->custom->epic = clone $lang->custom->story; $lang->custom->requirement = clone $lang->custom->story; @@ -221,6 +225,8 @@ $lang->custom->notice->closeGrade = "After closing, the grade cannot be $lang->custom->notice->activateGrade = "After activating, the grade can be used to create new stories."; $lang->custom->notice->gradeNotEmpty = 'There are stories in this grade, and it cannot be deleted!'; $lang->custom->notice->deleteGrade = 'Are you sure you want to delete this grade?'; +$lang->custom->notice->stepwise = 'Level-by-level subdivision: It needs to be created starting from the top requirement level and subdivided layer by layer to the last requirement level.'; +$lang->custom->notice->cross = 'Cross-level segmentation: Requirements can be created from any requirement level and support cross-level association of parent-child relationships.'; $lang->custom->notice->indexPage['product'] = "ZenTao 8.2+ possède une page d'accueil. Voulez-vous consulter la page d'accueil du produit ?"; $lang->custom->notice->indexPage['project'] = "ZenTao 8.2+ has {$lang->projectCommon} Home. Do you want to go to {$lang->projectCommon} Home?"; diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index a3fd358938..a107979a8b 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -68,6 +68,9 @@ $lang->custom->closeGrade = '停用需求层级'; $lang->custom->activateGrade = '启用需求层级'; $lang->custom->deleteGrade = '删除需求层级'; +$lang->custom->gradeRuleList['cross'] = '允许跨层级细分'; +$lang->custom->gradeRuleList['stepwise'] = '限制逐层级细分'; + $lang->custom->unitList['efficiency'] = '工时/'; $lang->custom->unitList['manhour'] = '人时/'; $lang->custom->unitList['cost'] = '元/小时'; @@ -129,7 +132,8 @@ $lang->custom->story->fields['statusList'] = '状态'; $lang->custom->story->fields['reviewRules'] = '评审规则'; $lang->custom->story->fields['reviewResultList'] = '评审结果'; $lang->custom->story->fields['review'] = '评审流程'; -if($config->edition != 'open' || 1) $lang->custom->story->fields['grade'] = '层级设置'; +$lang->custom->story->fields['grade'] = '层级设置'; +$lang->custom->story->fields['gradeRule'] = '细分流程'; $lang->custom->epic = clone $lang->custom->story; $lang->custom->requirement = clone $lang->custom->story; @@ -221,6 +225,8 @@ $lang->custom->notice->closeGrade = "停用后,该层级无法再创 $lang->custom->notice->activateGrade = "启用后,该层级可以创建新需求。"; $lang->custom->notice->gradeNotEmpty = '系统内存在该层级的需求,不能删除!'; $lang->custom->notice->deleteGrade = '层级删除后无法恢复!'; +$lang->custom->notice->stepwise = '逐层细分:需从顶级需求层级开始创建,逐层细分至最后一个需求层级。'; +$lang->custom->notice->cross = '跨层细分:可从任意需求层级创建需求,并支持跨层级关联父子关系。'; $lang->custom->notice->indexPage['product'] = "从8.2版本起增加了产品主页视图,是否默认进入产品主页?"; $lang->custom->notice->indexPage['project'] = "从8.2版本起增加了{$lang->projectCommon}主页视图,是否默认进入{$lang->projectCommon}主页?"; diff --git a/module/custom/ui/set.html.php b/module/custom/ui/set.html.php index 6020abb1da..e589957df9 100644 --- a/module/custom/ui/set.html.php +++ b/module/custom/ui/set.html.php @@ -71,6 +71,24 @@ elseif(in_array($module, array('story', 'requirement', 'epic')) && $field == 're set::items($users) ); } +elseif(in_array($module, array('story', 'requirement', 'epic')) && $field == 'gradeRule') +{ + $formItems[] = formGroup + ( + set::width('1/2'), + set::label($lang->custom->story->fields['gradeRule']), + set::name('gradeRule'), + set::value($gradeRule), + set::control('radioListInline'), + set::items($lang->custom->gradeRuleList) + ); + $formItems[] = div + ( + setClass('gradeRuleNotice'), + div($lang->custom->notice->cross), + div($lang->custom->notice->stepwise) + ); +} elseif(in_array($module, array('epic', 'story', 'requirement', 'testcase')) && $field == 'review') { $formItems[] = formGroup diff --git a/module/custom/zen.php b/module/custom/zen.php index d5ac5d391c..dc5bc347df 100644 --- a/module/custom/zen.php +++ b/module/custom/zen.php @@ -88,6 +88,11 @@ class customZen extends custom $this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); $this->view->superReviewers = zget($this->config->$module, 'superReviewers', ''); } + if(in_array($module, array('story', 'requirement', 'epic')) && $field == 'gradeRule') + { + $this->app->loadConfig($module); + $this->view->gradeRule = zget($this->config->$module, 'gradeRule', ''); + } if(in_array($module, array('story', 'requirement', 'epic')) && $field == 'grade') { $this->view->storyGrades = $this->loadModel('story')->getGradeSetting($module); @@ -151,6 +156,10 @@ class customZen extends custom { $this->setStoryReview($module, $data); } + elseif(in_array($module, array('story', 'requirement', 'epic')) && $field == 'gradeRule') + { + $this->setGradeRule($module, $data); + } elseif(in_array($module, array('story', 'requirement', 'epic')) && $field == 'grade') { $this->custom->setStoryGrade($module, $data); @@ -340,6 +349,21 @@ class customZen extends custom return !dao::isError(); } + /** + * 设置需求细分流程。 + * Set the rule of story grade. + * + * @param string $module + * @param array $data + * @access protected + * @return bool + */ + public function setGradeRule(string $module, array $data): bool + { + $this->loadModel('setting')->setItems("system.{$module}@{$this->config->vision}", $data); + return !dao::isError(); + } + /** * 设置用例评审规则。 * Set testcase review rules.