linkstories.html.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?php
  2. /**
  3. * The link story view of story module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Shujie Tian <tianshujie@cnezsoft.com>
  8. * @package story
  9. * @version $Id: linkstories.html.php 4129 2022-08-01 14:57:12Z $
  10. * @link https://www.zentao.net
  11. */
  12. ?>
  13. <?php include '../../common/view/header.html.php';?>
  14. <?php include '../../common/view/tablesorter.html.php';?>
  15. <div id='mainContent' class='main-content'>
  16. <div class='main-header'>
  17. <h2>
  18. <span class='label label-id'><?php echo $story->id;?></span>
  19. <?php echo $story->title;?>
  20. <?php $title = $story->type == 'story' ? $lang->story->linkStoriesAB : $lang->story->linkRequirementsAB?>
  21. <small class='text-muted'> <?php echo $lang->arrow . $title;?></small>
  22. </h2>
  23. </div>
  24. <div id='queryBox' data-module='story' class='show divider'></div>
  25. <?php if($stories2Link):?>
  26. <form class='main-table' method='post' data-ride='table' target='hiddenwin' id='linkStoriesForm'>
  27. <table class='table tablesorter' id='storyList'>
  28. <thead>
  29. <tr>
  30. <th class="c-id">
  31. <div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
  32. <label></label>
  33. </div>
  34. <?php echo $lang->idAB;?>
  35. </th>
  36. <th class='c-pri' title=<?php echo $lang->pri;?>><?php echo $lang->priAB;?></th>
  37. <?php if(!empty($product->shadow)):?>
  38. <th class='c-product'><?php echo $lang->story->product;?></th>
  39. <?php endif;?>
  40. <th class='c-title'><?php echo $lang->story->title;?></th>
  41. <th class='c-status'><?php echo $lang->story->statusAB;?></th>
  42. <th class='c-user'><?php echo $lang->story->openedByAB;?></th>
  43. <th class='c-user'><?php echo $lang->story->assignedTo;?></th>
  44. </tr>
  45. </thead>
  46. <tbody>
  47. <?php $storyCount = 0;?>
  48. <?php foreach($stories2Link as $story2Link):?>
  49. <?php $storyLink = $this->createLink('story', 'view', "storyID=$story2Link->id");?>
  50. <tr>
  51. <td class='c-id'>
  52. <div class="checkbox-primary">
  53. <input type='checkbox' name='stories[]' value='<?php echo $story2Link->id;?>'/>
  54. <label></label>
  55. </div>
  56. <?php printf('%03d', $story2Link->id);?>
  57. </td>
  58. <td><span class='label-pri <?php echo 'label-pri-' . $story2Link->pri?>' title='<?php echo zget($lang->story->priList, $story2Link->pri, $story2Link->pri);?>'><?php echo zget($lang->story->priList, $story2Link->pri, $story2Link->pri);?></span></td>
  59. <?php if(!empty($product->shadow)):?>
  60. <td class='nobr' title="<?php echo $products[$story2Link->product]?>"><?php echo html::a($this->createLink('product', 'browse', "productID=$story2Link->product&branch=$story2Link->branch"), $products[$story2Link->product], '_blank');?></td>
  61. <?php endif;?>
  62. <td class='text-left nobr' title="<?php echo $story2Link->title?>"><?php echo $story2Link->title;?></td>
  63. <td><?php echo $this->processStatus('story', $story2Link);?></td>
  64. <td><?php echo zget($users, $story2Link->openedBy);?></td>
  65. <td><?php echo zget($users, $story2Link->assignedTo);?></td>
  66. </tr>
  67. <?php $storyCount ++;?>
  68. <?php endforeach;?>
  69. </tbody>
  70. </table>
  71. <div class='table-footer'>
  72. <div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
  73. <div class="table-actions btn-toolbar"><?php if($storyCount) echo html::submitButton('', '', 'btn btn-default');?></div>
  74. <?php $pager->show('right', 'pagerjs');?>
  75. </div>
  76. </form>
  77. <?php endif;?>
  78. </div>
  79. <?php js::set('storyType', $story->type);?>
  80. <script>
  81. $(function()
  82. {
  83. <?php if($stories2Link):?>
  84. $('#linkStoriesForm').table();
  85. setTimeout(function(){$('#linkStoriesForm .table-footer').removeClass('fixed-footer');}, 100);
  86. <?php endif;?>
  87. $('#submit').click(function()
  88. {
  89. var output = '';
  90. $('#linkStoriesForm').find('tr.checked').each(function(){
  91. var storyID = $(this).find('td.c-id').find('div.checkbox-primary input').attr('value');
  92. var storyTitle = "#" + storyID + ' ' + $(this).find('td').eq(2).attr('title');
  93. var linkStoryField = storyType == 'story' ? 'linkStories' : 'linkRequirements';
  94. var checkbox = "<li><div class='checkbox-primary' title='" + $(this).find('td').eq(2).attr('title') + "'><input type='checkbox' checked='checked' name='" + linkStoryField + "[]' " + "value=" + storyID + " /><label class='linkStoryTitle'>" + storyTitle + "</label></div></li>";
  95. output += checkbox;
  96. });
  97. $.closeModal();
  98. parent.$('#linkStoriesBox').append(output);
  99. return false;
  100. });
  101. });
  102. </script>
  103. <?php include '../../common/view/footer.html.php';?>