view.html.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  2. <?php include $app->getModuleRoot() . 'common/view/kindeditor.html.php';?>
  3. <?php $browseLink = $app->session->demandList ? $app->session->demandList : inlink('browse', "poolID=$demand->pool");?>
  4. <div id="mainMenu" class="clearfix">
  5. <div class="btn-toolbar pull-left">
  6. <?php if(!isonlybody()):?>
  7. <?php echo html::a($browseLink, '<i class="icon icon-back icon-sm"></i> ' . $lang->goback, '', "class='btn btn-secondary'");?>
  8. <div class="divider"></div>
  9. <?php endif;?>
  10. <div class="page-title">
  11. <span class="label label-id"><?php echo $demand->id?></span>
  12. <span class="text" title='<?php echo $demand->title;?>' style='color: <?php echo $demand->color;?>'>
  13. <?php if($demand->parent > 0) echo '<span class="label label-badge label-primary no-margin">' . $lang->demand->childrenAB . '</span>';?>
  14. <?php if($demand->parent > 0) echo isset($demand->parentName) ? html::a(inlink('view', "demandID={$demand->parent}&version=0", '', true), $demand->parentName, '', isOnlybody() ? '' : "class='iframe' data-width='90%'") . ' / ' : '';?><?php echo $demand->title;?>
  15. </span>
  16. <?php if($demand->version > 1):?>
  17. <small class='dropdown'>
  18. <a href='#' data-toggle='dropdown' class='text-muted'><?php echo '#' . $version;?> <span class='caret'></span></a>
  19. <ul class='dropdown-menu'>
  20. <?php
  21. for($i = $demand->version; $i >= 1; $i --)
  22. {
  23. $class = $i == $version ? " class='active'" : '';
  24. echo '<li' . $class .'>' . html::a(inlink('view', "demandID=$demand->id&version=$i"), '#' . $i) . '</li>';
  25. }
  26. ?>
  27. </ul>
  28. </small>
  29. <?php endif; ?>
  30. <?php if($demand->deleted):?>
  31. <span class='label label-danger'><?php echo $lang->demand->deleted;?></span>
  32. <?php endif; ?>
  33. </div>
  34. </div>
  35. </div>
  36. <div id="mainContent" class="main-row">
  37. <div class="main-col col-8">
  38. <div class="cell">
  39. <div class="detail">
  40. <div class="detail-title"><?php echo $lang->demand->spec;?></div>
  41. <div class="detail-content article-content">
  42. <?php echo !empty($demand->spec) ? $demand->spec: "<div class='text-center text-muted'>" . $lang->noData . '</div>';?>
  43. </div>
  44. </div>
  45. <div class="detail">
  46. <div class="detail-title"><?php echo $lang->demand->verify;?></div>
  47. <div class="detail-content article-content">
  48. <?php echo !empty($demand->verify) ? $demand->verify : "<div class='text-center text-muted'>" . $lang->noData . '</div>';?>
  49. </div>
  50. </div>
  51. <?php echo $this->fetch('file', 'printFiles', array('files' => $demand->files, 'fieldset' => 'true', 'object' => $demand));?>
  52. <?php if(!empty($demand->children)):?>
  53. <div class='detail'>
  54. <div class='detail-title'><?php echo $this->lang->demand->children;?></div>
  55. <div class='detail-content article-content'>
  56. <table class='table table-hover table-fixed'>
  57. <thead>
  58. <tr class='text-center'>
  59. <th class='w-50px'> <?php echo $lang->demand->id;?></th>
  60. <th class='w-40px' title=<?php echo $lang->demand->pri;?>><?php echo $lang->priAB;?></th>
  61. <th><?php echo $lang->demand->title;?></th>
  62. <th class='w-100px'><?php echo $lang->demand->assignedTo;?></th>
  63. <th class='w-80px'> <?php echo $lang->demand->status;?></th>
  64. <th class='w-230px'><?php echo $lang->actions;?></th>
  65. </tr>
  66. </thead>
  67. <tbody>
  68. <?php foreach($demand->children as $child):?>
  69. <tr class='text-center'>
  70. <td><?php echo $child->id;?></td>
  71. <td>
  72. <?php
  73. $priClass = $child->pri ? 'label-pri label-pri-' . $child->pri : '';
  74. echo "<span class='$priClass'>";
  75. echo $child->pri == '0' ? '' : zget($this->lang->demand->priList, $child->pri, $child->pri);
  76. echo "</span>";
  77. ?>
  78. </td>
  79. <td class='text-left' title='<?php echo $child->title;?>'><a <?php echo isOnlybody() ? '' : 'class="iframe"';?> data-width="90%" href="<?php echo $this->createLink('demand', 'view', "demandID=$child->id", '', true); ?>"><?php echo $child->title;?></a></td>
  80. <td><?php echo zget($users, $child->assignedTo, '');?></td>
  81. <td><?php echo $this->processStatus('demand', $child);?></td>
  82. <td class='c-actions'>
  83. <?php
  84. echo $this->demand->buildOperateMenu($child, 'browse');
  85. ?>
  86. </td>
  87. </tr>
  88. <?php endforeach;?>
  89. </tbody>
  90. </table>
  91. </div>
  92. </div>
  93. <?php endif;?>
  94. <?php if($demand->stories):?>
  95. <div class='detail'>
  96. <div class='detail-title'><?php echo $this->lang->demand->distributedStory;?></div>
  97. <div class='detail-content article-content'>
  98. <table class='table table-hover table-fixed'>
  99. <thead>
  100. <tr>
  101. <th class='w-60px'> <?php echo $lang->demand->id;?></th>
  102. <th class='w-200px'><?php echo $lang->demand->product;?></th>
  103. <th><?php echo $lang->demand->title;?></th>
  104. <th class='w-80px'> <?php echo $lang->demand->status;?></th>
  105. <th> <?php echo $lang->demand->roadmapAB;?></th>
  106. <th class='w-100px'><?php echo $lang->actions;?></th>
  107. </tr>
  108. </thead>
  109. <tbody>
  110. <?php foreach($demand->stories as $storyID => $story):?>
  111. <tr class='text-left'>
  112. <td><?php echo $storyID?></td>
  113. <td title="<?php echo zget($products, $story->product, '');?>">
  114. <?php echo zget($products, $story->product, '');?>
  115. </td>
  116. <td title='<?php echo $story->title;?>'><?php echo html::a($this->createLink('story', 'view', "id={$story->id}&version=0&param=0&storyType=requirement", '', true), $story->title, 'hiddenwin', 'class="iframe"');?></td>
  117. <td><?php echo zget($lang->story->statusList, $story->status);?></td>
  118. <td title='<?php echo zget($roadmaps, $story->roadmap, '');?>'><?php echo zget($roadmaps, $story->roadmap, '');?></td>
  119. <td class='c-actions'>
  120. <?php echo common::hasPriv('demand', 'retract') && empty($story->retractedBy) ? html::a($this->createLink('demand', 'retract', "storyID=$storyID", '', true), $lang->demand->retract, 'hiddenwin', 'class="iframe" data-width="90%"') : '';?>
  121. </td>
  122. </tr>
  123. <?php endforeach;?>
  124. </tbody>
  125. </table>
  126. </div>
  127. </div>
  128. <?php endif;?>
  129. <?php $actionFormLink = $this->createLink('action', 'comment', "objectType=demand&objectID=$demand->id");?>
  130. </div>
  131. <div class="cell"><?php include $app->getModuleRoot() . 'common/view/action.html.php';?></div>
  132. <div class='main-actions'>
  133. <div class="btn-toolbar">
  134. <?php common::printBack($browseLink);?>
  135. <?php if(!isonlybody()) echo "<div class='divider'></div>";?>
  136. <?php if(!$demand->deleted) echo $this->demand->buildOperateMenu($demand, 'view');?>
  137. </div>
  138. </div>
  139. </div>
  140. <div class="side-col col-4">
  141. <div class="cell">
  142. <div class='tabs'>
  143. <ul class='nav nav-tabs'>
  144. <li class='active'><a href='#basicInfo' data-toggle='tab'><?php echo $lang->demand->basicInfo;?></a></li>
  145. <li><a href='#lifeTime' data-toggle='tab'><?php echo $lang->demand->lifeTime;?></a></li>
  146. </ul>
  147. <div class='tab-content'>
  148. <div class='tab-pane active' id='basicInfo'>
  149. <table class='table table-data'>
  150. <tbody>
  151. <tr>
  152. <th class='w-100px'><?php echo $lang->demand->pool;?></th>
  153. <td class='c-pool' title='<?php echo zget($demandpools, $demand->pool, '');?>'><?php echo zget($demandpools, $demand->pool, '');?></td>
  154. </tr>
  155. <tr>
  156. <th><?php echo $lang->demand->status;?></th>
  157. <td><?php echo zget($lang->demand->statusList, $demand->status, '');?></td>
  158. </tr>
  159. <tr>
  160. <th><?php echo $lang->demand->product;?></th>
  161. <td>
  162. <?php
  163. $productList = '';
  164. foreach(explode(',', $demand->product) as $product) $productList .= zget($products, $product) . ',';
  165. echo trim($productList, ',') ? trim($productList, ',') : $lang->demand->undetermined;
  166. ?>
  167. </td>
  168. </tr>
  169. <tr>
  170. <th><?php echo $lang->demand->pri;?></th>
  171. <td>
  172. <?php if($demand->pri):?>
  173. <span class='label-pri <?php echo 'label-pri-' . $demand->pri;?>' title='<?php echo zget($lang->demand->priList, $demand->pri);?>'><?php echo zget($lang->demand->priList, $demand->pri)?></span>
  174. <?php endif;?>
  175. </td>
  176. </tr>
  177. <tr>
  178. <th><?php echo $lang->demand->category;?></th>
  179. <td><?php echo zget($lang->demand->categoryList, $demand->category);?></td>
  180. </tr>
  181. <tr>
  182. <th><?php echo $lang->demand->source;?></th>
  183. <td><?php echo zget($lang->demand->sourceList, $demand->source);?></td>
  184. </tr>
  185. <tr>
  186. <th><?php echo $lang->demand->sourceNote;?></th>
  187. <td><?php echo $demand->sourceNote;?></td>
  188. </tr>
  189. <tr>
  190. <th><?php echo $lang->demand->BSA;?></th>
  191. <td><?php echo zget($lang->demand->bsaList, $demand->BSA);?></td>
  192. </tr>
  193. <tr>
  194. <th><?php echo $lang->demand->duration;?></th>
  195. <td><?php echo zget($lang->demand->durationList, $demand->duration);?></td>
  196. </tr>
  197. <tr>
  198. <th><?php echo $lang->demand->feedbackedBy;?></th>
  199. <td><?php echo $demand->feedbackedBy;?></td>
  200. </tr>
  201. <tr>
  202. <th><?php echo $lang->demand->email;?></th>
  203. <td><?php echo $demand->email;?></td>
  204. </tr>
  205. <tr>
  206. <th><?php echo $lang->demand->keywords;?></th>
  207. <td><?php echo $demand->keywords;?></td>
  208. </tr>
  209. <tr>
  210. <th><?php echo $lang->demand->mailto;?></th>
  211. <td><?php if($demand->mailto) foreach(explode(',', $demand->mailto) as $user) echo zget($users, $user, '') . ' '; ?></td>
  212. </tr>
  213. </tbody>
  214. </table>
  215. </div>
  216. <div class='tab-pane' id='lifeTime'>
  217. <table class='table table-data'>
  218. <tbody>
  219. <tr>
  220. <th class='w-100px'><?php echo $lang->demand->createdBy;?></th>
  221. <td><?php echo zget($users, $demand->createdBy, '') . $lang->at . $demand->createdDate;?></td>
  222. </tr>
  223. <tr>
  224. <th><?php echo $lang->demand->assignedTo;?></th>
  225. <td><?php echo zget($users, $demand->assignedTo, '') . $lang->at . (helper::isZeroDate($demand->assignedDate) ? '' : $demand->assignedDate);?></td>
  226. </tr>
  227. <tr>
  228. <th><?php echo $lang->demand->reviewer;?></th>
  229. <td>
  230. <?php
  231. if(!empty($demand->reviewer))
  232. {
  233. foreach($demand->reviewer as $reviewer) echo zget($users, $reviewer, '') . ' ';
  234. }
  235. ?>
  236. </td>
  237. </tr>
  238. <tr>
  239. <th><?php echo $lang->demand->reviewedDate;?></th>
  240. <td><?php echo helper::isZeroDate($demand->reviewedDate) ? '' : $demand->reviewedDate;?></td>
  241. </tr>
  242. <tr>
  243. <th><?php echo $lang->demand->closedBy;?></th>
  244. <td><?php echo zget($users, $demand->closedBy, '');?></td>
  245. </tr>
  246. <tr>
  247. <th><?php echo $lang->demand->closedReason;?></th>
  248. <td><?php echo zget($lang->demand->reasonList, $demand->closedReason, '');?></td>
  249. </tr>
  250. <tr>
  251. <th><?php echo $lang->demand->lastEditedBy;?></th>
  252. <td><?php echo zget($users, $demand->lastEditedBy, '') . $lang->at . helper::isZeroDate($demand->lastEditedDate) ? '' : $demand->lastEditedDate;?></td>
  253. </tr>
  254. </tbody>
  255. </table>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. </div>
  262. <div class="modal fade" id="todemand">
  263. <div class="modal-dialog mw-500px">
  264. <div class="modal-content">
  265. <div class="modal-header">
  266. <button type="button" class="close" data-dismiss="alert">×</button>
  267. <h4 class="modal-title"><?php echo $lang->demand->chooseType;?></h4>
  268. </div>
  269. <div class="modal-body">
  270. <table class='table table-form'>
  271. <tr>
  272. <th><?php echo $lang->demand->demandType;?></th>
  273. <td><?php echo html::radio('totype', $lang->demand->demandTypeList, 'demand');?></td>
  274. <td class='text-center'>
  275. <?php echo html::commonButton($lang->demand->next, "id='todemandBtn'", 'btn btn-primary');?>
  276. <?php echo html::hidden('demand', '');?>
  277. </td>
  278. </tr>
  279. </table>
  280. </div>
  281. </div>
  282. </div>
  283. </div>
  284. <div id="mainActions" class='main-actions'>
  285. <?php common::printPreAndNext($preAndNext);?>
  286. </div>
  287. <script>
  288. $('#todemandBtn').on('click', function()
  289. {
  290. var demandID = $('#demand').val();
  291. var type = $("input[name*='totype']:checked").val();
  292. var link = createLink('demand', 'todemand', 'demandID=' + demandID + '&type=' + type);
  293. location.href = link;
  294. })
  295. function getRequirementID(obj)
  296. {
  297. var demandID = $(obj).attr("data-id");
  298. $('#demand').val(demandID);
  299. }
  300. </script>
  301. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>