From b809d304903affc4efbf38523afdee442e9f9f83 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Tue, 2 Apr 2024 15:41:54 +0800 Subject: [PATCH] * Fix bug#46709. Finish task#114584 --- module/execution/ui/story.html.php | 2 +- module/product/ui/browse.html.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/execution/ui/story.html.php b/module/execution/ui/story.html.php index 9e23613822..a1eebc4fb8 100644 --- a/module/execution/ui/story.html.php +++ b/module/execution/ui/story.html.php @@ -268,7 +268,7 @@ $checkObject->execution = $execution->id; $canBatchEdit = common::hasPriv('story', 'batchEdit'); $canBatchClose = common::hasPriv('story', 'batchClose') && $storyType != 'requirement'; $canBatchChangeStage = common::hasPriv('story', 'batchChangeStage') && $storyType != 'requirement'; -$canBatchUnlink = common::hasPriv('execution', 'batchUnlinkStory'); +$canBatchUnlink = $canLinkStory && common::hasPriv('execution', 'batchUnlinkStory'); $canBatchToTask = common::hasPriv('story', 'batchToTask', $checkObject) && $storyType != 'requirement'; $canBatchAssignTo = common::hasPriv($storyType, 'batchAssignTo'); $canBatchAction = $canBeChanged && in_array(true, array($canBatchEdit, $canBatchClose, $canBatchChangeStage, $canBatchUnlink, $canBatchToTask, $canBatchAssignTo)); diff --git a/module/product/ui/browse.html.php b/module/product/ui/browse.html.php index 4f28151933..f2350f7071 100644 --- a/module/product/ui/browse.html.php +++ b/module/product/ui/browse.html.php @@ -208,7 +208,7 @@ foreach($stories as $story) } /* Generate toolbar of DataTable footer. */ -$fnGenerateFootToolbar = function() use ($lang, $product, $productID, $project, $storyType, $browseType, $isProjectStory, $projectHasProduct, $storyProductID, $projectID, $branch, $users, $branchTagOption, $modules, $plans) +$fnGenerateFootToolbar = function() use ($lang, $product, $productID, $project, $storyType, $browseType, $isProjectStory, $projectHasProduct, $storyProductID, $projectID, $branch, $users, $branchTagOption, $modules, $plans, $branchID) { /* Flag variables of permissions. */ $canBeChanged = common::canModify('product', $product); @@ -217,7 +217,7 @@ $fnGenerateFootToolbar = function() use ($lang, $product, $productID, $project, $canBatchReview = $canBeChanged && hasPriv($storyType, 'batchReview'); $canBatchChangeStage = $canBeChanged && hasPriv('story', 'batchChangeStage') && $storyType == 'story'; $canBatchChangeBranch = $canBeChanged && hasPriv($storyType, 'batchChangeBranch') && $product && $product->type != 'normal' && $productID; - $canBatchChangeModule = $canBeChanged && hasPriv($storyType, 'batchChangeModule') && $productID && $product && $product->type == 'normal'; + $canBatchChangeModule = $canBeChanged && hasPriv($storyType, 'batchChangeModule') && $productID && (($product->type != 'normal' && $branchID != 'all') || $product->type == 'normal') && !$isProjectStory; $canBatchChangePlan = $canBeChanged && hasPriv('story', 'batchChangePlan') && $storyType == 'story' && (!$isProjectStory || $projectHasProduct || ($isProjectStory && isset($project->model) && $project->model == 'scrum')) && $productID && $product && $product->type == 'normal'; $canBatchAssignTo = $canBeChanged && hasPriv($storyType, 'batchAssignTo'); $canBatchUnlink = $canBeChanged && $projectHasProduct && hasPriv('projectstory', 'batchUnlinkStory');