track.html.php 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  2. <?php js::set('storyType', 'track');?>
  3. <?php js::set('rawModule', $this->app->rawModule);?>
  4. <style>
  5. .main-table .table td{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;position:unset !important;border-bottom-color:#ddd !important;}
  6. .requirement{background: #fff}
  7. .main-table tbody>tr:hover { background-color: #fff; }
  8. .main-table tbody>tr:nth-child(odd):hover { background-color: #f5f5f5; }
  9. .fix-table-copy-wrapper {overflow: unset !important;}
  10. .table tr > th .dropdown > a.dropdown-toggle {display: flex; align-items: center;}
  11. .table tr > th .dropdown > a.dropdown-toggle .product-name {overflow: hidden;}
  12. </style>
  13. <div id="mainMenu" class="clearfix">
  14. <div class="btn-toolbar pull-left">
  15. <?php
  16. $moreMenu = array();
  17. unset($lang->demand->featureBar['browse']['more']);
  18. foreach($lang->demand->featureBar['browse'] as $label => $labelName)
  19. {
  20. $active = $browseType == $label ? 'btn-active-text' : '';
  21. echo html::a($this->createLink('demandpool', 'track', "poolID=$poolID&browseType=$label&param=0&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"), '<span class="text">' . $labelName . '</span>' . ($browseType == $label ? " <span class='label label-light label-badge'>{$pager->recTotal}</span>" : ''), '', "class='btn btn-link $active'");
  22. }
  23. /* More drop menu. */
  24. echo "<div class='btn-group' id='more'>";
  25. $current = $lang->demand->more;
  26. $active = '';
  27. if(isset($lang->demand->moreSelects['browse']['more'][$browseType]))
  28. {
  29. $current = "<span class='text'>{$lang->demand->moreSelects['browse']['more'][$browseType]}</span> <span class='label label-light label-badge'>{$pager->recTotal}</span>";
  30. $active = 'btn-active-text';
  31. }
  32. echo html::a('javascript:;', $current . " <span class='caret'></span>", '', "data-toggle='dropdown' class='btn btn-link $active'");
  33. echo "<ul class='dropdown-menu'>";
  34. foreach($lang->demand->moreSelects['browse']['more'] as $key => $value)
  35. {
  36. if($key == '') continue;
  37. echo '<li' . ($key == $browseType ? " class='active'" : '') . '>';
  38. echo html::a($this->createLink('demandpool', 'track', "poolID=$poolID&type=$key"), $value);
  39. }
  40. echo '</ul></div>';
  41. ?>
  42. <a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->searchAB;?></a>
  43. </div>
  44. </div>
  45. <div id="mainContent" class="main-row fade">
  46. <div class="main-col">
  47. <div class="cell<?php if($browseType == 'bysearch') echo ' show';?>" id="queryBox" data-module='demand' data-url="<?php echo $this->createLink('search', 'buildOldForm', 'module=demand');?>"></div>
  48. <?php if(empty($tracks)):?>
  49. <div class="table-empty-tip">
  50. <p>
  51. <span class="text-muted"><?php echo $lang->noData;?></span>
  52. </p>
  53. </div>
  54. <?php else:?>
  55. <?php $tab = $this->app->rawModule == 'projectstory' ? 'project' : 'product';?>
  56. <?php $module = $this->app->rawModule == 'projectstory' ? 'projectstory' : 'story';?>
  57. <div class='main-table' data-ride="table">
  58. <table class='table table-bordered' id="trackList">
  59. <thead>
  60. <tr class='text-left'>
  61. <th><?php echo $lang->demandpool->demand;?></th>
  62. <th><?php echo $lang->story->requirement;?></th>
  63. <th><?php echo $lang->storyCommon;?></th>
  64. <th><?php echo $lang->story->tasks;?></th>
  65. <th><?php echo $lang->story->design;?></th>
  66. <th><?php echo $lang->story->case;?></th>
  67. <th><?php echo $lang->story->repoCommit;?></th>
  68. <th><?php echo $lang->story->bug;?></th>
  69. </tr>
  70. </thead>
  71. <tbody>
  72. <?php foreach($tracks as $key => $demand):?>
  73. <tr>
  74. <td <?php if($demand->trackCount != 0) echo "rowspan=" . $demand->trackCount;?> class='requirement' title='<?php echo $demand->title;?>'>
  75. <span class="label label-primary label-outline"><?php echo zget($lang->demand->statusList, $demand->status);?></span>
  76. <?php $title = common::hasPriv('demand', 'view') ? html::a($this->createLink('demand', 'view', "demandID=$demand->id"), $demand->title, '', "title=$demand->title") : $demand->title;?>
  77. <?php echo $title;?>
  78. </td>
  79. <?php if($demand->trackCount != 0):?>
  80. <?php $i = 0;?>
  81. <?php foreach($demand->track as $requirementID => $requirement):?>
  82. <?php if($i > 0) echo "<tr class='collapsed-border'>";?>
  83. <td <?php if($requirement->trackCount != 0) echo "rowspan=" . $requirement->trackCount;?> class='requirement' title='<?php echo $requirement->title;?>'>
  84. <span class="label label-primary label-outline"><?php echo zget($lang->story->statusList, $requirement->status);?></span>
  85. <?php $title = common::hasPriv($requirement->type, 'view') ? html::a($this->createLink('story', 'view', "storyID=$requirement->id&version=0&param=0&storyType=requirement"), $requirement->title, '', "title=$requirement->title data-app='$tab'") : $requirement->title;?>
  86. <?php echo $title;?>
  87. </td>
  88. <?php if($requirement->trackCount != 0):?>
  89. <?php $j = 0;?>
  90. <?php foreach($requirement->track as $storyID => $story):?>
  91. <?php if($j > 0) echo "<tr class='collapsed-border'>";?>
  92. <td>
  93. <?php if(isset($story->parent) && $story->parent > 0 && $story->parent != $requirementID):?><span class="label label-badge label-light" title="<?php echo $this->lang->story->children;?>"><?php echo $this->lang->story->childrenAB;?></span><?php endif;?>
  94. <?php //echo html::a($this->createLink($module, 'view', "storyID=$storyID"), $story->title, '', "title='$story->title' data-app='$tab'");?>
  95. <?php echo "<span title='{$story->title}'>" . $story->title . '</span>';?>
  96. </td>
  97. <td>
  98. <?php foreach($story->tasks as $taskID => $task):?>
  99. <?php //echo html::a($this->createLink('task', 'view', "taskID=$taskID"), $task->name, '', "title='$task->name'") . '<br/>';?>
  100. <?php echo "<span title='{$task->name}'>" . $task->name . '</span><br/>';?>
  101. <?php endforeach;?>
  102. </td>
  103. <td>
  104. <?php foreach($story->designs as $designID => $design):?>
  105. <?php //echo html::a($this->createLink('design', 'view', "designID=$designID"), $design->name, '', "title='$design->name'") . '<br/>';?>
  106. <?php echo "<span title='{$design->name}'>" . $design->name . '</span><br/>';?>
  107. <?php endforeach;?>
  108. </td>
  109. <td>
  110. <?php foreach($story->cases as $caseID => $case):?>
  111. <?php //echo html::a($this->createLink('testcase', 'view', "caseID=$caseID"), $case->title, '', "title='$case->title'") . '<br/>';?>
  112. <?php echo "<span title='{$case->title}'>" . $case->title . '</span><br/>';?>
  113. <?php endforeach;?>
  114. </td>
  115. <?php if(helper::hasFeature('devops')):?>
  116. <td>
  117. <?php foreach($story->revisions as $revision => $repoComment):?>
  118. <?php $comment = '#'. $revision . '-' . $repoComment;?>
  119. <?php //echo html::a($this->createLink('design', 'revision', "repoID=$revision"), $comment, '', "data-app='devops'") . '<br/>';?>
  120. <?php echo "<span title='{$comment}'>" . $comment . '</span><br/>';?>
  121. <?php endforeach;?>
  122. </td>
  123. <?php endif;?>
  124. <td>
  125. <?php foreach($story->bugs as $bugID => $bug):?>
  126. <?php //echo html::a($this->createLink('bug', 'view', "bugID=$bugID"), $bug->title, '', "title='$bug->title'") . '<br/>';?>
  127. <?php echo "<span title='{$bug->title}'>" . $bug->title . '</span><br/>';?>
  128. <?php endforeach;?>
  129. </td>
  130. <?php if($j > 0) echo '</tr>';?>
  131. <?php $j++;?>
  132. <?php endforeach;?>
  133. <?php else:?>
  134. <td></td>
  135. <td></td>
  136. <td></td>
  137. <td></td>
  138. <td></td>
  139. <td></td>
  140. <?php endif;?>
  141. <?php if($i > 0) echo '</tr>';?>
  142. <?php $i++;?>
  143. <?php endforeach;?>
  144. <?php else:?>
  145. <td></td>
  146. <td></td>
  147. <td></td>
  148. <td></td>
  149. <td></td>
  150. <td></td>
  151. <td></td>
  152. <?php endif;?>
  153. </tr>
  154. <?php endforeach;?>
  155. </tbody>
  156. </table>
  157. <div class='table-footer'><?php $pager->show('right', 'pagerjs');?></div>
  158. </div>
  159. <?php endif;?>
  160. </div>
  161. </div>
  162. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>