m.view.html.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <?php
  2. /**
  3. * The view mobile view file of bug 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 bug
  9. * @version $Id$
  10. * @link http://www.zentao.net
  11. */
  12. $bodyClass = 'with-nav-bottom';
  13. ?>
  14. <?php include '../../common/view/m.header.html.php';?>
  15. <div id='page' class='list-with-actions'>
  16. <div class='heading'>
  17. <div class='title'>
  18. <span class="prefix"> <strong><?php echo $bug->id;?></strong></span>
  19. <strong style='color: <?php echo $bug->color; ?>'><?php echo $bug->title;?></strong>
  20. </div>
  21. <nav class='nav'>
  22. <a href='javascript:history.go(-1);' class='btn primary'><?php echo $lang->goback;?></a>
  23. </nav>
  24. </div>
  25. <div class='section no-margin'>
  26. <div class="outline">
  27. <nav class="nav" data-display="" data-selector="a" data-show-single="true" data-active-class="active" data-animate="false">
  28. <a class="active" data-target="#legendView"><?php echo $lang->bug->view?></a>
  29. <a data-target="#legendBasicInfo"><?php echo $lang->bug->legendBasicInfo?></a>
  30. <a data-target="#legendLife"><?php echo $lang->bug->legendLife?></a>
  31. <a data-target="#legendRelated"><?php echo $lang->bug->legendRelated?></a>
  32. </nav>
  33. <div>
  34. <div class="display in" id="legendView">
  35. <div class='heading gray'>
  36. <div class='title'><strong><?php echo $lang->bug->legendSteps;?></strong></div>
  37. </div>
  38. <div class='article'>
  39. <?php
  40. $tplStep = strip_tags(trim($lang->bug->tplStep));
  41. $steps = str_replace('<p>' . $tplStep, '<p class="stepTitle">' . $tplStep . '</p><p>', $bug->steps);
  42. $tplResult = strip_tags(trim($lang->bug->tplResult));
  43. $steps = str_replace('<p>' . $tplResult, '<p class="stepTitle">' . $tplResult . '</p><p>', $steps);
  44. $tplExpect = strip_tags(trim($lang->bug->tplExpect));
  45. $steps = str_replace('<p>' . $tplExpect, '<p class="stepTitle">' . $tplExpect . '</p><p>', $steps);
  46. $steps = str_replace('<p></p>', '', $steps);
  47. echo $steps;
  48. ?>
  49. </div>
  50. <?php echo $this->fetch('file', 'printFiles', array('files' => $bug->files, 'fieldset' => 'true'));?>
  51. <?php include '../../common/view/m.action.html.php';?>
  52. </div>
  53. <div class="display hidden" id="legendBasicInfo">
  54. <table class='table bordered table-detail'>
  55. <tr valign='middle'>
  56. <th class='w-80px'><?php echo $lang->bug->product;?></th>
  57. <td><?php if(!common::printLink('bug', 'browse', "productID=$bug->product", $product->name)) echo $product->name;?></td>
  58. </tr>
  59. <?php if($this->session->currentProductType != 'normal'):?>
  60. <tr>
  61. <th><?php echo $lang->product->branch;?></th>
  62. <td><?php if(!common::printLink('bug', 'browse', "productID=$bug->product&branch=$bug->branch", $branchName)) echo $branchName;?></td>
  63. </tr>
  64. <?php endif;?>
  65. <tr>
  66. <th><?php echo $lang->bug->module;?></th>
  67. <?php
  68. $moduleTitle = '';
  69. ob_start();
  70. if(empty($modulePath))
  71. {
  72. $moduleTitle .= '/';
  73. echo "/";
  74. }
  75. else
  76. {
  77. foreach($modulePath as $key => $module)
  78. {
  79. $moduleTitle .= $module->name;
  80. if(!common::printLink('bug', 'browse', "productID=$bug->product&branch=$module->branch&browseType=byModule&param=$module->id", $module->name)) echo $module->name;
  81. if(isset($modulePath[$key + 1]))
  82. {
  83. $moduleTitle .= '/';
  84. echo $lang->arrow;
  85. }
  86. }
  87. }
  88. $printModule = ob_get_contents();
  89. ob_end_clean();
  90. ?>
  91. <td title='<?php echo $moduleTitle?>'><?php echo $printModule?></td>
  92. </tr>
  93. <tr valign='middle'>
  94. <th><?php echo $lang->bug->productplan;?></th>
  95. <td><?php echo $bug->planName;?></td>
  96. </tr>
  97. <tr>
  98. <th><?php echo $lang->bug->type;?></th>
  99. <td><?php if(isset($lang->bug->typeList[$bug->type])) echo $lang->bug->typeList[$bug->type]; else echo $bug->type;?></td>
  100. </tr>
  101. <tr>
  102. <th><?php echo $lang->bug->severity;?></th>
  103. <td><span class='<?php echo 'severity' . zget($lang->bug->severityList, $bug->severity);?>'><?php echo zget($lang->bug->severityList, $bug->severity)?></span></td>
  104. </tr>
  105. <tr>
  106. <th><?php echo $lang->bug->pri;?></th>
  107. <td><span class='<?php echo 'pri' . zget($lang->bug->priList, $bug->pri);?>'><?php echo zget($lang->bug->priList, $bug->pri)?></span></td>
  108. </tr>
  109. <tr>
  110. <th><?php echo $lang->bug->status;?></th>
  111. <td class='bug-<?php echo $bug->status?>'><strong><?php echo $lang->bug->statusList[$bug->status];?></strong></td>
  112. </tr>
  113. <tr>
  114. <th><?php echo $lang->bug->activatedCount;?></th>
  115. <td><?php echo $bug->activatedCount;?></td>
  116. </tr>
  117. <tr>
  118. <th><?php echo $lang->bug->confirmed;?></th>
  119. <td><?php echo $lang->bug->confirmedList[$bug->confirmed];?></td>
  120. </tr>
  121. <tr>
  122. <th><?php echo $lang->bug->lblAssignedTo;?></th>
  123. <td><?php if($bug->assignedTo) echo $users[$bug->assignedTo] . $lang->at . $bug->assignedDate;?></td>
  124. </tr>
  125. <tr>
  126. <th><?php echo $lang->bug->deadline;?></th>
  127. <td><?php if($bug->deadline) echo $bug->deadline;?></td>
  128. </tr>
  129. <tr>
  130. <th><?php echo $lang->bug->os;?></th>
  131. <td><?php echo $lang->bug->osList[$bug->os];?></td>
  132. </tr>
  133. <tr>
  134. <th><?php echo $lang->bug->browser;?></th>
  135. <td><?php echo $lang->bug->browserList[$bug->browser];?></td>
  136. </tr>
  137. <tr>
  138. <th><?php echo $lang->bug->keywords;?></th>
  139. <td><?php echo $bug->keywords;?></td>
  140. </tr>
  141. <tr>
  142. <th><?php echo $lang->bug->mailto;?></th>
  143. <td><?php $mailto = explode(',', str_replace(' ', '', $bug->mailto)); foreach($mailto as $account) echo ' ' . $users[$account]; ?></td>
  144. </tr>
  145. </table>
  146. </div>
  147. <div class="display hidden" id="legendLife">
  148. <table class='table bordered table-detail'>
  149. <tr>
  150. <th class='w-80px'><?php echo $lang->bug->openedBy;?></th>
  151. <td> <?php echo $users[$bug->openedBy] . $lang->at . $bug->openedDate;?></td>
  152. </tr>
  153. <tr>
  154. <th><?php echo $lang->bug->openedBuild;?></th>
  155. <td>
  156. <?php
  157. if($bug->openedBuild)
  158. {
  159. $openedBuilds = explode(',', $bug->openedBuild);
  160. foreach($openedBuilds as $openedBuild) isset($builds[$openedBuild]) ? print($builds[$openedBuild] . '<br />') : print($openedBuild . '<br />');
  161. }
  162. else
  163. {
  164. echo $bug->openedBuild;
  165. }
  166. ?>
  167. </td>
  168. </tr>
  169. <tr>
  170. <th><?php echo $lang->bug->lblResolved;?></th>
  171. <td><?php if($bug->resolvedBy) echo $users[$bug->resolvedBy] . $lang->at . $bug->resolvedDate;?></td>
  172. </tr>
  173. <tr>
  174. <th><?php echo $lang->bug->resolvedBuild;?></th>
  175. <td><?php echo zget($builds, $bug->resolvedBuild);?></td>
  176. </tr>
  177. <tr>
  178. <th><?php echo $lang->bug->resolution;?></th>
  179. <td>
  180. <?php
  181. echo $lang->bug->resolutionList[$bug->resolution];
  182. if(isset($bug->duplicateBugTitle)) echo " #$bug->duplicateBug:" . html::a($this->createLink('bug', 'view', "bugID=$bug->duplicateBug"), $bug->duplicateBugTitle);
  183. ?>
  184. </td>
  185. </tr>
  186. <tr>
  187. <th><?php echo $lang->bug->closedBy;?></th>
  188. <td><?php if($bug->closedBy) echo $users[$bug->closedBy] . $lang->at . $bug->closedDate;?></td>
  189. </tr>
  190. <tr>
  191. <th><?php echo $lang->bug->lblLastEdited;?></th>
  192. <td><?php if($bug->lastEditedBy) echo zget($users, $bug->lastEditedBy, $bug->lastEditedBy) . $lang->at . $bug->lastEditedDate?></td>
  193. </tr>
  194. </table>
  195. </div>
  196. <div class="display hidden" id="legendRelated">
  197. <table class='table bordered table-detail'>
  198. <tr>
  199. <th class='w-80px'><?php echo $lang->bug->execution;?></th>
  200. <td><?php if($bug->execution) echo html::a($this->createLink('execution', 'browse', "executionid=$bug->execution"), $bug->executionName);?></td>
  201. </tr>
  202. <tr class='nofixed'>
  203. <th><?php echo $lang->bug->story;?></th>
  204. <td>
  205. <?php
  206. if($bug->story) echo html::a($this->createLink('story', 'view', "storyID=$bug->story"), "#$bug->story $bug->storyTitle");
  207. if($bug->storyStatus == 'active' and $bug->latestStoryVersion > $bug->storyVersion)
  208. {
  209. echo "(<span class='warning'>{$lang->story->changed}</span> ";
  210. echo html::a($this->createLink('bug', 'confirmStoryChange', "bugID=$bug->id"), $lang->confirm, 'hiddenwin');
  211. echo ")";
  212. }
  213. ?>
  214. </td>
  215. </tr>
  216. <tr>
  217. <th><?php echo $lang->bug->task;?></th>
  218. <td><?php if($bug->task) echo html::a($this->createLink('task', 'view', "taskID=$bug->task"), $bug->taskName);?></td>
  219. </tr>
  220. <tr class='text-top'>
  221. <th class='w-80px'><?php echo $lang->bug->linkBug;?></th>
  222. <td>
  223. <?php
  224. if(isset($bug->linkBugTitles))
  225. {
  226. foreach($bug->linkBugTitles as $linkBugID => $linkBugTitle)
  227. {
  228. echo html::a($this->createLink('bug', 'view', "bugID=$linkBugID"), "#$linkBugID $linkBugTitle", '_blank') . '<br />';
  229. }
  230. }
  231. ?>
  232. </td>
  233. </tr>
  234. <?php if($bug->case):?>
  235. <tr>
  236. <th class='w-60px'><?php echo $lang->bug->fromCase;?></th>
  237. <td><?php echo html::a($this->createLink('testcase', 'view', "caseID=$bug->case"), "#$bug->case $bug->caseTitle", '_blank');?></td>
  238. </tr>
  239. <?php endif;?>
  240. <?php if($bug->toCases):?>
  241. <tr>
  242. <th><?php echo $lang->bug->toCase;?></th>
  243. <td>
  244. <?php
  245. foreach($bug->toCases as $caseID => $case)
  246. {
  247. echo '<p style="margin-bottom:0;">' . html::a($this->createLink('testcase', 'view', "caseID=$caseID"), $case) . '</p>';
  248. }
  249. ?>
  250. </td>
  251. </tr>
  252. <?php endif;?>
  253. <?php if($bug->toStory != 0):?>
  254. <tr>
  255. <th><?php echo $lang->bug->toStory;?></th>
  256. <td><?php echo html::a($this->createLink('story', 'view', "storyID=$bug->toStory"), "#$bug->toStory $bug->toStoryTitle", '_blank');?></td>
  257. </tr>
  258. <?php endif;?>
  259. <?php if($bug->toTask != 0):?>
  260. <tr>
  261. <th><?php echo $lang->bug->toTask;?></th>
  262. <td><?php echo html::a($this->createLink('task', 'view', "taskID=$bug->toTask"), "#$bug->toTask $bug->toTaskTitle", '_blank');?></td>
  263. </tr>
  264. <?php endif;?>
  265. </table>
  266. </div>
  267. </div>
  268. </div>
  269. </div>
  270. <nav class='nav nav-auto affix dock-bottom footer-actions'>
  271. <?php
  272. common::printIcon('bug', 'confirmBug', "bugID=$bug->id", $bug, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->bug->confirmBug);
  273. common::printIcon('bug', 'assignTo', "bugID=$bug->id", $bug, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->bug->assignTo);
  274. common::printIcon('bug', 'resolve', "bugID=$bug->id", $bug, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->bug->resolve);
  275. common::printIcon('bug', 'close', "bugID=$bug->id", $bug, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->bug->close);
  276. common::printIcon('bug', 'activate', "bugID=$bug->id", $bug, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->bug->activate);
  277. common::printIcon('bug', 'toStory', "product=$bug->product&branch=$bug->branch&module=0&story=0&execution=0&bugID=$bug->id", $bug, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->bug->toStory);
  278. common::printIcon('bug', 'edit', "bugID=$bug->id", $bug, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->edit);
  279. if(common::hasPriv('bug', 'delete')) echo html::a($this->createLink('bug', 'delete', "bugID=$bug->id"), $lang->delete, 'hiddenwin');
  280. if(common::hasPriv('action', 'comment', $bug)) echo html::a('#commentBox', $lang->comment, '', "data-display data-backdrop='true'");
  281. ?>
  282. </nav>
  283. </div>
  284. <div id='commentBox' class='enter-from-bottom hidden affix layer'>
  285. <div class='heading'>
  286. <div class="title"><?php echo $lang->comment;?></div>
  287. <nav class='nav'><a data-dismiss='display' class='muted'><i class='icon-remove'></i></a></nav>
  288. </div>
  289. <form id='commentForm' target='hiddenwin' class='has-padding' data-form-refresh='#history' method='post' action='<?php echo $this->createLink('action', 'comment',"objectType=bug&objectID=$bug->id")?>'>
  290. <div class='control'><?php echo html::textarea('comment', '',"rows='5' class='textarea' data-default-val");?></div>
  291. <div class='control'><button type='submit' class='btn primary'><?php echo $lang->save ?></button></div>
  292. </form>
  293. </div>
  294. <?php include '../../common/view/m.footer.html.php';?>