m.dynamic.html.php 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /**
  3. * The dynamic mobile view file of user 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 user
  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. include "./m.featurebar.html.php";
  17. ?>
  18. <nav id='subMenu' class='menu nav gray'>
  19. <?php
  20. echo html::a(inLink('dynamic', "userID={$user->id}&period=today"), $lang->action->dynamic->today);
  21. echo html::a(inLink('dynamic', "userID={$user->id}&period=yesterday"), $lang->action->dynamic->yesterday);
  22. echo html::a(inLink('dynamic', "userID={$user->id}&period=twodaysago"), $lang->action->dynamic->twoDaysAgo);
  23. echo html::a(inLink('dynamic', "userID={$user->id}&period=thisweek"), $lang->action->dynamic->thisWeek);
  24. echo html::a(inLink('dynamic', "userID={$user->id}&period=lastweek"), $lang->action->dynamic->lastWeek);
  25. echo html::a(inLink('dynamic', "userID={$user->id}&period=thismonth"), $lang->action->dynamic->thisMonth);
  26. echo html::a(inLink('dynamic', "userID={$user->id}&period=lastmonth"), $lang->action->dynamic->lastMonth);
  27. echo html::a(inLink('dynamic', "userID={$user->id}&period=all"), $lang->action->dynamic->all);
  28. ?>
  29. <a class='moreSubMenu hidden' data-display='dropdown' data-placement='beside-bottom'><?php echo $lang->more;?></a>
  30. <div id='moreSubMenu' class='list dropdown-menu'></div>
  31. </nav>
  32. <section id='page' class='section list-with-pager'>
  33. <div class='box' data-page='<?php echo $pager->pageID ?>' data-refresh-url='<?php echo $this->createLink('user', 'dynamic', "period=$period&userID={$user->id}&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"); ?>'>
  34. <table class='table bordered'>
  35. <?php $firstAction = '';?>
  36. <?php foreach($dateGroups as $actions): ?>
  37. <?php foreach($actions as $action): ?>
  38. <?php if(empty($firstAction)) $firstAction = $action;?>
  39. <tr data-id='<?php echo $action->id;?>'>
  40. <td class='w-80px'><?php echo zget($users, $action->actor);?></td>
  41. <td>
  42. <?php echo $action->actionLabel;?>
  43. <?php if(strpos(',login,logout,', ",$action->action,") === false):?>
  44. <?php echo ' ' . $action->objectLabel;?>
  45. <a class='text-link' href='<?php echo $action->objectLink ?>'><?php echo $action->objectName ?></a>
  46. <?php endif;?>
  47. </td>
  48. <td class='w-120px'><?php echo $action->date ?></td>
  49. </tr>
  50. <?php endforeach;?>
  51. <?php endforeach;?>
  52. </table>
  53. </div>
  54. <nav class='nav justify pager'>
  55. <?php if(!empty($firstAction)):?>
  56. <?php
  57. $firstDate = date('Y-m-d', strtotime($firstAction->originalDate) + 24 * 3600);
  58. $lastDate = substr($action->originalDate, 0, 10);
  59. $hasPre = $this->action->hasPreOrNext($firstDate, 'pre');
  60. $hasNext = $this->action->hasPreOrNext($lastDate, 'next');
  61. $preLink = $hasPre ? inlink('dynamic', "userID={$user->id}&type=$type&recTotal={$pager->recTotal}&date=" . strtotime($firstDate) . '&direction=pre') : 'javascript:;';
  62. $nextLink = $hasNext ? inlink('dynamic', "userID={$user->id}&type=$type&recTotal={$pager->recTotal}&date=" . strtotime($lastDate) . '&direction=next') : 'javascript:;';
  63. ?>
  64. <?php if($hasPre or $hasNext):?>
  65. <ul class='pager pager-justify'>
  66. <li class='previous<?php if(!$hasPre) echo ' disabled';?>'>
  67. <a id="prevPage" href="<?php echo $preLink;?>"><i class="icon icon-chevron-left"></i></a>
  68. </li>
  69. <li class='next<?php if(!$hasNext) echo ' disabled';?>'>
  70. <a id="nextPage" href="<?php echo $nextLink;?>"><i class="icon icon-chevron-right"></i></a>
  71. </li>
  72. </ul>
  73. <?php endif;?>
  74. <?php endif;?>
  75. </nav>
  76. </section>
  77. <script>
  78. $('#<?php echo $methodName?>' + 'Tab').addClass('active');
  79. $('#subMenu > a').removeClass('active').filter('[href*="<?php echo $type?>"]').addClass('active');
  80. </script>
  81. <?php include "../../common/view/m.footer.html.php"; ?>