diff --git a/db/zentao.sql b/db/zentao.sql index 33125d69f5..679d090e97 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -2034,6 +2034,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (1,'execution','putoff'), (1,'execution','start'), (1,'execution','story'), +(1,'execution','storyView'), (1,'execution','storyEstimate'), (1,'execution','storyKanban'), (1,'execution','storySort'), @@ -2584,6 +2585,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (2,'execution','manageMembers'), (2,'execution','printKanban'), (2,'execution','story'), +(2,'execution','storyView'), (2,'execution','storyEstimate'), (2,'execution','storyKanban'), (2,'execution','task'), @@ -2882,6 +2884,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (3,'execution','index'), (3,'execution','kanban'), (3,'execution','story'), +(3,'execution','storyView'), (3,'execution','task'), (3,'execution','team'), (3,'execution','testcase'), @@ -3236,6 +3239,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (4,'execution','putoff'), (4,'execution','start'), (4,'execution','story'), +(4,'execution','storyView'), (4,'execution','storyEstimate'), (4,'execution','storyKanban'), (4,'execution','storySort'), @@ -3732,6 +3736,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (5,'execution','putoff'), (5,'execution','start'), (5,'execution','story'), +(5,'execution','storyView'), (5,'execution','storyEstimate'), (5,'execution','storyKanban'), (5,'execution','storySort'), @@ -4181,6 +4186,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (6,'execution','putoff'), (6,'execution','start'), (6,'execution','story'), +(6,'execution','storyView'), (6,'execution','storyEstimate'), (6,'execution','storyKanban'), (6,'execution','storySort'), @@ -4548,6 +4554,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (7,'execution','linkStory'), (7,'execution','manageProducts'), (7,'execution','story'), +(7,'execution','storyView'), (7,'execution','storyKanban'), (7,'execution','storySort'), (7,'execution','task'), @@ -4951,6 +4958,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (8,'execution','index'), (8,'execution','kanban'), (8,'execution','story'), +(8,'execution','storyView'), (8,'execution','storyKanban'), (8,'execution','task'), (8,'execution','team'), @@ -5329,6 +5337,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (9,'execution','kanban'), (9,'execution','manageMembers'), (9,'execution','story'), +(9,'execution','storyView'), (9,'execution','storyKanban'), (9,'execution','storySort'), (9,'execution','task'), @@ -5646,6 +5655,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (10,'execution','index'), (10,'execution','kanban'), (10,'execution','story'), +(10,'execution','storyView'), (10,'execution','task'), (10,'execution','team'), (10,'execution','testtask'), @@ -5879,6 +5889,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (11,'execution','index'), (11,'execution','kanban'), (11,'execution','story'), +(11,'execution','storyView'), (11,'execution','task'), (11,'execution','team'), (11,'execution','testcase'), diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php index 4aa19b8b94..8cf2726cdc 100644 --- a/module/build/view/view.html.php +++ b/module/build/view/view.html.php @@ -91,9 +91,7 @@ tbody tr td:first-child input {display: none;} - app->tab == 'execution' ? $build->execution : $build->project;?> $story):?> - app->tab == 'execution' ? $this->createLink('execution', 'storyView', "storyID=$story->id", '', true) : $this->createLink('story', 'view', "storyID=$story->id&version=0¶m=$objectID", '', true);?> @@ -106,7 +104,18 @@ tbody tr td:first-child input {display: none;} parent > 0) echo "{$lang->story->childrenAB}"; - echo html::a($storyLink,$story->title, '', isonlybody() ? "data-width='1000'" : "class='iframe' data-width='1000'"); + if($this->app->tab == 'execution' and common::hasPriv('execution', 'storyView')) + { + echo html::a($this->createLink('execution', 'storyView', "storyID=$story->id", '', true), $story->title, '', isonlybody() ? "data-width='1000'" : "class='iframe' data-width='1000'"); + } + elseif($this->app->tab == 'project' and common::hasPriv('projectstory', 'view')) + { + echo html::a($this->createLink('projectstory', 'view', "storyID=$story->id&version=0¶m=$build->project", '', true), $story->title, '', isonlybody() ? "data-width='1000'" : "class='iframe' data-width='1000'"); + } + else + { + echo '' . $story->title . ''; + } ?> openedBy);?> diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js index 4ee4827f82..ada070e212 100644 --- a/module/execution/js/kanban.js +++ b/module/execution/js/kanban.js @@ -500,8 +500,8 @@ function renderStoryItem(item, $item, col) var $title = $item.find('.title'); if(!$title.length) { - $title = $('' + (scaleSize <= 1 ? ' ' : '') + '') - .attr('href', $.createLink('execution', 'storyView', 'storyID=' + item.id + '&version=0¶m=' + execution.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '95%'); + $title = $('' + (scaleSize <= 1 ? ' ' : '') + ''); + if(priv.canViewStory) $title = $title.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 + ""; @@ -565,8 +565,8 @@ function renderBugItem(item, $item, col) var $title = $item.find('.title'); if(!$title.length) { - $title = $('' + (scaleSize <= 1 ? ' ' : '') + '') - .attr('href', $.createLink('bug', 'view', 'bugID=' + item.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '80%'); + $title = $('' + (scaleSize <= 1 ? ' ' : '') + ''); + if(priv.canViewBug) $title =$title.attr('href', $.createLink('bug', 'view', 'bugID=' + item.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '80%'); $title.appendTo($item); } var title = rdSearchValue != '' ? "" + item.title.replaceAll(rdSearchValue, "" + rdSearchValue + "") + "": "" + item.title + ""; @@ -632,7 +632,8 @@ function renderTaskItem(item, $item, col) var $title = $item.find('.title'); if(!$title.length) { - $title = $('' + (scaleSize <= 1 ? ' ' : '') + '').attr('href', $.createLink('task', 'view', 'taskID=' + item.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '80%'); + $title = $('' + (scaleSize <= 1 ? ' ' : '') + ''); + if(priv.canViewTask) $title = $title.attr('href', $.createLink('task', 'view', 'taskID=' + item.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '80%'); $title.appendTo($item); } var name = rdSearchValue != '' ? "" + item.name.replaceAll(rdSearchValue, "" + rdSearchValue + "") + "": "" + item.name + ""; diff --git a/module/execution/view/kanban.html.php b/module/execution/view/kanban.html.php index 3ac51f7c60..df3d0fa098 100644 --- a/module/execution/view/kanban.html.php +++ b/module/execution/view/kanban.html.php @@ -87,6 +87,7 @@ js::set('priv', 'canBatchCreateStory' => $canBatchCreateStory, 'canLinkStory' => $canLinkStory, 'canLinkStoryByPlan' => $canLinkStoryByPlan, + 'canViewBug' => common::hasPriv('bug', 'view'), 'canAssignBug' => common::hasPriv('bug', 'assignto'), 'canConfirmBug' => common::hasPriv('bug', 'confirmBug'), 'canResolveBug' => common::hasPriv('bug', 'resolve'), @@ -94,6 +95,7 @@ js::set('priv', 'canEditBug' => common::hasPriv('bug', 'edit'), 'canDeleteBug' => common::hasPriv('bug', 'delete'), 'canActivateBug' => common::hasPriv('bug', 'activate'), + 'canViewTask' => common::hasPriv('task', 'view'), 'canAssignTask' => common::hasPriv('task', 'assignto'), 'canFinishTask' => common::hasPriv('task', 'finish'), 'canPauseTask' => common::hasPriv('task', 'pause'), @@ -113,6 +115,7 @@ js::set('priv', 'canChangeStory' => common::hasPriv('story', 'change'), 'canCloseStory' => common::hasPriv('story', 'close'), 'canUnlinkStory' => common::hasPriv('execution', 'unlinkStory'), + 'canViewStory' => common::hasPriv('execution', 'storyView'), ) ); ?> diff --git a/module/execution/view/linkstory.html.php b/module/execution/view/linkstory.html.php index cf48937571..8c2aa6ae74 100644 --- a/module/execution/view/linkstory.html.php +++ b/module/execution/view/linkstory.html.php @@ -65,7 +65,14 @@ parent > 0) echo "{$lang->story->childrenAB}"; - echo html::a($storyLink, $story->title, '', "class='iframe' data-width='80%'"); + if(common::hasPriv('execution', 'storyView')) + { + echo html::a($storyLink, $story->title, '', "class='iframe' data-width='80%'"); + } + else + { + echo '' . $story->title . ''; + } ?> createLink('product', 'browse', "productID=$story->product&branch=$story->branch"), $products[$story->product]->name);?> diff --git a/module/execution/view/story.html.php b/module/execution/view/story.html.php index ced92cc055..d0e2e3f059 100644 --- a/module/execution/view/story.html.php +++ b/module/execution/view/story.html.php @@ -225,7 +225,6 @@ $story):?> 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 7a11734a7a..eddd70ee35 100644 --- a/module/execution/view/storykanban.html.php +++ b/module/execution/view/storykanban.html.php @@ -84,7 +84,16 @@ $account = $this->app->user->account;
- createLink('execution', 'storyView', "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 . '"'); + } + else + { + echo "" . "#" . $story->id . $story->title . ""; + } + ?>
story->priList, $story->pri);?> story->statusList[$story->status];?> diff --git a/module/task/js/create.js b/module/task/js/create.js index ec3449172a..3c3c133f7b 100644 --- a/module/task/js/create.js +++ b/module/task/js/create.js @@ -184,7 +184,7 @@ function setPreview() } else { - storyLink = createLink('story', 'view', "storyID=" + $('#story').val()); + storyLink = createLink('execution', 'storyView', "storyID=" + $('#story').val()); var concat = storyLink.indexOf('?') < 0 ? '?' : '&'; if(storyLink.indexOf("onlybody=yes") < 0) storyLink = storyLink + concat + 'onlybody=yes'; diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php index e6997fac75..e9a1510f9a 100644 --- a/module/task/view/create.html.php +++ b/module/task/view/create.html.php @@ -104,7 +104,9 @@ task->noticeLinkStory, html::a($this->createLink('execution', 'linkStory', "executionID=$execution->id"), $lang->execution->linkStory, '', 'class="text-primary"'), html::a("javascript:loadStories($execution->id)", $lang->refresh, '', 'class="text-primary"'));?>
story, "class='form-control chosen' onchange='setStoryRelated();'");?> + preview;?> +
diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 8d8d3a8325..3eed0e4332 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -515,6 +515,9 @@ class upgradeModel extends model $this->replaceSetLanePriv(); $this->updateProjectData(); break; + case '17_1': + $this->addStoryViewPriv(); + break; } $this->deletePatch(); @@ -6437,4 +6440,29 @@ class upgradeModel extends model return true; } + + /** + * Insert story view of execution. + * + * @access public + * @return bool + */ + public function addStoryViewPriv() + { + $groupIdList = $this->dao->select('`group`')->from(TABLE_GROUPPRIV) + ->where('module')->eq('story') + ->andWhere('method')->eq('view') + ->fetchPairs('group'); + + foreach($groupIdList as $groupID) + { + $this->dao->replace(TABLE_GROUPPRIV) + ->set('`group`')->eq($groupID) + ->set('module')->eq('execution') + ->set('method')->eq('storyView') + ->exec(); + } + + return true; + } }