diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php
index ce60d418f3..fd93d75baf 100644
--- a/module/product/view/browse.html.php
+++ b/module/product/view/browse.html.php
@@ -299,7 +299,7 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : '';
$canBatchChangeModule = ($canBeChanged and common::hasPriv($storyType, 'batchChangeModule'));
$canBatchChangePlan = ($canBeChanged and common::hasPriv('story', 'batchChangePlan') and $storyType == 'story');
$canBatchAssignTo = ($canBeChanged and common::hasPriv($storyType, 'batchAssignTo'));
- $canBatchUnlink = ($canBeChanged and $this->app->tab == 'project' and common::hasPriv('projectstory', 'batchUnlinkStory'));
+ $canBatchUnlink = ($canBeChanged and $this->app->tab == 'project' and !empty($project->hasProduct) and common::hasPriv('projectstory', 'batchUnlinkStory'));
$canBatchImportToLib = ($canBeChanged and $this->app->tab == 'project' and isset($this->config->maxVersion) and common::hasPriv('story', 'batchImportToLib'));
$canBatchAction = ($canBatchEdit or $canBatchClose or $canBatchReview or $canBatchChangeStage or $canBatchChangeModule or $canBatchChangePlan or $canBatchAssignTo or $canBatchUnlink or $canBatchImportToLib or $canBatchChangeBranch);
@@ -349,11 +349,11 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : '';
{
if($value->id == 'title' || $value->id == 'id' || $value->id == 'pri' || $value->id == 'status')
{
- $this->story->printCell($value, $story, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table');
+ $this->story->printCell($value, $story, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', $storyType, $project);
}
}?>
- $value) $this->story->printCell($value, $story, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table');?>
+ $value) $this->story->printCell($value, $story, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', $storyType, $project);?>
children)):?>
@@ -369,11 +369,11 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : '';
{
if($value->id == 'title' || $value->id == 'id' || $value->id == 'pri' || $value->id == 'status')
{
- $this->story->printCell($value, $child, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', $storyType);
+ $this->story->printCell($value, $child, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', $storyType, $project);
}
}?>
- $value) $this->story->printCell($value, $child, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', $storyType);?>
+ $value) $this->story->printCell($value, $child, $users, $branchOption, $storyStages, $modulePairs, $storyTasks, $storyBugs, $storyCases, $useDatatable ? 'datatable' : 'table', $storyType, $project);?>
diff --git a/module/story/model.php b/module/story/model.php
index 2a0827c32a..41bdd9805c 100644
--- a/module/story/model.php
+++ b/module/story/model.php
@@ -4280,7 +4280,7 @@ class storyModel extends model
}
$menu .= $this->buildMenu('story', 'batchCreate', "productID=$story->product&branch=$story->branch&module=$story->module&$params&executionID=0&plan=0&storyType=story", $story, $type, 'split', '', 'showinonlybody', '', '', $title);
}
- if($this->app->rawModule == 'projectstory' and $this->config->vision != 'lite') $menu .= $this->buildMenu('projectstory', 'unlinkStory', "projectID={$this->session->project}&$params", $story, $type, 'unlink', 'hiddenwin', 'showinonlybody');
+ if($this->app->rawModule == 'projectstory' and $this->config->vision != 'lite' and $execution->hasProduct) $menu .= $this->buildMenu('projectstory', 'unlinkStory', "projectID={$this->session->project}&$params", $story, $type, 'unlink', 'hiddenwin', 'showinonlybody');
}
else
@@ -4869,7 +4869,6 @@ class storyModel extends model
else
{
$menuType = 'browse';
- $execution = '';
}
echo $this->buildOperateMenu($story, $menuType, $execution);
break;