From 0697d0759910118c0ae4c3fdb9cee99bb4b9f6a7 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Mon, 9 Sep 2024 10:13:40 +0800 Subject: [PATCH] * [bug#54942] Add the tutorial function of getStoryByID and adjust step. --- module/productplan/zen.php | 2 +- module/story/model.php | 2 ++ module/tutorial/config/productManage.php | 17 ++++++++++++++++- module/tutorial/model.php | 14 ++++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/module/productplan/zen.php b/module/productplan/zen.php index fc53ab2dca..196f95fda0 100644 --- a/module/productplan/zen.php +++ b/module/productplan/zen.php @@ -281,7 +281,7 @@ class productplanZen extends productplan unset($storyStatusList['closed']); $this->config->product->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $storyStatusList); - $product = $this->loadModel('product')->fetchByID($plan->product); + $product = $this->loadModel('product')->getByID($plan->product); if($product->type == 'normal') { unset($this->config->product->search['fields']['branch']); diff --git a/module/story/model.php b/module/story/model.php index 9e5d5fbc54..e9c636ad56 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -23,6 +23,8 @@ class storyModel extends model */ public function getByID(int $storyID, int $version = 0, bool $setImgSize = false): object|false { + if(common::isTutorialMode()) return $this->loadModel('tutorial')->getStoryByID($storyID); + $story = $this->dao->select('*')->from(TABLE_STORY)->where('id')->eq($storyID)->fetch(); if(!$story) return false; diff --git a/module/tutorial/config/productManage.php b/module/tutorial/config/productManage.php index 8d1f97af3d..920487f296 100644 --- a/module/tutorial/config/productManage.php +++ b/module/tutorial/config/productManage.php @@ -79,10 +79,25 @@ $productManage->basic->tasks['storyManage']['title'] = $lang->tutorial->produ $productManage->basic->tasks['storyManage']['startUrl'] = array('product', 'dashboard', 'productID=1'); $productManage->basic->tasks['storyManage']['steps'] = array(); +$productManage->basic->tasks['storyManage']['steps'][] = array( + 'type' => 'openApp', + 'app' => 'product', + 'title' => $lang->tutorial->productManage->lineManage->step1->name, + 'desc' => $lang->tutorial->productManage->lineManage->step1->desc +); + +$productManage->basic->tasks['storyManage']['steps'][] = array( + 'type' => 'click', + 'target' => '#products div.dtable-body div[data-col="name"][data-row="1"] a', + 'page' => 'product-all', + 'title' => $lang->tutorial->productManage->moduleManage->step1->name, + 'desc' => $lang->tutorial->productManage->moduleManage->step1->desc +); + $productManage->basic->tasks['storyManage']['steps'][] = array( 'type' => 'clickNavbar', 'target' => 'epic', - 'page' => 'product-dashboard', + 'page' => 'product-browse', 'title' => $lang->tutorial->productManage->storyManage->step1->name, 'desc' => $lang->tutorial->productManage->storyManage->step1->desc ); diff --git a/module/tutorial/model.php b/module/tutorial/model.php index 0bb6f3bedc..0d47bd3394 100644 --- a/module/tutorial/model.php +++ b/module/tutorial/model.php @@ -384,6 +384,20 @@ class tutorialModel extends model return $requirement; } + /** + * 根据需求ID获取需求详情。 + * Get story by ID. + * + * @access public + * @return object + */ + public function getStoryByID(int $storyID): object + { + if($storyID == 1) return $this->getEpic(); + if($storyID == 2) return $this->getRequirement(); + return $this->getStory(); + } + /** * 获取新手模式故事点。 * Get tutorial stories.