m.view.html.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <?php
  2. /**
  3. * The view mobile file of story 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 story
  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 $story->id;?></strong></span>
  19. <strong style='color: <?php echo $story->color; ?>'><?php echo $story->title;?></strong>
  20. <?php if($story->version > 1):?>
  21. <select id='version'>
  22. <?php
  23. for($i = $story->version; $i >= 1; $i --)
  24. {
  25. $class = $i == $version ? " selected" : '';
  26. echo "<option value='$i'$class> #$i</option>";
  27. }
  28. ?>
  29. </select>
  30. <script>
  31. $('#version').change(function()
  32. {
  33. location.href = createLink('story', 'view', "storyID=<?php echo $story->id?>&version=" + $(this).val());
  34. });
  35. </script>
  36. <?php endif; ?>
  37. </div>
  38. <nav class='nav'>
  39. <a href='javascript:history.go(-1);' class='btn primary'><?php echo $lang->goback;?></a>
  40. </nav>
  41. </div>
  42. <div class='section no-margin'>
  43. <div class="outline">
  44. <nav class="nav" data-display="" data-selector="a" data-show-single="true" data-active-class="active" data-animate="false">
  45. <a class="active" data-target="#legendView"><?php echo $lang->story->view?></a>
  46. <a data-target="#legendBasicInfo"><?php echo $lang->story->legendBasicInfo?></a>
  47. <a data-target="#legendLifeTime"><?php echo $lang->story->legendLifeTime?></a>
  48. <a data-target="#legendRelated"><?php echo $lang->story->legendRelated?></a>
  49. </nav>
  50. <div>
  51. <div class="display in" id="legendView">
  52. <div class='heading gray'>
  53. <div class='title'><strong><?php echo $lang->story->legendSpec;?></strong></div>
  54. </div>
  55. <div class='article'><?php echo $story->spec;?></div>
  56. <div class='heading gray'>
  57. <div class='title'><strong><?php echo $lang->story->legendVerify;?></strong></div>
  58. </div>
  59. <div class='article'><?php echo $story->verify;?></div>
  60. <?php echo $this->fetch('file', 'printFiles', array('files' => $story->files, 'fieldset' => 'true'));?>
  61. <?php include '../../common/view/m.action.html.php';?>
  62. </div>
  63. <div class="display hidden" id="legendBasicInfo">
  64. <table class='table bordered table-detail'>
  65. <tr>
  66. <th class='w-80px'><?php echo $lang->story->product;?></th>
  67. <td><?php common::printLink('product', 'view', "productID=$story->product", $product->name);?></td>
  68. </tr>
  69. <?php if($product->type != 'normal'):?>
  70. <tr>
  71. <th><?php echo $lang->product->branch;?></th>
  72. <td><?php common::printLink('product', 'browse', "productID=$story->product&branch=$story->branch", $branches[$story->branch]);?></td>
  73. </tr>
  74. <?php endif;?>
  75. <tr>
  76. <th><?php echo $lang->story->module;?></th>
  77. <?php
  78. $moduleTitle = '';
  79. ob_start();
  80. if(empty($modulePath))
  81. {
  82. $moduleTitle .= '/';
  83. echo "/";
  84. }
  85. else
  86. {
  87. foreach($modulePath as $key => $module)
  88. {
  89. $moduleTitle .= $module->name;
  90. if(!common::printLink('product', 'browse', "productID=$story->product&branch=$story->branch&browseType=byModule&param=$module->id", $module->name)) echo $module->name;
  91. if(isset($modulePath[$key + 1]))
  92. {
  93. $moduleTitle .= '/';
  94. echo $lang->arrow;
  95. }
  96. }
  97. }
  98. $printModule = ob_get_contents();
  99. ob_end_clean();
  100. ?>
  101. <td><?php echo $printModule?></td>
  102. </tr>
  103. <tr>
  104. <th><?php echo $lang->story->plan;?></th>
  105. <td>
  106. <?php
  107. if(isset($story->planTitle))
  108. {
  109. foreach($story->planTitle as $planID => $planTitle)
  110. {
  111. if(!common::printLink('productplan', 'view', "planID=$planID", $planTitle)) echo $lanTitle;
  112. echo '<br />';
  113. }
  114. }
  115. ?>
  116. </td>
  117. </tr>
  118. <tr>
  119. <th><?php echo $lang->story->source;?></th>
  120. <td id='source'><?php echo $lang->story->sourceList[$story->source] . ' ' . $story->sourceNote;?></td>
  121. </tr>
  122. <tr>
  123. <th><?php echo $lang->story->status;?></th>
  124. <td class='story-<?php echo $story->status?>'><?php echo $lang->story->statusList[$story->status];?></td>
  125. </tr>
  126. <tr>
  127. <th><?php echo $lang->story->stage;?></th>
  128. <td>
  129. <?php
  130. if($story->stages and $branches)
  131. {
  132. foreach($story->stages as $branch => $stage) if(isset($branches[$branch])) echo $branches[$branch] . ' : ' . $lang->story->stageList[$stage] . '<br />';
  133. }
  134. else
  135. {
  136. echo $lang->story->stageList[$story->stage];
  137. }
  138. ?>
  139. </td>
  140. </tr>
  141. <tr>
  142. <th><?php echo $lang->story->pri;?></th>
  143. <td><span class='<?php echo 'pri' . zget($lang->story->priList, $story->pri);?>'><?php echo zget($lang->story->priList, $story->pri)?></span></td>
  144. </tr>
  145. <tr>
  146. <th><?php echo $lang->story->estimate;?></th>
  147. <td><?php echo $story->estimate;?></td>
  148. </tr>
  149. <tr>
  150. <th><?php echo $lang->story->keywords;?></th>
  151. <td><?php echo $story->keywords;?></td>
  152. </tr>
  153. <tr>
  154. <th><?php echo $lang->story->legendMailto;?></th>
  155. <td><?php $mailto = explode(',', $story->mailto); foreach($mailto as $account) {if(empty($account)) continue; echo "<span>" . $users[trim($account)] . '</span> &nbsp;'; }?></td>
  156. </tr>
  157. </table>
  158. </div>
  159. <div class="display hidden" id="legendLifeTime">
  160. <table class='table bordered table-detail'>
  161. <tr>
  162. <th class='w-80px'><?php echo $lang->story->openedBy;?></th>
  163. <td><?php echo $users[$story->openedBy] . $lang->at . $story->openedDate;?></td>
  164. </tr>
  165. <tr>
  166. <th><?php echo $lang->story->assignedTo;?></th>
  167. <td><?php if($story->assignedTo) echo $users[$story->assignedTo] . $lang->at . $story->assignedDate;?></td>
  168. </tr>
  169. <tr>
  170. <th><?php echo $lang->story->reviewedBy;?></th>
  171. <td><?php $reviewedBy = explode(',', $story->reviewedBy); foreach($reviewedBy as $account) echo ' ' . $users[trim($account)]; ?></td>
  172. </tr>
  173. <tr>
  174. <th><?php echo $lang->story->reviewedDate;?></th>
  175. <td><?php if($story->reviewedBy) echo $story->reviewedDate;?></td>
  176. </tr>
  177. <tr>
  178. <th><?php echo $lang->story->closedBy;?></th>
  179. <td><?php if($story->closedBy) echo $users[$story->closedBy] . $lang->at . $story->closedDate;?></td>
  180. </tr>
  181. <tr>
  182. <th><?php echo $lang->story->closedReason;?></th>
  183. <td>
  184. <?php
  185. if($story->closedReason) echo $lang->story->reasonList[$story->closedReason];
  186. if(isset($story->extraStories[$story->duplicateStory]))
  187. {
  188. echo html::a(inlink('view', "storyID=$story->duplicateStory"), '#' . $story->duplicateStory . ' ' . $story->extraStories[$story->duplicateStory]);
  189. }
  190. ?>
  191. </td>
  192. </tr>
  193. <tr>
  194. <th><?php echo $lang->story->lastEditedBy;?></th>
  195. <td><?php if($story->lastEditedBy) echo $users[$story->lastEditedBy] . $lang->at . $story->lastEditedDate;?></td>
  196. </tr>
  197. </table>
  198. </div>
  199. <div class="display hidden" id="legendRelated">
  200. <table class='table bordered table-detail'>
  201. <tr class='text-top'>
  202. <th class='w-80px'><?php echo $lang->story->legendProjectAndTask?></th>
  203. <td class='pd-0'>
  204. <ul class='list-unstyled'>
  205. <?php
  206. foreach($story->tasks as $executionTasks)
  207. {
  208. foreach($executionTasks as $task)
  209. {
  210. if(!isset($executions[$task->execution])) continue;
  211. $executionName = $executions[$task->execution];
  212. echo "<li title='$task->name'>" . html::a($this->createLink('task', 'view', "taskID=$task->id", '', true), "#$task->id $task->name", '', "class='iframe' data-width='80%'");
  213. echo html::a($this->createLink('execution', 'browse', "executionID=$task->execution"), $executionName, '', "class='text-muted'") . '</li>';
  214. }
  215. }
  216. if(count($story->tasks) == 0)
  217. {
  218. foreach($story->executions as $execution) echo "<li title='$execution->name'>" . $execution->name . '</li>';
  219. }
  220. ?>
  221. </ul>
  222. </td>
  223. </tr>
  224. <?php if(!empty($fromBug)):?>
  225. <tr class='text-top'>
  226. <th class='w-80px'><?php echo $lang->story->legendFromBug;?></th>
  227. <td class='pd-0'>
  228. <ul class='list-unstyled'>
  229. <?php echo "<li title='#$fromBug->id $fromBug->title'>" . html::a($this->createLink('bug', 'view', "bugID=$fromBug->id"), "#$fromBug->id $fromBug->title") . '</li>';?>
  230. </ul>
  231. </td>
  232. </tr>
  233. <?php endif;?>
  234. <tr class='text-top'>
  235. <th class='w-80px'><?php echo $lang->story->legendBugs;?></th>
  236. <td class='pd-0'>
  237. <ul class='list-unstyled'>
  238. <?php
  239. foreach($bugs as $bug)
  240. {
  241. echo "<li title='#$bug->id $bug->title'>" . html::a($this->createLink('bug', 'view', "bugID=$bug->id"), "#$bug->id $bug->title") . '</li>';
  242. }
  243. ?>
  244. </ul>
  245. </td>
  246. </tr>
  247. <tr class='text-top'>
  248. <th><?php echo $lang->story->legendCases;?></th>
  249. <td class='pd-0'>
  250. <ul class='list-unstyled'>
  251. <?php
  252. foreach($cases as $case)
  253. {
  254. echo "<li title='#$case->id $case->title'>" . html::a($this->createLink('testcase', 'view', "caseID=$case->id"), "#$case->id $case->title") . '</li>';
  255. }
  256. ?>
  257. </ul>
  258. </td>
  259. </tr>
  260. <tr class='text-top'>
  261. <th><?php echo $lang->story->legendLinkStories;?></th>
  262. <td class='pd-0'>
  263. <ul class='list-unstyled'>
  264. <?php
  265. $linkStories = explode(',', $story->linkStories) ;
  266. foreach($linkStories as $linkStoryID)
  267. {
  268. if(isset($story->extraStories[$linkStoryID])) echo '<li>' . html::a(inlink('view', "storyID=$linkStoryID"), "#$linkStoryID " . $story->extraStories[$linkStoryID]) . '</li>';
  269. }
  270. ?>
  271. </ul>
  272. </td>
  273. </tr>
  274. <tr class='text-top'>
  275. <th><?php echo $lang->story->legendChildStories;?></th>
  276. <td class='pd-0'>
  277. <ul class='list-unstyled'>
  278. <?php
  279. $childStories = explode(',', $story->childStories) ;
  280. foreach($childStories as $childStoryID)
  281. {
  282. if(isset($story->extraStories[$childStoryID])) echo '<li>' . html::a(inlink('view', "storyID=$childStoryID"), "#$childStoryID " . $story->extraStories[$childStoryID]) . '</li>';
  283. }
  284. ?>
  285. </ul>
  286. </td>
  287. </tr>
  288. </table>
  289. </div>
  290. </div>
  291. </div>
  292. </div>
  293. <nav class='nav nav-auto affix dock-bottom footer-actions'>
  294. <?php
  295. common::printIcon('story', 'change', "storyID=$story->id", $story, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->story->change);
  296. common::printIcon('story', 'close', "storyID=$story->id", $story, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->story->close);
  297. common::printIcon('story', 'activate', "storyID=$story->id", $story, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->story->activate);
  298. if($from == 'execution') common::printIcon('task', 'create', "execution=$param&storyID=$story->id&moduleID=$story->module", $story, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'");
  299. common::printIcon('story', 'edit', "storyID=$story->id", $story, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->edit);
  300. if(common::hasPriv('story', 'delete')) echo html::a($this->createLink('story', 'delete', "storyID=$story->id"), $lang->delete, 'hiddenwin');
  301. if(common::hasPriv('action', 'comment', $story)) echo html::a('#commentBox', $lang->comment, '', "data-display data-backdrop='true'");
  302. ?>
  303. </nav>
  304. </div>
  305. <div id='commentBox' class='enter-from-bottom hidden affix layer'>
  306. <div class='heading'>
  307. <div class="title"><?php echo $lang->comment;?></div>
  308. <nav class='nav'><a data-dismiss='display' class='muted'><i class='icon-remove'></i></a></nav>
  309. </div>
  310. <form id='commentForm' target='hiddenwin' class='has-padding' data-form-refresh='#history' method='post' action='<?php echo $this->createLink('action', 'comment',"objectType=story&objectID=$story->id")?>'>
  311. <div class='control'><?php echo html::textarea('comment', '',"rows='5' class='textarea' data-default-val");?></div>
  312. <div class='control'><button type='submit' class='btn primary'><?php echo $lang->save ?></button></div>
  313. </form>
  314. </div>
  315. <?php include '../../common/view/m.footer.html.php';?>