diff --git a/module/execution/view/story.html.php b/module/execution/view/story.html.php index 8960abebac..e1f2bd7d83 100644 --- a/module/execution/view/story.html.php +++ b/module/execution/view/story.html.php @@ -78,6 +78,7 @@ id", " " . $lang->story->export, '', "class='btn btn-link export iframe'"); + $canLinkStory = $execution->hasProduct or $execution->multiple; if(common::canModify('execution', $execution)) { $this->lang->story->create = $this->lang->execution->createStory; @@ -122,7 +123,7 @@ $wizardParams = helper::safe64Encode("execution=$execution->id"); echo html::a($this->createLink('tutorial', 'wizard', "module=execution&method=linkStory¶ms=$wizardParams"), " {$lang->execution->linkStory}",'', "class='btn btn-link link-story-btn'"); } - else + elseif($canLinkStory) // The none-product and single execution cann't link stories. { echo "
story->noStory;?> - - createLink('execution', 'linkStory', "execution=$execution->id"), " " . $lang->execution->linkStory, '', "class='btn btn-info'");?> - + createLink('execution', 'linkStory', "execution=$execution->id"), " " . $lang->execution->linkStory, '', "class='btn btn-info'"); + } + else + { + $storyModuleID = (int)$this->cookie->storyModuleParam; + if(common::hasPriv('story', 'create')) + { + $createStoryLink = $this->createLink('story', 'create', "productID=$productID&branch=0&moduleID={$storyModuleID}&story=0&execution=$execution->id"); + echo html::a($createStoryLink, " " . $lang->execution->createStory, '', "class='btn btn-info' data-app=$app->tab"); + } + elseif(common::hasPriv('story', 'batchCreate')) + { + $batchCreateLink = $this->createLink('story', 'batchCreate', "productID=$productID&branch=0&moduleID={$storyModuleID}&story=0&execution=$execution->id"); + echo html::a($batchCreateLink, " " . $lang->story->batchCreate, '', "class='btn btn-info' data-app=$app->tab"); + } + } + } + ?>