browse.html.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <?php
  2. /**
  3. * The browse view file of overtime module of Ranzhi.
  4. *
  5. * @copyright Copyright 2009-2018 青岛易软天创网络科技有限公司(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 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->getMethodName());
  23. foreach($lang->overtime->featurebar as $key => $menu)
  24. {
  25. if(is_string($menu)) $link = $menu;
  26. if(is_array($menu)) $link = $menu['link'];
  27. list($name, $currentModule, $currentMethod, $params) = explode('|', $link);
  28. $class = strtolower($key) == $methodName ? "class='active'" : '';
  29. if(isset($menu['alias'])) $class = strpos(strtolower($menu['alias']), strtolower($key)) !== false ? "class='active'" : $class;
  30. if(common::hasPriv($currentModule, $currentMethod)) echo "<li id='$key' $class>" . html::a($this->createLink($currentModule, $currentMethod, $params), $name) . '</li>';
  31. }
  32. ?>
  33. </ul>
  34. </div>
  35. <?php js::set('confirmReview', $lang->overtime->confirmReview)?>
  36. <div id='menuActions'>
  37. <?php extCommonModel::printLink('oa.overtime', 'export', "mode=all&orderBy={$orderBy}", $lang->exportIcon . $lang->export, "class='btn btn-primary iframe' data-width='700'");?>
  38. <?php extCommonModel::printLink('oa.overtime', 'create', "", "<i class='icon icon-plus'></i> {$lang->overtime->create}", "data-toggle='modal' class='btn btn-primary'")?>
  39. </div>
  40. <?php if($type != 'browseReview'):?>
  41. <div class='with-side'>
  42. <div class='side'>
  43. <div class='panel panel-sm'>
  44. <div class='panel-body'>
  45. <ul class='tree' data-ride='tree' data-collapsed='true'>
  46. <?php foreach($yearList as $year):?>
  47. <li class='<?php echo $year == $currentYear ? 'active' : ''?>'>
  48. <?php extCommonModel::printLink('oa.overtime', $type, "date=$year", $year);?>
  49. <ul>
  50. <?php foreach($monthList[$year] as $month):?>
  51. <li class='<?php echo ($year == $currentYear and $month == $currentMonth) ? 'active' : ''?>'>
  52. <?php extCommonModel::printLink('oa.overtime', $type, "date=$year$month", $year . $month);?>
  53. </li>
  54. <?php endforeach;?>
  55. </ul>
  56. </li>
  57. <?php endforeach;?>
  58. </ul>
  59. </div>
  60. </div>
  61. </div>
  62. <div class='main'>
  63. <?php endif;?>
  64. <?php $batchReview = $type == 'browseReview' && commonModel::hasPriv('overtime', 'batchReview');?>
  65. <div class='panel'>
  66. <?php if($batchReview):?>
  67. <form id='batchReviewForm' method='post' action='<?php echo inlink('batchReview', 'status=pass');?>'>
  68. <?php endif;?>
  69. <table class='table table-hover text-center table-fixed tablesorter' id='overtimeTable'>
  70. <thead>
  71. <tr class='text-center'>
  72. <?php $vars = "&date={$date}&orderBy=%s";?>
  73. <th class='w-80px'><?php commonModel::printOrderLink('id', $orderBy, $vars, $lang->overtime->id, 'overtime', $type);?></th>
  74. <th class='w-100px'><?php commonModel::printOrderLink('createdBy', $orderBy, $vars, $lang->overtime->createdBy, 'overtime', $type);?></th>
  75. <th class='w-100px visible-lg'><?php echo $lang->user->dept;?></th>
  76. <th class='w-80px'><?php commonModel::printOrderLink('type', $orderBy, $vars, $lang->overtime->type, 'overtime', $type);?></th>
  77. <th class='w-150px'><?php commonModel::printOrderLink('begin', $orderBy, $vars, $lang->overtime->begin, 'overtime', $type);?></th>
  78. <th class='w-150px'><?php commonModel::printOrderLink('end', $orderBy, $vars, $lang->overtime->end, 'overtime', $type);?></th>
  79. <th class='w-70px visible-lg'><?php commonModel::printOrderLink('hours', $orderBy, $vars, $lang->overtime->hours, 'overtime', $type);?></th>
  80. <th class='text-left'><?php echo $lang->overtime->desc;?></th>
  81. <th class='w-100px'><?php commonModel::printOrderLink('status', $orderBy, $vars, $lang->overtime->status, 'overtime', $type);?></th>
  82. <?php if($type == 'personal'):?>
  83. <?php $class = $this->app->clientLang == 'en' ? 'w-180px' : 'w-130px';?>
  84. <th class='<?php echo $class;?>'><?php echo $lang->actions;?></th>
  85. <?php else:?>
  86. <?php $class = $this->app->clientLang == 'en' ? 'w-130px' : 'w-100px';?>
  87. <th class='<?php echo $class;?>'><?php echo $lang->actions;?></th>
  88. <?php endif;?>
  89. </tr>
  90. </thead>
  91. <?php foreach($overtimeList as $overtime):?>
  92. <?php $viewUrl = commonModel::hasPriv('overtime', 'view') ? $this->createLink('overtime', 'view', "id=$overtime->id&type=$type") : '';?>
  93. <tr id='overtime<?php echo $overtime->id;?>' >
  94. <td class='idTD'>
  95. <?php if($batchReview):?>
  96. <label class='checkbox-inline'><input type='checkbox' name='overtimeIDList[]' value='<?php echo $overtime->id;?>'/> <?php echo $overtime->id;?></label>
  97. <?php else:?>
  98. <?php echo $overtime->id;?>
  99. <?php endif;?>
  100. </td>
  101. <td><?php echo zget($users, $overtime->createdBy);?></td>
  102. <td class='visible-lg'><?php echo zget($deptList, $overtime->dept);?></td>
  103. <td><?php echo zget($this->lang->overtime->typeList, $overtime->type);?></td>
  104. <td><?php echo formatTime($overtime->begin . ' ' . $overtime->start, DT_DATETIME2);?></td>
  105. <td><?php echo formatTime($overtime->end . ' ' . $overtime->finish, DT_DATETIME2);?></td>
  106. <td class='visible-lg'><?php echo $overtime->hours == 0 ? '' : $overtime->hours;?></td>
  107. <td class='text-left' title='<?php echo $overtime->desc?>'><?php echo $overtime->desc;?></td>
  108. <td class='overtime-<?php echo $overtime->status?>'><?php echo $overtime->statusLabel;?></td>
  109. <td class='actionTD text-left'>
  110. <?php
  111. if($viewUrl) echo baseHTML::a($viewUrl, $lang->detail, "data-toggle='modal'");
  112. if($type == 'personal')
  113. {
  114. $switchLabel = $overtime->status == 'wait' ? $lang->overtime->cancel : $lang->overtime->commit;
  115. if(strpos(',wait,draft,', ",$overtime->status,") !== false)
  116. {
  117. extCommonModel::printLink('oa.overtime', 'switchstatus', "id=$overtime->id", $switchLabel, "class='reload'");
  118. }
  119. else
  120. {
  121. echo baseHTML::a('###', $switchLabel, "disabled='disabled'");
  122. }
  123. if(strpos(',wait,draft,reject,', ",$overtime->status,") !== false)
  124. {
  125. extCommonModel::printLink('oa.overtime', 'edit', "id=$overtime->id", $lang->edit, "data-toggle='modal'");
  126. extCommonModel::printLink('oa.overtime', 'delete', "id=$overtime->id", $lang->delete, "class='deleter'");
  127. }
  128. else
  129. {
  130. echo baseHTML::a('###', $lang->edit, "disabled='disabled'");
  131. echo baseHTML::a('###', $lang->delete, "disabled='disabled'");
  132. }
  133. }
  134. else
  135. {
  136. if(strpos(',wait,doing,', ",$overtime->status,") !== false)
  137. {
  138. extCommonModel::printLink('oa.overtime', 'review', "id=$overtime->id&status=pass", $lang->overtime->statusList['pass'], "class='reviewPass'");
  139. extCommonModel::printLink('oa.overtime', 'review', "id=$overtime->id&status=reject", $lang->overtime->statusList['reject'], "data-toggle='modal'");
  140. }
  141. else
  142. {
  143. echo baseHTML::a('###', $lang->overtime->statusList['pass'], "disabled='disabled'");
  144. echo baseHTML::a('###', $lang->overtime->statusList['reject'], "disabled='disabled'");
  145. }
  146. }
  147. ?>
  148. </td>
  149. </tr>
  150. <?php endforeach;?>
  151. </table>
  152. <?php if($overtimeList && $batchReview):?>
  153. <?php endif;?>
  154. <?php if(!$overtimeList):?>
  155. <?php endif;?>
  156. </div>
  157. <?php if($type != 'browseReview'):?>
  158. </div>
  159. </div>
  160. <?php endif;?>
  161. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>