From d3af747bd99476538271be1adb44cb95bf1166b7 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Thu, 21 Jan 2021 11:00:14 +0800 Subject: [PATCH] * Fix a bug. --- module/projectstory/control.php | 12 ++++++++++++ module/story/control.php | 5 +++++ module/story/model.php | 16 +++++++++------- module/story/view/view.html.php | 16 +++++++++++++--- 4 files changed, 39 insertions(+), 10 deletions(-) diff --git a/module/projectstory/control.php b/module/projectstory/control.php index fbb5c6aa20..1ff274d9b0 100644 --- a/module/projectstory/control.php +++ b/module/projectstory/control.php @@ -115,6 +115,18 @@ class projectStory extends control echo $this->fetch('story', 'track', "productID=$productID&branch=$branch&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID"); } + /** + * View a story. + * + * @param int $storyID + * @access public + * @return void + */ + public function view($storyID) + { + echo $this->fetch('story', 'view', "storyID=$storyID"); + } + /** * Link stories to a project. * diff --git a/module/story/control.php b/module/story/control.php index 9b1f7af097..a1266c2412 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -833,6 +833,11 @@ class story extends control $this->lang->product->switcherMenu = $this->product->getSwitcher($product->id); $this->lang->product->mainMenuAction = $this->product->getProductMainAction(); $this->product->setMenu($this->product->getPairs(), $product->id, $story->branch); + if($this->app->rawModule == 'projectstory') + { + $project = $this->dao->findById((int)$this->session->PRJ)->from(TABLE_PROJECT)->fetch(); + $this->lang->product->menu = $this->lang->menu->{$project->model}; + } if($from == 'project') { diff --git a/module/story/model.php b/module/story/model.php index 1b8859ea6a..eb4bd85079 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -3278,10 +3278,12 @@ class storyModel extends model $canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchReview or $canBatchChangeStage or $canBatchChangeBranch or $canBatchChangeModule or $canBatchChangePlan or $canBatchAssignTo or $canBatchUnlinkStory); - $canView = common::hasPriv('story', 'view'); - $storyLink = helper::createLink('story', 'view', "storyID=$story->id"); - $account = $this->app->user->account; - $id = $col->id; + $canView = common::hasPriv('story', 'view'); + $module = $this->app->rawModule == 'projectstory' ? 'projectstory' : 'story'; + $openModule = $this->app->rawModule == 'projectstory' ? 'project' : 'product'; + $storyLink = helper::createLink($module, 'view', "storyID=$story->id"); + $account = $this->app->user->account; + $id = $col->id; if($col->show) { $class = "c-{$id}"; @@ -3331,7 +3333,7 @@ class storyModel extends model if(isset($storyStages[$story->id])) { foreach($storyStages[$story->id] as $storyBranch => $storyStage) - { + { if(isset($branches[$storyBranch])) $title .= $branches[$storyBranch] . ": " . $this->lang->story->stageList[$storyStage->stage] . "\n"; } } @@ -3344,7 +3346,7 @@ class storyModel extends model case 'id': if($canBatchAction) { - echo html::checkbox('storyIdList', array($story->id => '')) . html::a(helper::createLink('story', 'view', "storyID=$story->id"), sprintf('%03d', $story->id)); + echo html::checkbox('storyIdList', array($story->id => '')) . html::a($storyLink, sprintf('%03d', $story->id), '', "data-group='$openModule'"); } else { @@ -3362,7 +3364,7 @@ class storyModel extends model if($story->branch and isset($branches[$story->branch])) echo "{$branches[$story->branch]} "; if($story->module and isset($modulePairs[$story->module])) echo "{$modulePairs[$story->module]} "; if($story->parent > 0) echo '' . $this->lang->story->childrenAB . ' '; - echo $canView ? html::a($storyLink, $story->title, '', "style='color: $story->color'") : "{$story->title}"; + echo $canView ? html::a($storyLink, $story->title, '', "style='color: $story->color' data-group='$openModule'") : "{$story->title}"; if(!empty($story->children)) echo ''; break; case 'plan': diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index 165ec1dbd5..765a9927f5 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -33,8 +33,8 @@ version; $i >= 1; $i --) { - $class = $i == $version ? " class='active'" : ''; - echo '