m.dynamic.html.php 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. /**
  3. * The dynamic mobile view file of product 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 product
  9. * @version $Id$
  10. * @link http://www.zentao.net
  11. */
  12. $bodyClass = 'with-menu-top';
  13. ?>
  14. <?php include "../../common/view/m.header.html.php";?>
  15. <nav id='menu' class='menu nav affix dock-top canvas'>
  16. <?php
  17. echo html::a(inlink('dynamic', "productID=$productID&type=today"), $lang->action->dynamic->today, '', "id='today'");
  18. echo html::a(inlink('dynamic', "productID=$productID&type=yesterday"), $lang->action->dynamic->yesterday, '', "id='yesterday'");
  19. echo html::a(inlink('dynamic', "productID=$productID&type=twodaysago"), $lang->action->dynamic->twoDaysAgo, '', "id='twodaysago'");
  20. echo html::a(inlink('dynamic', "productID=$productID&type=thisweek"), $lang->action->dynamic->thisWeek, '', "id='thisweek'");
  21. echo html::a(inlink('dynamic', "productID=$productID&type=lastweek"), $lang->action->dynamic->lastWeek, '', "id='lastweek'");
  22. echo html::a(inlink('dynamic', "productID=$productID&type=thismonth"), $lang->action->dynamic->thisMonth, '', "id='thismonth'");
  23. echo html::a(inlink('dynamic', "productID=$productID&type=lastmonth"), $lang->action->dynamic->lastMonth, '', "id='lastmonth'");
  24. echo html::a(inlink('dynamic', "productID=$productID&type=all"), $lang->action->dynamic->all, '', "id='all'");
  25. echo html::select('account', $userIdPairs, $user ? $user->id : '', "class='account-select'");
  26. ?>
  27. <a class='moreMenu hidden' data-display='dropdown' data-placement='beside-bottom'><?php echo $lang->more;?></a>
  28. <div id='moreMenu' class='list dropdown-menu'></div>
  29. </nav>
  30. <div class='heading'>
  31. <div class='title'>
  32. <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>
  33. </div>
  34. </div>
  35. <section id='page' class='section list-with-pager'>
  36. <?php $refreshUrl = $this->createLink('product', 'dynamic', "productID=$productID&type=$type&param=$param&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}");?>
  37. <div class='box' data-page='<?php echo $pager->pageID ?>' data-refresh-url='<?php echo $refreshUrl ?>'>
  38. <table class='table bordered no-margin'>
  39. <thead>
  40. <tr>
  41. <th class='w-150px'><?php echo $lang->action->date;?></th>
  42. <th class='w-80px'> <?php echo $lang->action->actor;?></th>
  43. <th class='w-80px'><?php echo $lang->action->action;?></th>
  44. <th><?php echo $lang->action->objectName;?></th>
  45. </tr>
  46. </thead>
  47. <?php foreach($dateGroups as $actions):?>
  48. <?php foreach($actions as $action):?>
  49. <tr class='text-center' data-url='<?php echo $action->objectLink?>'>
  50. <td class='text-left'><?php echo $action->date;?></td>
  51. <td><?php isset($accountPairs[$action->actor]) ? print($accountPairs[$action->actor]) : print($action->actor);?></td>
  52. <td><?php echo $action->actionLabel;?></td>
  53. <td class='text-left'><?php echo '[' . $lang->action->objectTypes[$action->objectType] . ' #' . $action->objectID . '] ' . $action->objectName;?></td>
  54. </tr>
  55. <?php endforeach;?>
  56. <?php endforeach;?>
  57. </table>
  58. </div>
  59. <nav class='nav justified pager'>
  60. <?php $pager->show($align = 'justify');?>
  61. </nav>
  62. </section>
  63. <div class='list sort-panel hidden affix enter-from-bottom layer' id='sortPanel'>
  64. <?php
  65. $vars = "productID=$productID&type=$type&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
  66. $sortOrders = array('date', 'actor', 'action', 'objectType', 'objectID');
  67. foreach ($sortOrders as $order)
  68. {
  69. commonModel::printOrderLink($order, $orderBy, $vars, '<i class="icon icon-sort-indicator"></i>' . ($lang->action->{$order}));
  70. }
  71. ?>
  72. </div>
  73. <script>
  74. $(function()
  75. {
  76. $('#<?php echo $type;?>').addClass('active');
  77. $('#account').change(function()
  78. {
  79. if(account == '')
  80. {
  81. link = createLink('product', 'dynamic', 'productID=<?php echo $productID?>&type=all');
  82. }
  83. else
  84. {
  85. link = createLink('product', 'dynamic', 'productID=<?php echo $productID?>&type=account&param=' + $(this).val());
  86. }
  87. location.href = link;
  88. });
  89. });
  90. </script>
  91. <?php include "../../common/view/m.footer.html.php"; ?>