m.effort.html.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. /**
  3. * The effort mobile view file of my 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 my
  9. * @version $Id$
  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. <style>
  18. #dateBox{padding-top:8px;}
  19. </style>
  20. <nav id='menu' class='menu nav affix dock-top canvas'>
  21. <div id='dateBox'>
  22. <input type='date' class='input' id='date' name='date' value='<?php echo $date?>' onchange='changeDate(this.value)'>
  23. </div>
  24. <?php
  25. echo html::a(inlink('effort', "date=today"), $lang->effort->todayEfforts, '', "id='today'");
  26. echo html::a(inlink('effort', "date=yesterday"), $lang->effort->yesterdayEfforts, '', "id='yesterday'");
  27. echo html::a(inlink('effort', "date=thisweek"), $lang->effort->thisWeekEfforts, '', "id='thisweek'");
  28. echo html::a(inlink('effort', "date=lastweek"), $lang->effort->lastWeekEfforts, '', "id='lastweek'");
  29. echo html::a(inlink('effort', "date=thismonth"), $lang->effort->thisMonthEfforts, '', "id='thismonth'");
  30. echo html::a(inlink('effort', "date=lastmonth"), $lang->effort->lastMonthEfforts, '', "id='lastmonth'");
  31. echo html::a(inlink('effort', "date=all"), $lang->effort->allDaysEfforts, '', "id='all'");
  32. ?>
  33. <a class='moreMenu hidden' data-display='dropdown' data-placement='beside-bottom'><?php echo $lang->more;?></a>
  34. <div id='moreMenu' class='list dropdown-menu'></div>
  35. </nav>
  36. <div class='heading'>
  37. <div class='title'>
  38. <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>
  39. </div>
  40. <nav class='nav'>
  41. <a data-display='modal' data-placement='bottom' data-remote='<?php echo $this->createLink('effort', 'batchCreate') ?>' class='btn primary'><i class='icon icon-plus'></i>&nbsp;&nbsp; <?php echo $lang->effort->create;?></a>
  42. </nav>
  43. </div>
  44. <section id='page' class='section list-with-pager'>
  45. <div class='box' data-page='<?php echo $pager->pageID ?>' data-refresh-url='<?php echo $this->createLink('my', 'effort', http_build_query($this->app->getParams())); ?>'>
  46. <table class='table bordered'>
  47. <thead>
  48. <tr>
  49. <th class='w-100px'><?php echo $lang->effort->date;?></th>
  50. <th><?php echo $lang->effort->work;?></th>
  51. </tr>
  52. </thead>
  53. <?php $times = 0?>
  54. <?php foreach($efforts as $effort):?>
  55. <tr class='text-center' data-url='<?php echo $this->createLink('effort', 'view', "id=$effort->id");?>' data-id='<?php echo $effort->id;?>'>
  56. <td><?php echo $effort->date;?></td>
  57. <td class='text-left'><?php echo $effort->work . "({$effort->consumed}h)";?></td>
  58. </tr>
  59. <?php $times += $effort->consumed;?>
  60. <?php endforeach;?>
  61. <?php if($times):?>
  62. <tfoot><tr><td colspan='4' class='small'><?php printf($lang->company->effort->timeStat, $times);?></td></tr></tfoot>
  63. <?php endif;?>
  64. </table>
  65. </div>
  66. <nav class='nav justify pager'>
  67. <?php $pager->show($align = 'justify');?>
  68. </nav>
  69. </section>
  70. <div class='list sort-panel enter-from-bottom hidden affix layer' id='sortPanel'>
  71. <?php
  72. $vars = "type=$type&orderBy=%s&recTotal=$pager->recTotal&recPerPage=$pager->recPerPage";
  73. $orders = array('id', 'date', 'consumed', 'left', 'work', 'objectType');
  74. foreach ($orders as $order)
  75. {
  76. commonModel::printOrderLink($order, $orderBy, $vars, '<i class="icon icon-sort-indicator"></i>' . $lang->effort->{$order});
  77. }
  78. ?>
  79. </div>
  80. <script>
  81. function changeDate(date)
  82. {
  83. if(date.indexOf('-') != -1)
  84. {
  85. var datearray = date.split("-");
  86. var date = '';
  87. for(i = 0 ; i < datearray.length; i++) date = date + datearray[i];
  88. }
  89. link = createLink('my', 'effort', 'date=' + date);
  90. location.href=link;
  91. }
  92. $('#menu > a').removeClass('active').filter('[href*="<?php echo $type?>"]').addClass('active');
  93. </script>
  94. <?php include "../../common/view/m.footer.html.php"; ?>