blocktwins.html.php 1.5 KB

1234567891011121314151617181920212223242526272829
  1. <?php
  2. $lang->story->currentBranch = sprintf($this->lang->story->currentBranch, $this->lang->product->branchName[$product->type]);
  3. js::set('relieveURL', inlink('ajaxRelieveTwins'));
  4. js::set('storyID', $story->id);
  5. js::set('relieved', $lang->story->relieved);
  6. js::set('relievedTip', $lang->story->relievedTip);
  7. js::set('cancel', $lang->cancel);
  8. $canViewLinkStory = common::hasPriv('story', 'view');
  9. $canRelieved = common::hasPriv('story', 'relieved');
  10. array_unshift($twins, $story);
  11. $class = isonlybody() ? 'showinonlybody' : 'iframe';
  12. foreach($twins as $twin)
  13. {
  14. $id = $twin->id;
  15. $title = '#' . $id . ' '. $twin->title;
  16. $branch = isset($branches[$twin->branch]) ? $branches[$twin->branch] : '';
  17. $stage = $lang->story->stageList[$twin->stage];
  18. $labelClass = $story->branch == $twin->branch ? 'label-primary' : '';
  19. $hide = $this->app->rawMethod == 'edit' ? '' : 'hide';
  20. echo "<li title='$title' class='twins'>";
  21. echo "<span class='label {$labelClass} label-outline label-badge' title='$branch'>{$branch}</span> ";
  22. echo "<span class='label label-outline' title='{$stage}'>{$stage}</span> ";
  23. echo ($canViewLinkStory ? html::a($this->createLink('story', 'view', "id=$id", '', true), "$title", '', "class='$class viewlink' data-width='90%'") : "$title");
  24. if($canRelieved) echo "<a class='unlink $hide' data-id='$id' data-toggle='popover'><i class='icon icon-unlink btn-info'></i></a>";
  25. echo "</li>";
  26. }
  27. ?>