* Fix bug #48550, remove actions in closed execution if the closed execution can't be modified.

This commit is contained in:
liumengyi
2024-04-28 09:22:39 +08:00
parent c9299ca4ff
commit 440c199da5
2 changed files with 7 additions and 4 deletions
+6 -3
View File
@@ -375,8 +375,10 @@ if($canBatchAction)
/* DataTable columns. */
$config->story->dtable->fieldList['title']['title'] = $lang->story->title;
$setting = $this->loadModel('datatable')->getSetting('execution', 'story', false, $storyType);
$cols = array();
$cols = array();
$setting = $this->loadModel('datatable')->getSetting('execution', 'story', false, $storyType);
$canModifyExecution = common::canModify('execution', $execution);
if(!$canModifyExecution) $setting['actions']['actionsMap'] = array();
if($storyType == 'requirement') unset($setting['plan'], $setting['stage'], $setting['taskCount'], $setting['bugCount'], $setting['caseCount']);
foreach($setting as $col)
{
@@ -389,13 +391,14 @@ foreach($setting as $col)
}
/* DataTable data. */
$data = array();
$data = array();
$actionMenus = array('submitreview', 'recall', 'recalledchange', 'review', 'dropdown', 'createTask', 'batchCreateTask', 'divider', 'storyEstimate', 'testcase', 'unlink');
if(empty($execution->hasProduct) && empty($execution->multiple))
{
$actionMenus = array('submitreview', 'recall', 'recalledchange', 'review', 'dropdown', 'createTask', 'batchCreateTask', 'edit', 'divider', 'storyEstimate', 'testcase', 'batchCreate', 'close');
if($storyType == 'requirement') $actionMenus = array('submitreview', 'recall', 'recalledchange', 'review', 'dropdown', 'edit', 'divider', 'batchCreate', 'close');
}
if(!$canModifyExecution) $actionMenus = array();
$options = array('storyTasks' => $storyTasks, 'storyBugs' => $storyBugs, 'storyCases' => $storyCases, 'modules' => $modules ?? array(), 'plans' => (isset($plans) ? $plans : array()), 'users' => $users, 'execution' => $execution, 'actionMenus' => $actionMenus, 'branches' => $branchPairs);
foreach($stories as $story)