From d97b5aeb97e0d441f86ef0781d719339eac51542 Mon Sep 17 00:00:00 2001 From: mayue Date: Tue, 21 Jun 2022 13:30:00 +0800 Subject: [PATCH] * Fix bug #23765. --- module/build/view/view.html.php | 2 +- module/execution/control.php | 15 +++++++++++++++ module/execution/js/kanban.js | 2 +- module/execution/js/taskkanban.js | 2 +- module/execution/lang/en.php | 1 + module/execution/lang/zh-cn.php | 1 + module/execution/model.php | 2 +- module/execution/view/importtask.html.php | 4 ++-- module/execution/view/linkstory.html.php | 2 +- module/execution/view/story.html.php | 2 +- module/execution/view/storykanban.html.php | 2 +- module/execution/view/treestory.html.php | 6 +++--- module/group/lang/resource.php | 1 + module/story/model.php | 2 +- module/story/view/view.html.php | 2 +- module/task/view/view.html.php | 2 +- 16 files changed, 33 insertions(+), 15 deletions(-) diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index 00bf20a69a..4aa19b8b94 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -93,7 +93,7 @@ tbody tr td:first-child input {display: none;} app->tab == 'execution' ? $build->execution : $build->project;?> $story):?> - createLink('story', 'view', "storyID=$story->id&version=0¶m=$objectID", '', true);?> + app->tab == 'execution' ? $this->createLink('execution', 'storyView', "storyID=$story->id", '', true) : $this->createLink('story', 'view', "storyID=$story->id&version=0¶m=$objectID", '', true);?> diff --git a/module/execution/control.php b/module/execution/control.php index 16bcba9dba..d215edae8c 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -871,6 +871,21 @@ class execution extends control $this->display(); } + /** + * View a story. + * + * @param int $storyID + * @access public + * @return void + */ + public function storyView($storyID) + { + $this->session->set('productList', $this->app->getURI(true), 'product'); + + $story = $this->loadModel('story')->getByID($storyID); + echo $this->fetch('story', 'view', "storyID=$storyID&version=$story->version¶m=" . $this->session->execution); + } + /** * Browse bugs of a execution. * diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 9d1c806453..4ee4827f82 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -501,7 +501,7 @@ function renderStoryItem(item, $item, col) if(!$title.length) { $title = $('' + (scaleSize <= 1 ? ' ' : '') + '') - .attr('href', $.createLink('story', 'view', 'storyID=' + item.id + '&version=0¶m=' + execution.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '95%'); + .attr('href', $.createLink('execution', 'storyView', 'storyID=' + item.id + '&version=0¶m=' + execution.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '95%'); $title.appendTo($item); } var title = rdSearchValue != '' ? "" + item.title.replaceAll(rdSearchValue, "" + rdSearchValue + "") + "": "" + item.title + ""; diff --git a/module/execution/js/taskkanban.js b/module/execution/js/taskkanban.js index 8af14dd812..6b6db71515 100644 --- a/module/execution/js/taskkanban.js +++ b/module/execution/js/taskkanban.js @@ -123,7 +123,7 @@ function renderStoryItem(item, $item, col) if(!$title.length) { $title = $('' + (scaleSize <= 1 ? ' ' : '') + '') - .attr('href', $.createLink('story', 'view', 'storyID=' + item.id, '', true)); + .attr('href', $.createLink('execution', 'storyView', 'storyID=' + item.id, '', true)); $title.appendTo($item); } var title = searchValue != '' ? "" + item.title.replaceAll(searchValue, "" + searchValue + "") + "": "" + item.title + ""; diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index c1069f6169..4b79d498cd 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -94,6 +94,7 @@ $lang->execution->viewBug = 'Bugs'; $lang->execution->noProduct = "No {$lang->productCommon} yet."; $lang->execution->createStory = "Create Story"; $lang->execution->storyTitle = "Story Name"; +$lang->execution->storyView = "Story Detail"; $lang->execution->all = "All {$lang->executionCommon}s"; $lang->execution->undone = 'Unfinished '; $lang->execution->unclosed = 'Unclosed'; diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index b026756280..f23b9267e7 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -94,6 +94,7 @@ $lang->execution->viewBug = '查看bug'; $lang->execution->noProduct = "无{$lang->executionCommon}"; $lang->execution->createStory = "提{$lang->SRCommon}"; $lang->execution->storyTitle = "{$lang->SRCommon}名称"; +$lang->execution->storyView = "{$lang->SRCommon}详情"; $lang->execution->all = '所有'; $lang->execution->undone = '未完成'; $lang->execution->unclosed = '未关闭'; diff --git a/module/execution/model.php b/module/execution/model.php index ad8cf6b43e..3ba77a78ee 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -3848,7 +3848,7 @@ class executionModel extends model $storyItem->storyId = $story->id; $storyItem->openedBy = zget($users, $story->openedBy); $storyItem->assignedTo = zget($users, $story->assignedTo); - $storyItem->url = helper::createLink('story', 'view', "storyID=$story->id&version=$story->version&from=execution¶m=$executionID"); + $storyItem->url = helper::createLink('execution', 'storyView', "storyID=$story->id&version=$story->version&from=execution¶m=$executionID"); $storyItem->taskCreateUrl = helper::createLink('task', 'batchCreate', "executionID={$executionID}&story={$story->id}"); $storyTasks = isset($taskGroups[$node->id][$story->id]) ? $taskGroups[$node->id][$story->id] : array(); diff --git a/module/execution/view/importtask.html.php b/module/execution/view/importtask.html.php index a818ff5e31..e213308fb6 100644 --- a/module/execution/view/importtask.html.php +++ b/module/execution/view/importtask.html.php @@ -69,9 +69,9 @@ storyID) { - if(common::hasPriv('story', 'view')) + if(common::hasPriv('execution', 'storyView')) { - echo html::a($this->createLink('story', 'view', "storyid=$task->storyID"), $task->storyTitle, '', "class='preview'", true, isonlybody()); + echo html::a($this->createLink('execution', 'storyView', "storyid=$task->storyID"), $task->storyTitle, '', "class='preview'", true, isonlybody()); } else { diff --git a/module/execution/view/linkstory.html.php b/module/execution/view/linkstory.html.php index a95462dfd7..cf48937571 100644 --- a/module/execution/view/linkstory.html.php +++ b/module/execution/view/linkstory.html.php @@ -55,7 +55,7 @@ - createLink('story', 'view', "storyID=$story->id", '', true);?> + createLink('execution', 'storyView', "storyID=$story->id", '', true);?> id => sprintf('%03d', $story->id)));?> diff --git a/module/execution/view/story.html.php b/module/execution/view/story.html.php index 016866e4c4..32161a7501 100644 --- a/module/execution/view/story.html.php +++ b/module/execution/view/story.html.php @@ -215,7 +215,7 @@ $story):?> createLink('story', 'view', "storyID=$story->id&version=$story->version¶m=$execution->id"); + $storyLink = $this->createLink('execution', 'storyView', "storyID=$story->id&version=$story->version¶m=$execution->id"); $totalEstimate += $story->estimate; ?> diff --git a/module/execution/view/storykanban.html.php b/module/execution/view/storykanban.html.php index 10dce6e821..da91fd5b40 100644 --- a/module/execution/view/storykanban.html.php +++ b/module/execution/view/storykanban.html.php @@ -80,7 +80,7 @@ $account = $this->app->user->account;
- createLink('story', 'view', "story=$story->id", '', true), "#{$story->id} {$story->title}", '', 'class="title kanbaniframe" title="' . $story->title . '"');?> + createLink('execution', 'storyView', "story=$story->id", '', true), "#{$story->id} {$story->title}", '', 'class="title kanbaniframe" title="' . $story->title . '"');?>
story->priList, $story->pri);?> story->statusList[$story->status];?> diff --git a/module/execution/view/treestory.html.php b/module/execution/view/treestory.html.php index 0f82be8180..c7aafbeae6 100644 --- a/module/execution/view/treestory.html.php +++ b/module/execution/view/treestory.html.php @@ -89,7 +89,7 @@ { foreach($story->planTitle as $planID => $planTitle) { - if(!common::printLink('productplan', 'view', "planID=$planID", $planTitle)) echo $lanTitle; + if(!common::printLink('productplan', 'view', "planID=$planID", $planTitle)) echo $planTitle; echo '
'; } } @@ -258,7 +258,7 @@ extraStories[$linkStoryID])) echo '
  • ' . html::a($this->createLink('story', 'view', "storyID=$linkStoryID"), "#$linkStoryID " . $story->extraStories[$linkStoryID]) . '
  • '; + if(isset($story->extraStories[$linkStoryID])) echo '
  • ' . html::a($this->createLink('execution', 'storyView', "storyID=$linkStoryID"), "#$linkStoryID " . $story->extraStories[$linkStoryID]) . '
  • '; } ?> @@ -276,7 +276,7 @@ extraStories[$childStoryID])) echo '
  • ' . html::a($this->createLink('story', 'view', "storyID=$childStoryID"), "#$childStoryID " . $story->extraStories[$childStoryID]) . '
  • '; + if(isset($story->extraStories[$childStoryID])) echo '
  • ' . html::a($this->createLink('execution', 'storyView', "storyID=$childStoryID"), "#$childStoryID " . $story->extraStories[$childStoryID]) . '
  • '; } ?> diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index 32e10087ca..7c00e40205 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -769,6 +769,7 @@ $lang->resource->execution->whitelist = 'whitelist'; $lang->resource->execution->addWhitelist = 'addWhitelist'; $lang->resource->execution->unbindWhitelist = 'unbindWhitelist'; $lang->resource->execution->storyEstimate = 'storyEstimate'; +$lang->resource->execution->storyView = 'storyView'; if($config->systemMode == 'new') $lang->resource->execution->executionkanban = 'kanbanAction'; $lang->resource->execution->kanban = 'RDKanban'; //if($config->systemMode == 'classic') $lang->resource->project->list = 'list'; diff --git a/module/story/model.php b/module/story/model.php index 4dbd940f30..3f77567870 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -4137,7 +4137,7 @@ class storyModel extends model $canView = common::hasPriv($module, 'view'); $tab = $this->app->tab; $executionID = empty($execution) ? $this->session->execution : $execution->id; - $storyLink = $tab == 'execution' ? helper::createLink('story', 'view', "storyID=$story->id&version=$story->version¶m=$executionID") : helper::createLink($module, 'view', "storyID=$story->id"); + $storyLink = $tab == 'execution' ? helper::createLink('execution', 'storyView', "storyID=$story->id") : helper::createLink($module, 'view', "storyID=$story->id"); $account = $this->app->user->account; /* Check the product is closed. */ diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index fa43cce231..c2a92ef17e 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -268,7 +268,7 @@ { foreach($story->planTitle as $planID => $planTitle) { - if(!common::printLink('productplan', 'view', "planID=$planID", $planTitle, '', "data-app='product'")) echo $lanTitle; + if(!common::printLink('productplan', 'view', "planID=$planID", $planTitle, '', "data-app='product'")) echo $planTitle; echo '
    '; } } diff --git a/module/task/view/view.html.php b/module/task/view/view.html.php index 9393cd8ea1..3796adebe0 100644 --- a/module/task/view/view.html.php +++ b/module/task/view/view.html.php @@ -246,7 +246,7 @@ storyTitle) echo $lang->noData; $class = isonlybody() ? 'showinonlybody' : 'iframe'; - if($task->storyTitle and !common::printLink('story', 'view', "storyID=$task->story", $task->storyTitle, '', "class=$class data-width='80%'", true, true)) echo $task->storyTitle; + if($task->storyTitle and !common::printLink('execution', 'storyView', "storyID=$task->story", $task->storyTitle, '', "class=$class data-width='80%'", true, true)) echo $task->storyTitle; if($task->needConfirm) { echo "({$lang->story->changed} ";