m.dynamic.html.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. /**
  3. * The dynamic browse mobile view file of my 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 my
  9. * @version $Id: index.html.php 3830 2016-05-18 09:34:17Z liugang $
  10. * @link http://www.zentao.net
  11. */
  12. ?>
  13. <?php
  14. $bodyClass = 'with-menu-top';
  15. include "../../common/view/m.header.html.php";
  16. ?>
  17. <nav id='menu' class='menu nav affix dock-top canvas'>
  18. <?php
  19. echo html::a(inlink('dynamic', "type=today"), $lang->action->dynamic->today);
  20. echo html::a(inlink('dynamic', "type=yesterday"), $lang->action->dynamic->yesterday);
  21. echo html::a(inlink('dynamic', "type=twodaysago"), $lang->action->dynamic->twoDaysAgo);
  22. echo html::a(inlink('dynamic', "type=thisweek"), $lang->action->dynamic->thisWeek);
  23. echo html::a(inlink('dynamic', "type=lastweek"), $lang->action->dynamic->lastWeek);
  24. echo html::a(inlink('dynamic', "type=thismonth"), $lang->action->dynamic->thisMonth);
  25. echo html::a(inlink('dynamic', "type=lastmonth"), $lang->action->dynamic->lastMonth);
  26. echo html::a(inlink('dynamic', "type=all"), $lang->action->dynamic->all);
  27. ?>
  28. <a class='moreMenu hidden' data-display='dropdown' data-placement='beside-bottom'><?php echo $lang->more;?></a>
  29. <div id='moreMenu' class='list dropdown-menu'></div>
  30. </nav>
  31. <div class='heading'>
  32. <nav class='nav fluid'>
  33. <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>
  34. </nav>
  35. </div>
  36. <section id='page' class='section list-with-actions list-with-pager'>
  37. <?php $refreshUrl = $this->createLink('my', 'dynamic', "type=$type&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}");?>
  38. <div class='box' data-page='<?php echo $pager->pageID ?>' data-refresh-url='<?php echo $refreshUrl ?>'>
  39. <table class='table bordered'>
  40. <?php $firstAction = '';?>
  41. <?php foreach($dateGroups as $date => $actions): ?>
  42. <?php if($direction == 'next') $actions = array_reverse($actions);?>
  43. <?php foreach($actions as $action): ?>
  44. <?php if(empty($firstAction)) $firstAction = $action;?>
  45. <tr data-id='<?php echo $action->id;?>'>
  46. <td class='w-70px'><?php echo isset($users[$action->actor]) ? $users[$action->actor] : $action->actor; ?></td>
  47. <td>
  48. <?php echo $action->actionLabel;?>
  49. <?php if(strpos(',login,logout,', ",$action->action,") === false):?>
  50. <?php echo ' ' . $action->objectLabel;?>
  51. <a class='text-link' href='<?php echo $action->objectLink ?>'><?php echo $action->objectName ?></a>
  52. <?php endif;?>
  53. </td>
  54. <td class='w-120px'><?php echo $action->date ?></td>
  55. </tr>
  56. <?php endforeach;?>
  57. <?php endforeach;?>
  58. </table>
  59. </div>
  60. <nav class='nav justify pager'>
  61. <?php if(!empty($firstAction)):?>
  62. <?php
  63. $firstDate = date('Y-m-d', strtotime($firstAction->originalDate) + 24 * 3600);
  64. $lastDate = substr($action->originalDate, 0, 10);
  65. $hasPre = $this->action->hasPreOrNext($firstDate, 'pre');
  66. $hasNext = $this->action->hasPreOrNext($lastDate, 'next');
  67. $preLink = $hasPre ? inlink('dynamic', "type=$type&recTotal={$pager->recTotal}&date=" . strtotime($firstDate) . '&direction=pre') : 'javascript:;';
  68. $nextLink = $hasNext ? inlink('dynamic', "type=$type&recTotal={$pager->recTotal}&date=" . strtotime($lastDate) . '&direction=next') : 'javascript:;';
  69. ?>
  70. <?php if($hasPre or $hasNext):?>
  71. <ul class="pager pager-justify">
  72. <li class="previous <?php if($hasPre == false):?> disabled <?php endif;?>"><a href="<?php echo $preLink?>">« 上一页</a></li>
  73. <li class="caption"><strong></strong> <strong></strong> </li>
  74. <li class="next <?php if($hasNext == false):?> disabled <?php endif;?>"><a href="<?php echo $nextLink;?>">下一页 »</a></li>
  75. </ul>
  76. <?php endif;?>
  77. <?php endif;?>
  78. </nav>
  79. </section>
  80. <div class='list sort-panel hidden affix enter-from-bottom layer' id='sortPanel'>
  81. <?php
  82. $vars = "type=$type&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";
  83. $sortOrders = array('id', 'date', 'actor', 'action', 'objectType');
  84. foreach ($sortOrders as $sortOrder)
  85. {
  86. commonModel::printOrderLink($sortOrder, $orderBy, $vars, '<i class="icon icon-sort-indicator"></i>' . ($sortOrder == 'id' ? $lang->action->actionID : $lang->action->{$sortOrder}));
  87. }
  88. ?>
  89. </div>
  90. <script>
  91. $('#menu > a').removeClass('active').filter('[href*="<?php echo $type ?>"]').addClass('active');
  92. </script>
  93. <?php include "../../common/view/m.footer.html.php"; ?>