From 67d7f1f1947ce522f372166e00458063994adc7d Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 13 Jun 2024 15:53:35 +0800 Subject: [PATCH] * [bug#24071,done,0.7h] add story view privilege. --- extension/lite/group/ext/lang/resource.php | 3 ++- module/group/packagemanager.php | 2 +- module/task/js/create.ui.js | 2 +- module/task/ui/create.html.php | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/extension/lite/group/ext/lang/resource.php b/extension/lite/group/ext/lang/resource.php index 262e2c6e70..204f68d7a0 100644 --- a/extension/lite/group/ext/lang/resource.php +++ b/extension/lite/group/ext/lang/resource.php @@ -448,6 +448,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'; $lang->resource->execution->kanban = 'kanban'; //if($config->systemMode == 'classic') $lang->resource->project->list = 'list'; if($config->edition != 'open') $lang->resource->execution->gantt = 'ganttchart'; @@ -503,7 +504,7 @@ $lang->execution->methodOrder[240] = 'storySort'; $lang->execution->methodOrder[245] = 'whitelist'; $lang->execution->methodOrder[250] = 'addWhitelist'; $lang->execution->methodOrder[255] = 'unbindWhitelist'; -$lang->execution->methodOrder[260] = 'storyEstimate'; +$lang->execution->methodOrder[260] = 'storyView'; $lang->execution->methodOrder[270] = 'kanban'; $lang->execution->methodOrder[280] = 'gantt'; $lang->execution->methodOrder[285] = 'calendar'; diff --git a/module/group/packagemanager.php b/module/group/packagemanager.php index ae0b251318..c80b96de8a 100644 --- a/module/group/packagemanager.php +++ b/module/group/packagemanager.php @@ -3303,7 +3303,7 @@ $config->group->package->browseExecutionStory->subset = 'executionstory'; $config->group->package->browseExecutionStory->privs = array(); $config->group->package->browseExecutionStory->privs['execution-story'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite', 'order' => 0, 'depend' => array(), 'recommend' => array('execution-linkStory', 'execution-storyEstimate', 'execution-storyKanban', 'execution-storySort', 'execution-storyView', 'execution-unlinkStory')); $config->group->package->browseExecutionStory->privs['execution-storyKanban'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite', 'order' => 1, 'depend' => array('execution-story'), 'recommend' => array('execution-linkStory', 'execution-storyEstimate', 'execution-storySort', 'execution-storyView', 'execution-unlinkStory')); -$config->group->package->browseExecutionStory->privs['execution-storyView'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd', 'order' => 2, 'depend' => array('execution-story'), 'recommend' => array('execution-linkStory', 'execution-storyEstimate', 'execution-storyKanban', 'execution-storySort', 'execution-unlinkStory')); +$config->group->package->browseExecutionStory->privs['execution-storyView'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite', 'order' => 2, 'depend' => array('execution-story'), 'recommend' => array('execution-linkStory', 'execution-storyEstimate', 'execution-storyKanban', 'execution-storySort', 'execution-unlinkStory', 'execution-storyView')); $config->group->package->manageCard = new stdclass(); $config->group->package->manageCard->order = 20; diff --git a/module/task/js/create.ui.js b/module/task/js/create.ui.js index 71def6bc79..90c752d45a 100644 --- a/module/task/js/create.ui.js +++ b/module/task/js/create.ui.js @@ -294,7 +294,7 @@ function setStoryRelated() function setPreview() { let storyID = $("input[name='story']").val() ? $("input[name='story']").val() : 0; - if(parseFloat(storyID) == 0) + if(parseFloat(storyID) == 0 || !canViewStory) { $('#preview').addClass('hidden'); } diff --git a/module/task/ui/create.html.php b/module/task/ui/create.html.php index ee209f6375..e5fccf2ee1 100644 --- a/module/task/ui/create.html.php +++ b/module/task/ui/create.html.php @@ -26,6 +26,7 @@ jsVar('estimateNotEmpty', sprintf($lang->error->gt, $lang->task->estimateAB, '0' jsVar('taskID', $taskID ?? 0); jsVar('toTaskList', !empty($task->id)); jsVar('showFields', $showFields); +jsVar('canViewStory', common::hasPriv('execution', 'storyView')); if(!empty($task->team)) {