review.html.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php
  2. /**
  3. * The detail view file of attend module of RanZhi.
  4. *
  5. * @copyright Copyright 2009-2018 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.cnezsoft.com)
  6. * @license ZPL (http://zpl.pub/page/zplv12.html)
  7. * @author Gang Liu <liugang@cnezsoft.com>
  8. * @package attend
  9. * @version $Id$
  10. * @link http://www.ranzhi.org
  11. */
  12. ?>
  13. <?php
  14. if(!empty($reviewStatus))
  15. {
  16. $oldDir = getcwd();
  17. chdir('../../view/');
  18. include('./review.html.php');
  19. chdir($oldDir);
  20. return;
  21. }
  22. ?>
  23. <?php include '../../../common/view/header.modal.html.php';?>
  24. <table class='table table-bordered attendTable'>
  25. <tr>
  26. <th><?php echo $lang->attend->account;?></th>
  27. <td><?php echo zget($users, $attend->account);?></td>
  28. <th><?php echo $lang->user->dept;?></th>
  29. <td><?php echo zget($deptList, $user->dept, '');?></td>
  30. </tr>
  31. <tr>
  32. <th><?php echo $lang->attend->date;?></th>
  33. <td><?php echo formatTime($attend->date, DT_DATE1);?></td>
  34. <th><?php echo $lang->attend->status;?></th>
  35. <td><?php echo zget($lang->attend->statusList, $attend->status);?></td>
  36. </tr>
  37. <tr>
  38. <th><?php echo $lang->attend->manualIn;?></th>
  39. <td><?php echo substr($attend->manualIn, 0, 5);?></td>
  40. <th><?php echo $lang->attend->manualOut;?></th>
  41. <td><?php echo substr($attend->manualOut, 0, 5);?></td>
  42. </tr>
  43. <tr>
  44. <th><?php echo $lang->attend->desc;?></th>
  45. <td colspan='3'><?php echo $attend->desc;?></td>
  46. </tr>
  47. <tr>
  48. <th><?php echo $lang->attend->reason;?></th>
  49. <td><?php echo zget($lang->attend->reasonList, $attend->reason);?></th>
  50. <th><?php echo $lang->attend->reviewStatus;?></th>
  51. <td><?php echo zget($lang->attend->reviewStatusList, $attend->reviewStatus);?></th>
  52. </tr>
  53. </table>
  54. <?php if($attend->reviewStatus == 'wait'):?>
  55. <div class='page-actions'>
  56. <?php
  57. extCommonModel::printLink('attend', 'review', "id={$attend->id}&status=pass", $lang->attend->reviewStatusList['pass'], "class='btn reviewPass'");
  58. extCommonModel::printLink('attend', 'review', "id={$attend->id}&status=reject", $lang->attend->reviewStatusList['reject'], "class='btn loadInModal'");
  59. ?>
  60. </div>
  61. <?php endif;?>
  62. <script>
  63. $(function()
  64. {
  65. $('.page-actions a.loadInModal').each(function()
  66. {
  67. var href = $(this).attr('href');
  68. if(href.indexOf('onlybody=yes') < 0) href = href + (href.indexOf('?') > 0 ? '&' : '?') + 'onlybody=yes';
  69. $(this).removeAttr('href').attr('data-rel', href);
  70. });
  71. $(document).off('click', '.reviewPass');
  72. href = $('a.reviewPass').attr('href');
  73. $('a.reviewPass').attr('href', '###').attr('data-href', href);
  74. $(document).on('click', '.reviewPass', function()
  75. {
  76. if(confirm(confirmReview.pass))
  77. {
  78. var selecter = $(this);
  79. $.getJSON(selecter.attr('data-href'), function(data)
  80. {
  81. if(data.result == 'success')
  82. {
  83. if(data.locate) return location.href = data.locate;
  84. return location.reload();
  85. }
  86. else
  87. {
  88. alert(data.message);
  89. return location.reload();
  90. }
  91. });
  92. }
  93. return false;
  94. });
  95. });
  96. </script>
  97. <?php include '../../../common/view/footer.modal.html.php';?>