ajaxselectstory.html.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?php
  2. /**
  3. * The ajax select story view file of testcase module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2015 禅道软件(青岛)有限公司(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 Yidong Wang <yidong@cnezsoft.com>
  8. * @package testcase
  9. * @version $Id$
  10. * @link http://www.zentao.net
  11. */
  12. ?>
  13. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  14. <div id="mainContent" class="main-content">
  15. <div class='main-header'>
  16. <h2><?php echo $lang->testcase->selectStory;?></h2>
  17. </div>
  18. <form class='main-table' data-ride='table' method='post' target='hiddenwin' id='storyForm' action='<?php echo $this->createLink('testcase', 'exportTemplate', "productID={$product->id}")?>'>
  19. <table class='table table-fixed table-custom' id='storyList'>
  20. <thead>
  21. <tr>
  22. <th class='c-id'>
  23. <div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
  24. <label></label>
  25. </div>
  26. <?php echo $lang->idAB;?>
  27. </th>
  28. <th class='w-pri'><?php echo $lang->priAB;?></th>
  29. <th class='w-80px'><?php echo $lang->story->module;?></th>
  30. <th class='w-80px'><?php echo $lang->story->title;?></th>
  31. <th class='w-80px'><?php echo $lang->story->stage;?></th>
  32. <th class='w-90px'><?php echo $lang->openedByAB;?></th>
  33. <th class='w-80px'><?php echo $lang->story->estimateAB;?></th>
  34. </tr>
  35. </thead>
  36. <?php if($stories):?>
  37. <tbody>
  38. <?php foreach($stories as $story):?>
  39. <?php $storyLink = $this->createLink('story', 'view', "storyID=$story->id");?>
  40. <?php if(empty($story->children)):?>
  41. <tr>
  42. <td class='c-id'>
  43. <div class="checkbox-primary">
  44. <input type='checkbox' name='stories[]' value='<?php echo $story->id;?>' <?php if(strpos(",{$selectedStories},", "{$story->id}") !== false) echo 'checked';?>/>
  45. <label></label>
  46. </div>
  47. <?php echo html::hidden("products[$story->id]", $story->product);?>
  48. <?php printf('%03d', $story->id);?>
  49. </td>
  50. <td><span class='<?php echo 'pri' . zget($lang->story->priList, $story->pri)?>'><?php echo zget($lang->story->priList, $story->pri);?></span></td>
  51. <td class='text-left' title='<?php echo zget($modules, $story->module, '')?>'><?php echo zget($modules, $story->module, '')?></td>
  52. <td class='text-left nobr' title="<?php echo $story->title?>"><?php echo html::a($storyLink, $story->title);?></td>
  53. <td><?php echo zget($lang->story->stageList, $story->stage);?></td>
  54. <td><?php echo zget($users, $story->openedBy);?></td>
  55. <td><?php echo $story->estimate;?></td>
  56. </tr>
  57. <?php else:?>
  58. <?php foreach($story->children as $child):?>
  59. <tr>
  60. <td class='c-id'>
  61. <div class="checkbox-primary">
  62. <input type='checkbox' name='stories[]' value='<?php echo $child->id;?>' <?php if(strpos(",{$selectedStories},", "{$child->id}") !== false) echo 'checked';?>/>
  63. <label></label>
  64. </div>
  65. <?php echo html::hidden("products[$child->id]", $child->product);?>
  66. <?php printf('%03d', $child->id);?>
  67. </td>
  68. <td><span class='<?php echo 'pri' . zget($lang->story->priList, $child->pri)?>'><?php echo zget($lang->story->priList, $child->pri);?></span></td>
  69. <td class='text-left' title='<?php echo zget($modules, $child->module, '')?>'><?php echo zget($modules, $child->module, '')?></td>
  70. <td class='text-left nobr' title="<?php echo $child->title?>"><span class='label'><?php echo $lang->story->childrenAB;?></span> <?php echo html::a($storyLink, $story->title . ' / ' . $child->title);?></td>
  71. <td><?php echo zget($lang->story->stageList, $child->stage);?></td>
  72. <td><?php echo zget($users, $child->openedBy);?></td>
  73. <td><?php echo $child->estimate;?></td>
  74. </tr>
  75. <?php endforeach;?>
  76. <?php endif;?>
  77. <?php endforeach;?>
  78. </tbody>
  79. <?php endif;?>
  80. </table>
  81. <div class='table-footer'>
  82. <div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
  83. <div class="btn-toolbar">
  84. <div class='input-group w-250px'>
  85. <?php
  86. echo html::input('num', '10', "class='form-control w-60px' autocomplete='off' style='border-right:0px;'");
  87. echo "<span class='input-group-addon'></span>";
  88. echo html::select('fileType', array('xlsx' => 'xlsx', 'xls' => 'xls'), 'xlsx', "class='form-control w-80px'");
  89. echo "<span class='input-group-btn'>" . html::submitButton($lang->testcase->exportTemplate) . "</span>";
  90. ?>
  91. </div>
  92. </div>
  93. <?php $pager->show('right', 'pagerjs');?>
  94. </div>
  95. </form>
  96. </div>
  97. <script>
  98. $(function()
  99. {
  100. $.toggleQueryBox(true);
  101. $(document).on('change', 'input:checked', function()
  102. {
  103. selectedStories = '';
  104. $('.cell-id :checked').each(function()
  105. {
  106. if($(this).prop('checked') && $(this).val()) selectedStories += $(this).val() + ','
  107. });
  108. $.cookie('selectedStories', false);
  109. $.cookie('selectedStories[<?php echo $product->id?>]', selectedStories);
  110. });
  111. $('#submit').click(function()
  112. {
  113. setTimeout(function()
  114. {
  115. $('#submit').removeAttr('disabled')
  116. }, 1000);
  117. });
  118. })
  119. </script>
  120. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>