view.html.php 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /**
  3. * The detail view file of leave 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) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
  7. * @author Gang Liu <liugang@cnezsoft.com>
  8. * @package leave
  9. * @version $Id$
  10. * @link http://www.ranzhi.org
  11. */
  12. ?>
  13. <?php include '../../../common/view/header.modal.html.php';?>
  14. <table class='table table-bordered leaveTable'>
  15. <tr>
  16. <th><?php echo $lang->leave->status;?></th>
  17. <td class='leave-<?php echo $leave->status;?>'><?php echo $lang->leave->statusList[$leave->status];?></td>
  18. <th><?php echo $lang->leave->type;?></th>
  19. <td><?php echo zget($lang->leave->typeList, $leave->type);?></td>
  20. </tr>
  21. <tr>
  22. <th><?php echo $lang->leave->start;?></th>
  23. <td><?php echo formatTime($leave->begin . ' ' . $leave->start, DT_DATETIME2);?></td>
  24. <th><?php echo $lang->leave->finish;?></th>
  25. <td><?php echo formatTime($leave->end . ' ' . $leave->finish, DT_DATETIME2);?></td>
  26. </tr>
  27. <tr>
  28. <th><?php echo $lang->leave->hours;?></th>
  29. <td><?php echo $leave->hours . $lang->leave->hoursTip;?></td>
  30. <th><?php echo $lang->leave->backDate;?></th>
  31. <td><?php echo formatTime($leave->backDate, DT_DATETIME2);?></td>
  32. </tr>
  33. <tr>
  34. <th><?php echo $lang->leave->desc;?></th>
  35. <td colspan='3'><?php echo $leave->desc;?></td>
  36. </tr>
  37. <tr>
  38. <th><?php echo $lang->leave->createdBy;?></th>
  39. <td><?php echo zget($users, $leave->createdBy);?></th>
  40. <th><?php echo $lang->leave->reviewedBy;?></th>
  41. <td id='reviewedBy'><?php echo zget($users, $leave->reviewedBy);?></th>
  42. </tr>
  43. <tr>
  44. <th><?php echo $lang->leave->createdDate;?></th>
  45. <td><?php echo formatTime($leave->createdDate, DT_DATETIME1);?></td>
  46. <th><?php echo $lang->leave->reviewedDate;?></th>
  47. <td><?php echo formatTime($leave->reviewedDate, DT_DATETIME1);?></td>
  48. </tr>
  49. </table>
  50. <?php echo $this->fetch('action', 'history', "objectType=leave&objectID=$leave->id");?>
  51. <div class='page-actions'>
  52. <?php
  53. if($type == 'personal')
  54. {
  55. $canBack = $this->leave->isClickable($leave, 'back');
  56. $canEdit = $this->leave->isClickable($leave, 'edit');
  57. $canDelete = $this->leave->isClickable($leave, 'delete');
  58. $canSwitch = $this->leave->isClickable($leave, 'switchStatus');
  59. if($canBack)
  60. {
  61. extCommonModel::printLink('oa.leave', 'back', "id={$leave->id}", $lang->leave->back, "class='btn loadInModal'");
  62. }
  63. if($canSwitch or $canEdit or $canDelete)
  64. {
  65. if($canSwitch)
  66. {
  67. $switchLabel = $leave->status == 'wait' ? $lang->leave->cancel : $lang->leave->submit;
  68. extCommonModel::printLink('oa.leave', 'switchstatus', "id={$leave->id}", $switchLabel, "class='btn'");
  69. }
  70. echo "<div class='btn-group'>";
  71. if($canEdit) extCommonModel::printLink('oa.leave', 'edit', "id={$leave->id}", $lang->edit, "class='btn loadInModal'");
  72. if($canDelete) extCommonModel::printLink('oa.leave', 'delete', "id={$leave->id}", $lang->delete, "class='btn deleteLeave'");
  73. echo '</div>';
  74. }
  75. }
  76. else
  77. {
  78. $canReview = $this->leave->isClickable($leave, 'review');
  79. if($canReview)
  80. {
  81. $params = $leave->status == 'back' ? '&mode=back' : '';
  82. echo "<div class='btn-group'>";
  83. extCommonModel::printLink('oa.leave', 'review', "id={$leave->id}&status=pass", $lang->leave->statusList['pass'], "class='btn reviewPass'");
  84. extCommonModel::printLink('oa.leave', 'review', "id={$leave->id}&status=reject", $lang->leave->statusList['reject'], "class='btn loadInModal'");
  85. echo '</div>';
  86. }
  87. }
  88. if(!isonlybody()) echo baseHTML::a('###', $lang->goback, "class='btn' data-dismiss='modal'");
  89. ?>
  90. </div>
  91. <?php include '../../../common/view/footer.modal.html.php';?>