m.view.html.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. /**
  3. * The view mobile view file of leave module of ZDOO.
  4. *
  5. * @copyright Copyright 2009-2016 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
  6. * @license ZPL (http://zpl.pub/page/zplv12.html)
  7. * @author Tingting Dai <daitingting@xirangit.com>
  8. * @package leave
  9. * @version $Id
  10. * @link http://www.zdoo.com
  11. */
  12. if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}
  13. $moduleMenu = false;
  14. $bodyClass = 'with-nav-bottom';
  15. $browseLink = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : inlink('personal');
  16. include "../../common/view/m.header.html.php";
  17. ?>
  18. <div id='page' class='list-with-actions'>
  19. <div class='section'>
  20. <div class='heading gray'>
  21. <div class='title'><i class='icon-calendar'> </i><?php echo $lang->leave->view;?></div>
  22. <nav class='nav'><a class='btn primary' href='<?php echo $browseLink;?>'><?php echo $lang->goback;?></a></nav>
  23. </div>
  24. <div class='box'>
  25. <table class='table bordered table-detail'>
  26. <tr>
  27. <td class='w-80px'><?php echo $lang->leave->createdBy;?></td>
  28. <td><?php echo zget($users, $leave->createdBy);?></td>
  29. </tr>
  30. <tr>
  31. <td><?php echo $lang->leave->type;?></td>
  32. <td><?php echo zget($lang->leave->typeList, $leave->type);?></td>
  33. </tr>
  34. <tr>
  35. <td><?php echo $lang->leave->status;?></td>
  36. <td><span class='label status-<?php echo $leave->status;?>-pale'><?php echo zget($lang->leave->statusList, $leave->status);?></span></td>
  37. </tr>
  38. <tr>
  39. <td><?php echo $lang->leave->begin;?></td>
  40. <td><?php echo $leave->begin . ' ' . $leave->start;?></td>
  41. </tr>
  42. <tr>
  43. <td><?php echo $lang->leave->end;?></td>
  44. <td><?php echo $leave->end . ' ' . $leave->finish;?></td>
  45. </tr>
  46. <?php if(!empty($leave->backDate)):?>
  47. <tr>
  48. <td><?php echo $lang->leave->backDate;?></td>
  49. <td><?php echo formatTime($leave->backDate);?></td>
  50. </tr>
  51. <?php endif;?>
  52. <?php if(!empty($leave->hours)):?>
  53. <tr>
  54. <td><?php echo $lang->leave->hours;?></td>
  55. <td><?php echo $leave->hours;?></td>
  56. </tr>
  57. <?php endif;?>
  58. <?php if(!empty($leave->desc)):?>
  59. <tr>
  60. <td><?php echo $lang->leave->desc;?></td>
  61. <td><?php echo $leave->desc;?></td>
  62. </tr>
  63. <?php endif;?>
  64. <?php if(!empty($leave->reviewedBy)):?>
  65. <tr>
  66. <td><?php echo $lang->leave->reviewedBy;?></td>
  67. <td><?php echo zget($users, $leave->reviewedBy);?></td>
  68. </tr>
  69. <?php endif;?>
  70. </table>
  71. </div>
  72. </div>
  73. <div class='section' id='history'>
  74. </div>
  75. <nav class='nav affix dock-bottom nav-auto footer-actions'>
  76. <?php
  77. if($type == 'personal')
  78. {
  79. $canBack = $this->leave->isClickable($leave, 'back');
  80. $canEdit = $this->leave->isClickable($leave, 'edit');
  81. $canDelete = $this->leave->isClickable($leave, 'delete');
  82. $canSwitch = $this->leave->isClickable($leave, 'switchStatus');
  83. if($canBack) echo "<a data-remote='" . $this->createLink('leave', 'back', "id={$leave->id}") . "' data-display='modal' data-placement='bottom'>{$lang->leave->back}</a>";
  84. if($canSwitch)
  85. {
  86. $switchLabel = $leave->status == 'wait' ? $lang->leave->cancel : $lang->leave->submit;
  87. echo "<a data-remote='" . $this->createLink('leave', 'switchstatus', "id={$leave->id}") . "' data-display='ajaxAction' data-locate='self'>{$switchLabel}</a>";
  88. }
  89. if($canEdit) echo "<a data-remote='" . $this->createLink('leave', 'edit', "id={$leave->id}") . "' data-display='modal' data-placement='bottom'>{$lang->edit}</a>";
  90. if($canDelete) echo "<a data-remote='" . $this->createLink('leave', 'delete', "id={$leave->id}") . "' data-display='ajaxAction' data-ajax-delete='true' data-locate='{$this->createLink("leave", "personal")}'>{$lang->delete}</a>";
  91. }
  92. else
  93. {
  94. $canReview = $this->leave->isClickable($leave, 'review');
  95. if($canReview)
  96. {
  97. $params = $leave->status == 'back' ? '&mode=back' : '';
  98. echo "<a data-remote='" . $this->createLink('leave', 'review', "id={$leave->id}&status=pass$params") . "' data-display='ajaxAction' data-confirm='{$lang->leave->confirmReview['pass']}' data-locate='self'>{$lang->leave->statusList['pass']}</a>";
  99. echo "<a data-remote='" . $this->createLink('leave', 'review', "id={$leave->id}&status=reject$params") . "' data-display='modal' data-placement='bottom'>{$lang->leave->statusList['reject']}</a>";
  100. }
  101. }
  102. ?>
  103. </nav>
  104. </div>
  105. <?php include "../../common/view/m.footer.html.php"; ?>