diff --git a/module/story/view/affected.html.php b/module/story/view/affected.html.php index 9127a8b87b..a8f580e29b 100644 --- a/module/story/view/affected.html.php +++ b/module/story/view/affected.html.php @@ -1,22 +1,24 @@ twins) ? count(explode( ',', trim($story->twins, ','))) + 1 : 0; -$lang->story->currentBranch = sprintf($this->lang->story->currentBranch, $this->lang->product->branchName[$product->type]); -js::set('relieveURL', inlink('ajaxRelieveTwins')); -js::set('storyID', $story->id); -js::set('relieved', $lang->story->relieved); -js::set('relievedTip', $lang->story->relievedTip); -js::set('cancel', $lang->cancel); -$canViewLinkStory = common::hasPriv('story', 'view'); -$canRelieved = common::hasPriv('story', 'relieved'); -array_unshift($twins, $story); -$twinsClass = isonlybody() ? 'showinonlybody' : 'iframe'; -?> +if(isset($twins)) +{ + $twinsCount = !empty($story->twins) ? count(explode( ',', trim($story->twins, ','))) + 1 : 0; + $lang->story->currentBranch = sprintf($this->lang->story->currentBranch, $this->lang->product->branchName[$product->type]); + js::set('relieveURL', inlink('ajaxRelieveTwins')); + js::set('storyID', $story->id); + js::set('relieved', $lang->story->relieved); + js::set('relievedTip', $lang->story->relievedTip); + js::set('cancel', $lang->cancel); + $canViewLinkStory = common::hasPriv('story', 'view'); + $canRelieved = common::hasPriv('story', 'relieved'); + array_unshift($twins, $story); + $twinsClass = isonlybody() ? 'showinonlybody' : 'iframe'; +}?>
@@ -112,7 +114,7 @@ $twinsClass = isonlybody() ? 'showinonlybody' : 'iframe';
- +
diff --git a/module/story/view/blocktwins.html.php b/module/story/view/blocktwins.html.php deleted file mode 100644 index 397f9f83b2..0000000000 --- a/module/story/view/blocktwins.html.php +++ /dev/null @@ -1,28 +0,0 @@ -story->currentBranch = sprintf($this->lang->story->currentBranch, $this->lang->product->branchName[$product->type]); -js::set('relieveURL', inlink('ajaxRelieveTwins')); -js::set('storyID', $story->id); -js::set('relieved', $lang->story->relieved); -js::set('relievedTip', $lang->story->relievedTip); -js::set('cancel', $lang->cancel); -$canViewLinkStory = common::hasPriv('story', 'view'); -$canRelieved = common::hasPriv('story', 'relieved'); -array_unshift($twins, $story); -$class = isonlybody() ? 'showinonlybody' : 'iframe'; - -foreach($twins as $twin) -{ - $id = $twin->id; - $title = '#' . $id . ' '. $twin->title; - $branch = isset($branches[$twin->branch]) ? $branches[$twin->branch] : ''; - $stage = $lang->story->stageList[$twin->stage]; - $labelClass = $story->branch == $twin->branch ? 'label-primary' : ''; - - echo "
  • "; - echo "{$branch} "; - echo "{$stage} "; - echo ($canViewLinkStory ? html::a($this->createLink('story', 'view', "id=$id", '', true), "$title", '', "class='$class viewlink' data-width='80%'") : "$title"); - if($canRelieved) echo ""; - echo "
  • "; -} -?>