m.view.html.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  1. <?php
  2. /**
  3. * The view mobile file of task 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 Fei Chen <chenfei@cnezsoft.com>
  8. * @package task
  9. * @version $Id$
  10. * @link http://www.zentao.net
  11. */
  12. ?>
  13. <?php
  14. $bodyClass = 'with-nav-bottom';
  15. include "../../common/view/m.header.html.php";
  16. $isTaskDone = $task->status == 'done';
  17. $isTaskClosed = $task->status == 'closed';
  18. $statusIcons = array();
  19. $statusIcons['wait'] = 'time';
  20. $statusIcons['doing'] = 'play';
  21. $statusIcons['done'] = 'check';
  22. $statusIcons['cancel'] = 'times';
  23. $statusIcons['closed'] = 'minus';
  24. $headingColor = $isTaskClosed ? 'dark' : ($isTaskDone ? 'success' : 'pri-' . $task->pri);
  25. ?>
  26. <style>.pri-0 {background: #666;}</style>
  27. <div id='page' class='list-with-actions'>
  28. <div class='heading gray'>
  29. <div class='title'>
  30. <span class="prefix"> <strong><?php echo $task->id;?></strong></span>
  31. <?php if(!empty($task->parent)) echo '<span class="label label-badge label-primary no-margin">' . $this->lang->task->childrenAB . '</span>';?>
  32. <?php if(!empty($task->team)) echo '<span class="label label-badge label-primary no-margin">' . $this->lang->task->multipleAB . '</span>';?>
  33. <strong>
  34. <?php echo isset($task->parentName) ? html::a(inlink('view', "taskID={$task->parent}"), $task->parentName) . ' / ' : '';?>
  35. <span style='color: <?php echo $task->color; ?>'><?php echo $task->name;?></span>
  36. </strong>
  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="#legendDesc"><?php echo $lang->task->legendDesc?></a>
  46. <a data-target="#legendBasicInfo"><?php echo $lang->task->legendBasic?></a>
  47. <?php if(!empty($task->team)):?>
  48. <a data-target="#legendTeam"><?php echo $lang->task->team;?></a>
  49. <?php endif;?>
  50. <a data-target="#legendEffort"><?php echo $lang->task->legendEffort?></a>
  51. <a data-target="#legendLife"><?php echo $lang->task->legendLife?></a>
  52. </nav>
  53. <div>
  54. <div class="display in" id="legendDesc">
  55. <div class='heading gray'>
  56. <div class='title'><strong><?php echo $lang->task->legendDesc;?></strong></div>
  57. </div>
  58. <div class='article'><?php echo $task->desc;?></div>
  59. <?php if($task->fromBug != 0):?>
  60. <div class='heading gray'>
  61. <div class='title'><strong><?php echo $lang->bug->steps;?></strong></div>
  62. </div>
  63. <div class='article'><?php echo $task->bugSteps;?></div>
  64. <?php else:?>
  65. <?php if($task->storySpec or $task->storyFiles):?>
  66. <div class='heading gray'>
  67. <div class='title'><strong><?php echo $lang->task->storySpec;?></strong></div>
  68. </div>
  69. <div class='article'>
  70. <?php echo $task->storySpec;?>
  71. <?php echo $this->fetch('file', 'printFiles', array('files' => $task->storyFiles, 'fieldset' => 'false'));?>
  72. </div>
  73. <?php endif;?>
  74. <?php if($task->storyVerify):?>
  75. <div class='heading gray'>
  76. <div class='title'><strong><?php echo $lang->task->storyVerify;?></strong></div>
  77. </div>
  78. <div class='article'><?php echo $task->storyVerify;?></div>
  79. <?php endif;?>
  80. <?php endif;?>
  81. <?php if(isset($task->cases) and $task->cases):?>
  82. <div class='heading gray'>
  83. <div class='title'><strong><?php echo $lang->task->case;?></strong></div>
  84. </div>
  85. <div class='article'>
  86. <ul class='list-unstyled'>
  87. <?php foreach($task->cases as $caseID => $case) echo '<li>' . html::a($this->createLink('testcase', 'view', "caseID=$caseID", '', true), "#$caseID " . $case, '', "data-toggle='modal' data-type='iframe' data-width='90%'") . '</li>';?>
  88. </ul>
  89. </div>
  90. <?php endif;?>
  91. <?php if(!empty($task->children)):?>
  92. <div class='content'>
  93. <table class='table table-hover table-fixed'>
  94. <thead>
  95. <tr class='text-center'>
  96. <th><?php echo $lang->task->children;?></th>
  97. <th class='w-80px'> <?php echo $lang->task->assignedTo;?></th>
  98. <th class='w-80px'> <?php echo $lang->task->status;?></th>
  99. </tr>
  100. </thead>
  101. <tbody>
  102. <?php foreach($task->children as $child):?>
  103. <tr class='text-center'>
  104. <td class='text-left' title='<?php echo $child->name;?>'><a class="iframe" data-width="90%" href="<?php echo $this->createLink('task', 'view', "taskID=$child->id", '', true); ?>"><?php echo $child->name;?></a></td>
  105. <td><?php if(isset($users[$child->assignedTo])) echo $users[$child->assignedTo];?></td>
  106. <td><?php echo zget($lang->task->statusList, $child->status);?></td>
  107. </tr>
  108. <?php endforeach;?>
  109. </tbody>
  110. </table>
  111. </div>
  112. <?php endif;?>
  113. <?php echo $this->fetch('file', 'printFiles', array('files' => $task->files, 'fieldset' => 'true'));?>
  114. <?php include '../../common/view/m.action.html.php';?>
  115. </div>
  116. <div class="display hidden" id="legendBasicInfo">
  117. <table class='table bordered table-detail'>
  118. <tr>
  119. <th class='w-80px'><?php echo $lang->task->execution;?></th>
  120. <td><?php echo $execution->name;?></td>
  121. </tr>
  122. <tr>
  123. <th><?php echo $lang->task->module;?></th>
  124. <?php
  125. $moduleTitle = '';
  126. ob_start();
  127. if(empty($modulePath))
  128. {
  129. $moduleTitle .= '/';
  130. echo "/";
  131. }
  132. else
  133. {
  134. if($product)
  135. {
  136. $moduleTitle .= $product->name . '/';
  137. echo $product->name . $lang->arrow;
  138. }
  139. foreach($modulePath as $key => $module)
  140. {
  141. $moduleTitle .= $module->name;
  142. echo $module->name;
  143. if(isset($modulePath[$key + 1]))
  144. {
  145. $moduleTitle .= '/';
  146. echo $lang->arrow;
  147. }
  148. }
  149. }
  150. $printModule = ob_get_contents();
  151. ob_end_clean();
  152. ?>
  153. <td><?php echo $printModule?></td>
  154. </tr>
  155. <tr>
  156. <th><?php echo $lang->task->story;?></th>
  157. <td>
  158. <?php
  159. if($task->storyTitle and !common::printLink('story', 'view', "storyID=$task->story", $task->storyTitle, '', "class='iframe' data-width='80%'", true, true)) echo $task->storyTitle;
  160. if($task->needConfirm)
  161. {
  162. echo "(<span class='warning'>{$lang->story->changed}</span> ";
  163. echo html::a($this->createLink('task', 'confirmStoryChange', "taskID=$task->id"), $lang->confirm, 'hiddenwin');
  164. echo ")";
  165. }
  166. ?>
  167. </td>
  168. </tr>
  169. <?php if($task->fromBug):?>
  170. <tr>
  171. <th><?php echo $lang->task->fromBug;?></th>
  172. <td><?php echo html::a($this->createLink('bug', 'view', "bugID=$task->fromBug"), "#$task->fromBug " . $fromBug->title, '_blank');?></td>
  173. </tr>
  174. <?php endif;?>
  175. <tr>
  176. <th><?php echo $lang->task->assignedTo;?></th>
  177. <td><?php echo $task->assignedTo ? $task->assignedToRealName . $lang->at . $task->assignedDate : '';?></td>
  178. </tr>
  179. <tr>
  180. <th><?php echo $lang->task->type;?></th>
  181. <td><?php echo $lang->task->typeList[$task->type];?></td>
  182. </tr>
  183. <tr>
  184. <th><?php echo $lang->task->status;?></th>
  185. <td><span class='label status-<?php echo $task->status;?>'><?php echo $lang->task->statusList[$task->status];?></span></td>
  186. </tr>
  187. <tr>
  188. <th><?php echo $lang->task->pri;?></th>
  189. <td><?php echo $lang->task->priList[$task->pri];?></td>
  190. </tr>
  191. <tr>
  192. <th><?php echo $lang->task->mailto;?></th>
  193. <td><?php $mailto = explode(',', str_replace(' ', '', $task->mailto)); foreach($mailto as $account) echo ' ' . zget($users, $account, $account); ?></td>
  194. </tr>
  195. </table>
  196. </div>
  197. <?php if(!empty($task->team)):?>
  198. <div class="display hidden" id="legendTeam">
  199. <table class='table bordered table-detail'>
  200. <thead>
  201. <tr>
  202. <th><?php echo $lang->task->team?></th>
  203. <th class='text-center'><?php echo $lang->task->estimate?></th>
  204. <th class='text-center'><?php echo $lang->task->consumed?></th>
  205. <th class='text-center'><?php echo $lang->task->left?></th>
  206. </tr>
  207. </thead>
  208. <?php foreach($task->team as $member):?>
  209. <tr class='text-center'>
  210. <td class='text-left'><?php echo zget($users, $member->account)?></td>
  211. <td><?php echo (float)$member->estimate?></td>
  212. <td><?php echo (float)$member->consumed?></td>
  213. <td><?php echo (float)$member->left?></td>
  214. </tr>
  215. <?php endforeach;?>
  216. </table>
  217. </div>
  218. <?php endif;?>
  219. <div class="display hidden" id="legendEffort">
  220. <table class='table bordered table-detail'>
  221. <tr>
  222. <th class='w-80px'><?php echo $lang->task->estStarted;?></th>
  223. <td><?php echo $task->estStarted;?></td>
  224. </tr>
  225. <tr>
  226. <th><?php echo $lang->task->realStarted;?></th>
  227. <td><?php echo $task->realStarted; ?> </td>
  228. </tr>
  229. <tr>
  230. <th><?php echo $lang->task->deadline;?></th>
  231. <td>
  232. <?php
  233. echo $task->deadline;
  234. if(isset($task->delay)) printf($lang->task->delayWarning, $task->delay);
  235. ?>
  236. </td>
  237. </tr>
  238. <tr>
  239. <th><?php echo $lang->task->estimate;?></th>
  240. <td><?php echo $task->estimate . $lang->workingHour;?></td>
  241. </tr>
  242. <tr>
  243. <th><?php echo $lang->task->consumed;?></th>
  244. <td><?php echo round($task->consumed, 2) . $lang->workingHour;?></td>
  245. </tr>
  246. <tr>
  247. <th><?php echo $lang->task->left;?></th>
  248. <td><?php echo $task->left . $lang->workingHour;?></td>
  249. </tr>
  250. </table>
  251. </div>
  252. <div class="display hidden" id="legendLife">
  253. <table class='table bordered table-detail'>
  254. <tr>
  255. <td class='w-80px'><?php echo $lang->task->openedBy;?></td>
  256. <td><?php echo zget($users, $task->openedBy, $task->openedBy) . $lang->at . $task->openedDate;?></td>
  257. </tr>
  258. <?php if($task->finishedBy):?>
  259. <tr>
  260. <td><?php echo $lang->task->finishedBy;?></td>
  261. <td><?php echo zget($users, $task->finishedBy, $task->finishedBy) . $lang->at . $task->finishedDate;?></td>
  262. </tr>
  263. <?php endif;?>
  264. <?php if($task->canceledBy):?>
  265. <tr>
  266. <td><?php echo $lang->task->canceledBy;?></td>
  267. <td><?php echo zget($users, $task->canceledBy, $task->canceledBy) . $lang->at . $task->canceledDate;?></td>
  268. </tr>
  269. <?php endif;?>
  270. <?php if($task->closedBy):?>
  271. <tr>
  272. <td><?php echo $lang->task->closedBy;?></td>
  273. <td><?php echo zget($users, $task->closedBy, $task->closedBy) . $lang->at . $task->closedDate;?></td>
  274. </tr>
  275. <tr>
  276. <td><?php echo $lang->task->closedReason;?></td>
  277. <td><?php echo $lang->task->reasonList[$task->closedReason];?></td>
  278. </tr>
  279. <?php endif;?>
  280. <?php if($task->lastEditedBy):?>
  281. <tr>
  282. <td><?php echo $lang->task->lastEditedBy;?></td>
  283. <td><?php echo zget($users, $task->lastEditedBy, $task->lastEditedBy) . $lang->at . $task->lastEditedDate;?></td>
  284. </tr>
  285. <?php endif;?>
  286. </table>
  287. </div>
  288. </div>
  289. </div>
  290. </div>
  291. <nav class='nav nav-auto affix dock-bottom footer-actions'>
  292. <?php
  293. common::printIcon('task', 'assignTo', "executionID={$task->execution}&taskID={$task->id}", $task, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->task->assignTo);
  294. common::printIcon('task', 'recordEstimate', "taskID=$task->id", $task, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->task->recordEstimate);
  295. common::printIcon('task', 'start', "taskID=$task->id", $task, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->task->start);
  296. common::printIcon('task', 'restart', "taskID=$task->id", $task, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->task->restart);
  297. common::printIcon('task', 'pause', "taskID=$task->id", $task, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->task->pause);
  298. common::printIcon('task', 'finish', "taskID=$task->id", $task, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->task->finish);
  299. common::printIcon('task', 'close', "taskID=$task->id", $task, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->task->close);
  300. common::printIcon('task', 'activate', "taskID=$task->id", $task, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->task->activate);
  301. common::printIcon('task', 'cancel', "taskID=$task->id", $task, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->task->cancel);
  302. common::printIcon('task', 'edit', "taskID=$task->id", $task, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->edit);
  303. if(empty($task->team) or empty($task->children)) common::printIcon('task', 'batchCreate', "execution=$task->execution&storyID=$task->story&moduleID=$task->module&taskID=$task->id", $task, 'button', '', '', '', false, "data-display='modal' data-placement='bottom'", $lang->task->children);
  304. if(common::hasPriv('task', 'delete')) echo html::a($this->createLink('task', 'delete', "executionID=$task->execution&taskID=$task->id"), $lang->delete, 'hiddenwin');
  305. if(common::hasPriv('action', 'comment', $task)) echo html::a('#commentBox', $lang->comment, '', "data-display data-backdrop='true'");
  306. ?>
  307. <a class='moreActionMenu hidden' data-display='dropdown' data-placement='beside-top'><?php echo $lang->more;?></a>
  308. <div id='moreActionMenu' class='list dropdown-menu'></div>
  309. </nav>
  310. </div>
  311. <div id='commentBox' class='enter-from-bottom hidden affix layer'>
  312. <div class='heading'>
  313. <div class='title'><?php echo $lang->comment;?></div>
  314. <nav class='nav'><a data-dismiss='display' class='muted'><i class='icon-remove'></i></a></nav>
  315. </div>
  316. <form id='commentForm' target='hiddenwin' class='has-padding' data-form-refresh='#history' method='post' action='<?php echo $this->createLink('action', 'comment', "objectType=task&objectID=$task->id")?>'>
  317. <div class='control'><?php echo html::textarea('comment', '',"rows='5' class='textarea' data-default-val");?></div>
  318. <div class='control'><button type='submit' class='btn primary'><?php echo $lang->save;?></button></div>
  319. </form>
  320. </div>
  321. <script>
  322. function fixActionMenu()
  323. {
  324. var winWidth = $(window).width();
  325. var width = 0;
  326. $('.footer-actions a').each(function()
  327. {
  328. width += $(this).width();
  329. });
  330. if(width > winWidth)
  331. {
  332. $('.footer-actions a.moreActionMenu').removeClass('hidden');
  333. var lastNav = $('.footer-actions > a').not('.moreActionMenu').last();
  334. lastNav.addClass('item').css('display', lastNav.css('display'));
  335. $('#moreActionMenu').prepend("<div class='divider no-margin'></div>");
  336. $('#moreActionMenu').prepend(lastNav);
  337. fixActionMenu();
  338. }
  339. }
  340. $(function(){fixActionMenu();});
  341. </script>
  342. <?php include '../../common/view/m.footer.html.php';?>