browse.html.php 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <?php
  2. /**
  3. * The browse view file of overtime 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 Tingting Dai <daitingting@xirangit.com>
  8. * @package overtime
  9. * @version $Id$
  10. * @link http://www.ranzhi.org
  11. */
  12. ?>
  13. <?php include $app->getModuleRoot() . 'common/view/header.html.php';?>
  14. <style>
  15. #menuActions{float:right !important; margin-top: -60px !important;}
  16. .input-group-required > .required::after, .required-wrapper.required::after {top:12px !important;}
  17. .modal-body .table {margin-bottom:0px !important;}
  18. </style>
  19. <div id='featurebar'>
  20. <ul class='nav'>
  21. <?php
  22. $methodName = strtolower($this->app->rawMethod);
  23. foreach($lang->overtime->featureBar['personal'] as $method => $name)
  24. {
  25. $class = strtolower($method) == $methodName ? "class='active'" : '';
  26. if(common::hasPriv('overtime', $method)) echo "<li id='$method' $class>" . html::a($this->createLink('overtime', $method), $name) . '</li>';
  27. }
  28. ?>
  29. </ul>
  30. </div>
  31. <?php js::set('confirmReview', $lang->overtime->confirmReview)?>
  32. <div id='menuActions'>
  33. <?php extCommonModel::printLink('oa.overtime', 'export', "mode=all&orderBy={$orderBy}", $lang->exportIcon . $lang->export, "class='btn btn-primary iframe' data-width='700'");?>
  34. <?php extCommonModel::printLink('oa.overtime', 'create', "", "<i class='icon icon-plus'></i> {$lang->overtime->create}", "data-toggle='modal' class='btn btn-primary'")?>
  35. </div>
  36. <?php if($type != 'browseReview'):?>
  37. <div class='with-side'>
  38. <div class='side'>
  39. <div class='panel panel-sm'>
  40. <div class='panel-body'>
  41. <ul class='tree' data-ride='tree' data-collapsed='true'>
  42. <?php foreach($yearList as $year):?>
  43. <li class='<?php echo $year == $currentYear ? 'active' : ''?>'>
  44. <?php extCommonModel::printLink('oa.overtime', $type, "date=$year", $year);?>
  45. <ul>
  46. <?php foreach($monthList[$year] as $month):?>
  47. <li class='<?php echo ($year == $currentYear and $month == $currentMonth) ? 'active' : ''?>'>
  48. <?php extCommonModel::printLink('oa.overtime', $type, "date=$year$month", $year . $month);?>
  49. </li>
  50. <?php endforeach;?>
  51. </ul>
  52. </li>
  53. <?php endforeach;?>
  54. </ul>
  55. </div>
  56. </div>
  57. </div>
  58. <div class='main'>
  59. <?php endif;?>
  60. <?php $batchReview = $type == 'browseReview' && commonModel::hasPriv('overtime', 'batchReview');?>
  61. <div class='panel'>
  62. <?php if(empty($overtimeList)):?>
  63. <div class="table-empty-tip">
  64. <p>
  65. <span class="text-muted"><?php echo $lang->noData;?></span>
  66. <?php if(common::hasPriv('overtime', 'create')):?>
  67. <?php echo html::a($this->createLink('overtime', 'create'), "<i class='icon icon-plus'></i> " . $lang->overtime->create, '', "class='btn btn-info' data-toggle='modal'");?>
  68. <?php endif;?>
  69. </p>
  70. </div>
  71. <?php else:?>
  72. <?php if($batchReview):?>
  73. <form id='batchReviewForm' method='post' action='<?php echo inlink('batchReview', 'status=pass');?>'>
  74. <?php endif;?>
  75. <table class='table table-hover text-center table-fixed tablesorter' id='overtimeTable'>
  76. <thead>
  77. <tr class='text-center'>
  78. <?php $vars = "&date={$date}&orderBy=%s";?>
  79. <th class='w-80px'><?php commonModel::printOrderLink('id', $orderBy, $vars, $lang->overtime->id, 'overtime', $type);?></th>
  80. <th class='w-100px'><?php commonModel::printOrderLink('createdBy', $orderBy, $vars, $lang->overtime->createdBy, 'overtime', $type);?></th>
  81. <th class='w-100px visible-lg'><?php echo $lang->user->dept;?></th>
  82. <th class='w-80px'><?php commonModel::printOrderLink('type', $orderBy, $vars, $lang->overtime->type, 'overtime', $type);?></th>
  83. <th class='w-150px'><?php commonModel::printOrderLink('begin', $orderBy, $vars, $lang->overtime->begin, 'overtime', $type);?></th>
  84. <th class='w-150px'><?php commonModel::printOrderLink('end', $orderBy, $vars, $lang->overtime->end, 'overtime', $type);?></th>
  85. <th class='w-70px visible-lg'><?php commonModel::printOrderLink('hours', $orderBy, $vars, $lang->overtime->hours, 'overtime', $type);?></th>
  86. <th class='text-left'><?php echo $lang->overtime->desc;?></th>
  87. <th class='w-100px'><?php commonModel::printOrderLink('status', $orderBy, $vars, $lang->overtime->status, 'overtime', $type);?></th>
  88. <?php if($type == 'personal'):?>
  89. <?php $class = $this->app->clientLang == 'en' ? 'w-180px' : 'w-140px';?>
  90. <th class='<?php echo $class;?>'><?php echo $lang->actions;?></th>
  91. <?php else:?>
  92. <?php $class = $this->app->clientLang == 'en' ? 'w-130px' : 'w-110px';?>
  93. <th class='<?php echo $class;?>'><?php echo $lang->actions;?></th>
  94. <?php endif;?>
  95. </tr>
  96. </thead>
  97. <?php foreach($overtimeList as $overtime):?>
  98. <?php $viewUrl = commonModel::hasPriv('overtime', 'view') ? $this->createLink('overtime', 'view', "id=$overtime->id&type=$type", '', true) : '';?>
  99. <tr id='overtime<?php echo $overtime->id;?>' >
  100. <td class='idTD'>
  101. <?php if($batchReview):?>
  102. <label class='checkbox-inline'><input type='checkbox' name='overtimeIDList[]' value='<?php echo $overtime->id;?>'/> <?php echo $overtime->id;?></label>
  103. <?php else:?>
  104. <?php echo $overtime->id;?>
  105. <?php endif;?>
  106. </td>
  107. <td><?php echo zget($users, $overtime->createdBy);?></td>
  108. <td class='visible-lg'><?php echo zget($deptList, $overtime->dept);?></td>
  109. <td><?php echo zget($this->lang->overtime->typeList, $overtime->type);?></td>
  110. <td><?php echo formatTime($overtime->begin . ' ' . $overtime->start, DT_DATETIME2);?></td>
  111. <td><?php echo formatTime($overtime->end . ' ' . $overtime->finish, DT_DATETIME2);?></td>
  112. <td class='visible-lg'><?php echo $overtime->hours == 0 ? '' : $overtime->hours;?></td>
  113. <td class='text-left' title='<?php echo $overtime->desc?>'><?php echo $overtime->desc;?></td>
  114. <td class='overtime-<?php echo $overtime->status?>'><?php echo $overtime->statusLabel;?></td>
  115. <td class='actionTD text-left'>
  116. <?php
  117. if($viewUrl) echo baseHTML::a($viewUrl, $lang->detail, "data-toggle='modal'");
  118. if($type == 'personal')
  119. {
  120. $switchLabel = $overtime->status == 'wait' ? $lang->overtime->cancel : $lang->overtime->commit;
  121. if(strpos(',wait,draft,', ",$overtime->status,") !== false)
  122. {
  123. extCommonModel::printLink('oa.overtime', 'switchstatus', "id=$overtime->id", $switchLabel, "class='reload'");
  124. }
  125. else
  126. {
  127. echo baseHTML::a('###', $switchLabel, "disabled='disabled'");
  128. }
  129. if(strpos(',wait,draft,reject,', ",$overtime->status,") !== false)
  130. {
  131. extCommonModel::printLink('oa.overtime', 'edit', "id=$overtime->id", $lang->edit, "data-toggle='modal'");
  132. extCommonModel::printLink('oa.overtime', 'delete', "id=$overtime->id", $lang->delete, "class='deleter'");
  133. }
  134. else
  135. {
  136. echo baseHTML::a('###', $lang->edit, "disabled='disabled'");
  137. echo baseHTML::a('###', $lang->delete, "disabled='disabled'");
  138. }
  139. }
  140. else
  141. {
  142. $canReview = $this->overtime->isClickable($overtime, 'review');
  143. if($canReview)
  144. {
  145. echo baseHTML::a(inlink('review', "id=$overtime->id&status=pass"), $lang->overtime->reviewStatusList['pass'], "class='reviewPass'");
  146. echo baseHTML::a(inlink('review', "id=$overtime->id&status=reject"), $lang->overtime->reviewStatusList['reject'], "data-toggle='modal'");
  147. }
  148. else
  149. {
  150. echo baseHTML::a('javascript:;', $lang->overtime->reviewStatusList['pass'], "class='disabled'");
  151. echo baseHTML::a('javascript:;', $lang->overtime->reviewStatusList['reject'], "class='disabled'");
  152. }
  153. }
  154. ?>
  155. </td>
  156. </tr>
  157. <?php endforeach;?>
  158. </table>
  159. <?php endif;?>
  160. </div>
  161. <?php if($type != 'browseReview'):?>
  162. </div>
  163. </div>
  164. <?php endif;?>
  165. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>