diff --git a/module/story/model.php b/module/story/model.php index 0faadbad2e..350f3a421f 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3797,6 +3797,8 @@ class storyModel extends model */ public function mergeReviewer(object|array $stories, $isObject = false): array|object { + if(common::isTutorialMode()) return $stories; + $rawQuery = $this->dao->get(); if($isObject) { @@ -3868,6 +3870,8 @@ class storyModel extends model */ public function appendChildren(int $productID, array $stories, string $storyType): array { + if(common::isTutorialMode()) return $stories; + /* 如果是OR界面的用户需求,则不需要追加子需求(研发需求)。 */ /* If it is the OR interface for user requirements, no need to add sub requirements.*/ if($storyType == 'requirement' && $this->config->vision == 'or') return $stories; diff --git a/module/story/tao.php b/module/story/tao.php index fd1fd6319c..e013b8f51f 100644 --- a/module/story/tao.php +++ b/module/story/tao.php @@ -1927,7 +1927,7 @@ class storyTao extends storyModel /* Change button. */ $canChange = common::hasPriv($story->type, 'change') && $this->isClickable($story, 'change'); $title = $canChange ? $lang->story->change : $this->lang->story->changeTip; - if(common::hasPriv($story->type, 'change')) $actions[] = array('name' => 'change', 'url' => $canChange ? $changeLink : null, 'hint' => $title, 'disabled' => !$canChange); + if(common::hasPriv($story->type, 'change')) $actions[] = array('name' => 'change', 'url' => $canChange ? $changeLink : null, 'hint' => $title, 'disabled' => !$canChange, 'class' => 'story-change-btn'); /* Submitreview, review, recall buttons. */ if(strpos('draft,changing', $story->status) !== false) @@ -1955,7 +1955,7 @@ class storyTao extends storyModel } } - $actReview = array('name' => 'review', 'url' => $canReview ? $reviewLink : null, 'hint' => $title, 'disabled' => !$canReview); + $actReview = array('name' => 'review', 'url' => $canReview ? $reviewLink : null, 'hint' => $title, 'disabled' => !$canReview, 'class' => 'story-review-btn'); } $canRecall = common::hasPriv($story->type, 'recall') && $this->isClickable($story, $story->status == 'changing' ? 'recallchange' : 'recall'); @@ -2015,11 +2015,11 @@ class storyTao extends storyModel } elseif($story->type == 'epic' && common::hasPriv('requirement', 'batchCreate') && $this->isClickable($story, 'batchcreate') && empty($story->hasSameTypeChild) && !($this->config->epic->gradeRule == 'stepwise' && $story->grade < $maxGradeGroup['epic'])) { - $actions[] = array('name' => 'batchCreate', 'url' => helper::createLink('requirement', 'batchCreate', "productID=$story->product&branch=$story->branch&module=$story->module&$params&executionID=$executionID&plan=0"), 'hint' => $this->lang->story->split, 'icon' => 'split'); + $actions[] = array('name' => 'batchCreate', 'url' => helper::createLink('requirement', 'batchCreate', "productID=$story->product&branch=$story->branch&module=$story->module&$params&executionID=$executionID&plan=0"), 'hint' => $this->lang->story->split, 'icon' => 'split', 'class' => 'epic-createRequirement-btn'); } elseif($story->type == 'requirement' && common::hasPriv('story', 'batchCreate') && $this->isClickable($story, 'batchcreate') && empty($story->hasSameTypeChild) && !($this->config->requirement->gradeRule == 'stepwise' && $story->grade < $maxGradeGroup['requirement'])) { - $actions[] = array('name' => 'batchCreate', 'url' => helper::createLink('story', 'batchCreate', "productID=$story->product&branch=$story->branch&module=$story->module&$params&executionID=$executionID&plan=0"), 'hint' => $this->lang->story->split, 'icon' => 'split'); + $actions[] = array('name' => 'batchCreate', 'url' => helper::createLink('story', 'batchCreate', "productID=$story->product&branch=$story->branch&module=$story->module&$params&executionID=$executionID&plan=0"), 'hint' => $this->lang->story->split, 'icon' => 'split', 'class' => 'requirement-createStory-btn'); } elseif(!$canBatchCreateStory && common::hasPriv($story->type, 'batchcreate')) { diff --git a/module/tutorial/config/productManage.php b/module/tutorial/config/productManage.php index 518f1f54a2..9389509cac 100644 --- a/module/tutorial/config/productManage.php +++ b/module/tutorial/config/productManage.php @@ -71,3 +71,137 @@ $productManage->tasks['moduleManage']['steps'][] = array( 'title' => $lang->tutorial->productManage->moduleManage->step4->name, 'desc' => $lang->tutorial->productManage->moduleManage->step4->desc ); + +$productManage->tasks['storyManage'] = array(); +$productManage->tasks['storyManage']['name'] = 'storyManage'; +$productManage->tasks['storyManage']['title'] = $lang->tutorial->productManage->storyManage->title; +$productManage->tasks['storyManage']['startUrl'] = array('product', 'dashboard', 'productID=1'); +$productManage->tasks['storyManage']['steps'] = array(); + +$productManage->tasks['storyManage']['steps'][] = array( + 'type' => 'clickNavbar', + 'target' => 'epic', + 'page' => 'product-dashboard', + 'title' => $lang->tutorial->productManage->storyManage->step1->name, + 'desc' => $lang->tutorial->productManage->storyManage->step1->desc +); + +$productManage->tasks['storyManage']['steps'][] = array( + 'type' => 'click', + 'target' => '#actionBar a.create-story-btn', + 'page' => 'product-browse', + 'title' => $lang->tutorial->productManage->storyManage->step2->name, + 'desc' => $lang->tutorial->productManage->storyManage->step2->desc +); + +$productManage->tasks['storyManage']['steps'][] = array( + 'type' => 'form', + 'page' => 'story-create', + 'title' => $lang->tutorial->productManage->storyManage->step3->name +); + +$productManage->tasks['storyManage']['steps'][] = array( + 'type' => 'saveForm', + 'page' => 'story-create', + 'title' => $lang->tutorial->productManage->storyManage->step4->name, + 'desc' => $lang->tutorial->productManage->storyManage->step4->desc +); + +$productManage->tasks['storyManage']['steps'][] = array( + 'type' => 'click', + 'target' => 'div.dtable div[data-col="actions"][data-row="1"] a.epic-createRequirement-btn', + 'page' => 'product-browse', + 'url' => array('product', 'browse', 'productID=1&branch=&browseType=all¶m=0&storyType=epic'), + 'title' => $lang->tutorial->productManage->storyManage->step5->name, + 'desc' => $lang->tutorial->productManage->storyManage->step5->desc +); + +$productManage->tasks['storyManage']['steps'][] = array( + 'type' => 'form', + 'target' => 'div.panel-body div.form-batch-container', + 'page' => 'requirement-batchCreate', + 'title' => $lang->tutorial->productManage->storyManage->step6->name +); + +$productManage->tasks['storyManage']['steps'][] = array( + 'type' => 'saveForm', + 'page' => 'requirement-batchCreate', + 'title' => $lang->tutorial->productManage->storyManage->step7->name, + 'desc' => $lang->tutorial->productManage->storyManage->step7->desc +); + +$productManage->tasks['storyManage']['steps'][] = array( + 'type' => 'click', + 'target' => 'div.dtable div[data-col="actions"][data-row="2"] a.requirement-createStory-btn', + 'page' => 'product-browse', + 'url' => array('product', 'browse', 'productID=1&branch=&browseType=all¶m=0&storyType=epic'), + 'title' => $lang->tutorial->productManage->storyManage->step8->name, + 'desc' => $lang->tutorial->productManage->storyManage->step8->desc +); + +$productManage->tasks['storyManage']['steps'][] = array( + 'type' => 'form', + 'target' => 'div.panel-body div.form-batch-container', + 'page' => 'story-batchCreate', + 'title' => $lang->tutorial->productManage->storyManage->step9->name +); + +$productManage->tasks['storyManage']['steps'][] = array( + 'type' => 'saveForm', + 'page' => 'story-batchCreate', + 'title' => $lang->tutorial->productManage->storyManage->step10->name, + 'desc' => $lang->tutorial->productManage->storyManage->step10->desc +); + +$productManage->tasks['storyManage']['steps'][] = array( + 'type' => 'click', + 'target' => 'div.dtable div[data-col="actions"][data-row="4"] a.story-review-btn', + 'page' => 'product-browse', + 'url' => array('product', 'browse', 'productID=1&branch=&browseType=all¶m=0&storyType=epic'), + 'title' => $lang->tutorial->productManage->storyManage->step11->name, + 'desc' => $lang->tutorial->productManage->storyManage->step11->desc +); + +$productManage->tasks['storyManage']['steps'][] = array( + 'type' => 'form', + 'page' => 'story-review', + 'title' => $lang->tutorial->productManage->storyManage->step12->name +); + +$productManage->tasks['storyManage']['steps'][] = array( + 'type' => 'saveForm', + 'page' => 'story-review', + 'title' => $lang->tutorial->productManage->storyManage->step13->name, + 'desc' => $lang->tutorial->productManage->storyManage->step13->desc +); + +$productManage->tasks['storyManage']['steps'][] = array( + 'type' => 'click', + 'target' => 'div.dtable div[data-col="actions"][data-row="3"] a.story-change-btn', + 'page' => 'product-browse', + 'url' => array('product', 'browse', 'productID=1&branch=&browseType=all¶m=0&storyType=epic'), + 'title' => $lang->tutorial->productManage->storyManage->step14->name, + 'desc' => $lang->tutorial->productManage->storyManage->step14->desc +); + +$productManage->tasks['storyManage']['steps'][] = array( + 'type' => 'form', + 'page' => 'story-change', + 'title' => $lang->tutorial->productManage->storyManage->step15->name +); + +$productManage->tasks['storyManage']['steps'][] = array( + 'type' => 'saveForm', + 'page' => 'story-change', + 'title' => $lang->tutorial->productManage->storyManage->step16->name, + 'desc' => $lang->tutorial->productManage->storyManage->step16->desc +); + +$productManage->tasks['storyManage']['steps'][] = array( + 'type' => 'clickNavbar', + 'target' => 'track', + 'page' => 'product-browse', + 'url' => array('product', 'browse', 'productID=1&branch=&browseType=all¶m=0&storyType=epic'), + 'title' => $lang->tutorial->productManage->storyManage->step17->name, + 'desc' => $lang->tutorial->productManage->storyManage->step17->desc +); diff --git a/module/tutorial/lang/zh-cn.php b/module/tutorial/lang/zh-cn.php index f143fbe41b..46b1fb06b0 100644 --- a/module/tutorial/lang/zh-cn.php +++ b/module/tutorial/lang/zh-cn.php @@ -1102,3 +1102,69 @@ $lang->tutorial->productManage->moduleManage->step3->name = '填写表单'; $lang->tutorial->productManage->moduleManage->step4 = new stdClass(); $lang->tutorial->productManage->moduleManage->step4->name = '保存表单'; $lang->tutorial->productManage->moduleManage->step4->desc = '保存后可以在创建需求时选择模块进行分类'; + +$lang->tutorial->productManage->storyManage = new stdClass(); +$lang->tutorial->productManage->storyManage->title = '需求管理'; + +$lang->tutorial->productManage->storyManage->step1 = new stdClass(); +$lang->tutorial->productManage->storyManage->step1->name = '点击业务需求'; +$lang->tutorial->productManage->storyManage->step1->desc = '您可以在这里管理产品的业务需求'; + +$lang->tutorial->productManage->storyManage->step2 = new stdClass(); +$lang->tutorial->productManage->storyManage->step2->name = '点击提业务需求'; +$lang->tutorial->productManage->storyManage->step2->desc = '点击提业务需求'; + +$lang->tutorial->productManage->storyManage->step3 = new stdClass(); +$lang->tutorial->productManage->storyManage->step3->name = '填写表单'; + +$lang->tutorial->productManage->storyManage->step4 = new stdClass(); +$lang->tutorial->productManage->storyManage->step4->name = '保存表单'; +$lang->tutorial->productManage->storyManage->step4->desc = '保存后在业务需求列表查看'; + +$lang->tutorial->productManage->storyManage->step5 = new stdClass(); +$lang->tutorial->productManage->storyManage->step5->name = '点击拆分业务需求'; +$lang->tutorial->productManage->storyManage->step5->desc = '点击将业务需拆分成用户需求'; + +$lang->tutorial->productManage->storyManage->step6 = new stdClass(); +$lang->tutorial->productManage->storyManage->step6->name = '填写表单'; + +$lang->tutorial->productManage->storyManage->step7 = new stdClass(); +$lang->tutorial->productManage->storyManage->step7->name = '保存表单'; +$lang->tutorial->productManage->storyManage->step7->desc = '保存后可以在需求列表中查看'; + +$lang->tutorial->productManage->storyManage->step8 = new stdClass(); +$lang->tutorial->productManage->storyManage->step8->name = '点拆分用户需求'; +$lang->tutorial->productManage->storyManage->step8->desc = '点击将用户需求拆分成研发需求'; + +$lang->tutorial->productManage->storyManage->step9 = new stdClass(); +$lang->tutorial->productManage->storyManage->step9->name = '填写表单'; + +$lang->tutorial->productManage->storyManage->step10 = new stdClass(); +$lang->tutorial->productManage->storyManage->step10->name = '保存表单'; +$lang->tutorial->productManage->storyManage->step10->desc = '保存后在需求列表中查看'; + +$lang->tutorial->productManage->storyManage->step11 = new stdClass(); +$lang->tutorial->productManage->storyManage->step11->name = '点击评审按钮'; +$lang->tutorial->productManage->storyManage->step11->desc = '点击对需求进行评审'; + +$lang->tutorial->productManage->storyManage->step12 = new stdClass(); +$lang->tutorial->productManage->storyManage->step12->name = '填写表单'; + +$lang->tutorial->productManage->storyManage->step13 = new stdClass(); +$lang->tutorial->productManage->storyManage->step13->name = '保存表单'; +$lang->tutorial->productManage->storyManage->step13->desc = '保存后需求的状态根据评审结果变动'; + +$lang->tutorial->productManage->storyManage->step14 = new stdClass(); +$lang->tutorial->productManage->storyManage->step14->name = '点击变更按钮'; +$lang->tutorial->productManage->storyManage->step14->desc = '点击对需求进行变更'; + +$lang->tutorial->productManage->storyManage->step15 = new stdClass(); +$lang->tutorial->productManage->storyManage->step15->name = '填写表单'; + +$lang->tutorial->productManage->storyManage->step16 = new stdClass(); +$lang->tutorial->productManage->storyManage->step16->name = '保存表单'; +$lang->tutorial->productManage->storyManage->step16->desc = '保存后,需求变更完成'; + +$lang->tutorial->productManage->storyManage->step17 = new stdClass(); +$lang->tutorial->productManage->storyManage->step17->name = '点击矩阵'; +$lang->tutorial->productManage->storyManage->step17->desc = '您可以在这里跟进需求的进展情况'; diff --git a/module/tutorial/model.php b/module/tutorial/model.php index 402cb89f03..8c7d55d126 100644 --- a/module/tutorial/model.php +++ b/module/tutorial/model.php @@ -274,28 +274,28 @@ class tutorialModel extends model } /** - * 获取新手模式故事点。 - * Get tutorial stories. + * 获取新手模式研发需求。 + * Get tutorial story. * * @access public - * @return array + * @return object */ - public function getStories(): array + public function getStory(): object { $story = new stdclass(); - $story->id = 1; + $story->id = 3; $story->product = 1; $story->branch = 0; - $story->parent = 0; + $story->parent = 2; $story->category = 0; - $story->module = 1; + $story->module = 0; $story->plan = ''; $story->planTitle = ''; $story->color = ''; $story->source = 'po'; $story->sourceNote = ''; $story->fromBug = 0; - $story->title = 'Test story'; + $story->title = 'Test active story'; $story->keywords = ''; $story->type = 'story'; $story->grade = 1; @@ -323,13 +323,74 @@ class tutorialModel extends model $story->mailto = ''; $story->isParent = 0; $story->roadmap = 0; + $story->root = 1; + $story->path = ',1,2,3,'; + return $story; + } + + /** + * 获取新手模式业务需求。 + * Get tutorial epic. + * + * @access public + * @return object + */ + public function getEpic(): object + { + $epic = $this->getStory(); + $epic->id = 1; + $epic->title = 'Test epic'; + $epic->type = 'epic'; + $epic->isParent = 1; + $epic->parent = 0; + $epic->root = 1; + $epic->path = ',1,'; + return $epic; + } + + /** + * 获取新手模式用户需求。 + * Get tutorial requirement. + * + * @access public + * @return object + */ + public function getRequirement(): object + { + $requirement = $this->getStory(); + $requirement->id = 2; + $requirement->title = 'Test requirement'; + $requirement->type = 'requirement'; + $requirement->status = 'active'; + $requirement->isParent = 1; + $requirement->parent = 1; + $requirement->root = 1; + $requirement->path = ',1,2,'; + return $requirement; + } + + /** + * 获取新手模式故事点。 + * Get tutorial stories. + * + * @access public + * @return array + */ + public function getStories(): array + { + $activeStory = $this->getStory(); + $reviewingStory = $this->getStory(); + $reviewingStory->id = 4; + $reviewingStory->status = 'reviewing'; + $reviewingStory->notReview = array($this->app->user->account); + $reviewingStory->title = 'Test reviewing story'; + $reviewingStory->path = ',1,2,4,'; $stories = array(); - $stories[] = $story; - $story = json_decode(json_encode($stories[0])); - $story->id = 2; - $story->title = 'Test story 2'; - $stories[] = $story; + $stories[] = $this->getEpic(); + $stories[] = $this->getRequirement(); + $stories[] = $activeStory; + $stories[] = $reviewingStory; return $stories; }