m.task.html.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <?php
  2. /**
  3. * The task browse mobile view file of execution module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2016 禅道软件(青岛)有限公司(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 execution
  9. * @version $Id
  10. * @link http://www.zentao.net
  11. */
  12. $featureMenu = customModel::getFeatureMenu($this->moduleName, $this->methodName);
  13. if($featureMenu) $bodyClass = 'with-menu-top';
  14. include "../../common/view/m.header.html.php";
  15. ?>
  16. <nav id='menu' class='menu nav affix dock-top canvas'>
  17. <?php
  18. foreach($featureMenu as $menuItem)
  19. {
  20. if(isset($menuItem->hidden)) continue;
  21. $menuType = $menuItem->name;
  22. if($menuType != 'status')
  23. {
  24. echo html::a(inlink('task', "executionID=$executionID&type=$menuType"), $menuItem->text);
  25. }
  26. if($menuType == 'status')
  27. {
  28. foreach($lang->execution->moreSelects['task']['status'] as $key => $value)
  29. {
  30. if($key == '') continue;
  31. echo html::a($this->createLink('execution', 'task', "execution=$executionID&type=$key"), $value);
  32. }
  33. }
  34. }
  35. ?>
  36. <a class='moreMenu hidden' data-display='dropdown' data-placement='beside-bottom'><?php echo $lang->more;?></a>
  37. <div id='moreMenu' class='list dropdown-menu'></div>
  38. </nav>
  39. <div class='heading'>
  40. <div class='title'>
  41. <a id='sortTrigger' class='text-right sort-trigger' data-display data-target='#sortPanel' data-backdrop='true'><i class='icon icon-sort'></i>&nbsp;<span class='sort-name'><?php echo $lang->sort ?></span></a>
  42. </div>
  43. <?php if($executionID):?>
  44. <nav class='nav'>
  45. <a data-display='modal' data-placement='bottom' data-remote='<?php echo $this->createLink('task', 'create', "executionID=$executionID");?>' class='btn primary'><i class='icon icon-plus'> </i> &nbsp;&nbsp;<?php echo $lang->task->create;?></a>
  46. </nav>
  47. <?php endif;?>
  48. </div>
  49. <section id='page' class='section list-with-pager'>
  50. <?php $refreshUrl = $this->createLink('execution', 'task', "executionID=$executionID&status=$status&param=0&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}");?>
  51. <div class='box' data-page='<?php echo $pager->pageID;?>' data-refresh-url='<?php echo $refreshUrl;?>'>
  52. <table class='table bordered no-margin'>
  53. <thead>
  54. <tr>
  55. <th><?php echo $lang->task->name;?> </th>
  56. <th class='text-center w-80px'><?php echo $lang->task->assignedTo;?> </th>
  57. <th class='text-center w-70px'><?php echo $lang->statusAB;?> </th>
  58. </tr>
  59. </thead>
  60. <?php foreach($tasks as $task):?>
  61. <tr class='text-center' data-url='<?php echo $this->createLink('task', 'view', "taskID={$task->id}")?>' data-id='<?php echo $task->id;?>'>
  62. <td class='text-left<?php if(!empty($task->children)) echo " has-child";?>'>
  63. <?php if(!empty($task->team)) echo '<span class="label label-badge label-light">' . $this->lang->task->multipleAB . '</span> ';?>
  64. <?php if(!empty($task->children)) echo '<a class="task-toggle" data-id="' . $task->id . '"><i class="icon icon-caret-down"></i></a>';?>
  65. <?php echo $task->name;?>
  66. </td>
  67. <td><?php echo zget($users, $task->assignedTo);?></td>
  68. <td class='task-<?php echo $task->status;?>'><?php echo zget($lang->task->statusList, $task->status);?></td>
  69. </tr>
  70. <?php if(!empty($task->children)):?>
  71. <?php foreach($task->children as $key => $child):?>
  72. <?php $class = $key == 0 ? ' table-child-top' : '';?>
  73. <?php $class .= ($key + 1 == count($task->children)) ? ' table-child-bottom' : '';?>
  74. <tr class='table-children<?php echo $class;?> parent-<?php echo $task->id;?>' data-id='<?php echo $child->id;?>' data-url='<?php echo $this->createLink('task', 'view', "taskID={$child->id}")?>' data-left='<?php echo $child->left;?>'>
  75. <td class='text-left'>
  76. <?php echo '<span class="label label-badge label-light">' . $this->lang->task->childrenAB . '</span> ';?>
  77. <?php echo $child->name;?>
  78. </td>
  79. <td><?php echo zget($users, $child->assignedTo);?></td>
  80. <td class='task-<?php echo $child->status;?>'><?php echo zget($lang->task->statusList, $child->status);?></td>
  81. </tr>
  82. <?php endforeach;?>
  83. <?php endif;?>
  84. <?php endforeach;?>
  85. <?php if($tasks):?>
  86. <tfoot>
  87. <tr><td colspan='3'><small><?php echo $summary?></small</td></tr>
  88. </tfoot>
  89. <?php endif?>
  90. </table>
  91. </div>
  92. <nav class='nav justify pager'>
  93. <?php $pager->show($align = 'justify');?>
  94. </nav>
  95. </section>
  96. <div class='list sort-panel hidden affix enter-from-bottom layer' id='sortPanel'>
  97. <?php
  98. $vars = "executionID={$executionID}&status={$status}&param=0&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";
  99. $sortOrders = array('id', 'pri', 'name', 'deadline', 'assignedTo', 'status', 'openedDate', 'consumed', 'left');
  100. foreach($sortOrders as $sortOrder)
  101. {
  102. commonModel::printOrderLink($sortOrder, $orderBy, $vars, '<i class="icon icon-sort-indicator"></i>' . $lang->task->{$sortOrder});
  103. }
  104. ?>
  105. </div>
  106. <script>
  107. $('#menu > a').removeClass('active').filter('[href*="<?php echo $status;?>"]').addClass('active');
  108. </script>
  109. <?php include "../../common/view/m.footer.html.php"; ?>