browse.html.php 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <?php
  2. /**
  3. * The browse view file of makeup 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 makeup
  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->makeup->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->makeup->confirmReview)?>
  36. <div id='menuActions'>
  37. <?php extCommonModel::printLink('oa.makeup', 'export', "mode=all&orderBy={$orderBy}", $lang->exportIcon . $lang->export, "class='btn btn-primary iframe' data-width='700'");?>
  38. <?php extCommonModel::printLink('oa.makeup', 'create', '', "<i class='icon icon-plus'></i> {$lang->makeup->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.makeup', $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.makeup', $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('makeup', '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='makeupTable'>
  70. <thead>
  71. <tr class='text-center'>
  72. <?php $vars = "&date={$date}&orderBy=%s";?>
  73. <th class='w-50px'><?php commonModel::printOrderLink('id', $orderBy, $vars, $lang->makeup->id, 'makeup', $type);?></th>
  74. <th class='w-100px'><?php commonModel::printOrderLink('createdBy', $orderBy, $vars, $lang->makeup->createdBy, 'makeup', $type);?></th>
  75. <th class='w-100px visible-lg'><?php echo $lang->user->dept;?></th>
  76. <th class='w-120px'><?php commonModel::printOrderLink('begin', $orderBy, $vars, $lang->makeup->begin, 'makeup', $type);?></th>
  77. <th class='w-120px'><?php commonModel::printOrderLink('end', $orderBy, $vars, $lang->makeup->end, 'makeup', $type);?></th>
  78. <th class='w-70px visible-lg'><?php commonModel::printOrderLink('hours', $orderBy, $vars, $lang->makeup->hours, 'makeup', $type);?></th>
  79. <th class='text-left'><?php echo $lang->makeup->desc;?></th>
  80. <th class='w-100px'><?php commonModel::printOrderLink('status', $orderBy, $vars, $lang->makeup->status, 'makeup', $type);?></th>
  81. <?php if($type == 'personal'):?>
  82. <?php $class = $this->app->clientLang == 'en' ? 'w-180px' : 'w-130px';?>
  83. <th class='<?php echo $class;?>'><?php echo $lang->actions;?></th>
  84. <?php else:?>
  85. <?php $class = $this->app->clientLang == 'en' ? 'w-130px' : 'w-100px';?>
  86. <th class='<?php echo $class;?>'><?php echo $lang->actions;?></th>
  87. <?php endif;?>
  88. </tr>
  89. </thead>
  90. <?php foreach($makeupList as $makeup):?>
  91. <?php $viewUrl = commonModel::hasPriv('makeup', 'view') ? $this->createLink('makeup', 'view', "id=$makeup->id&type=$type") : '';?>
  92. <tr id='makeup<?php echo $makeup->id;?>' >
  93. <td class='idTD'>
  94. <?php if($batchReview):?>
  95. <label class='checkbox-inline'><input type='checkbox' name='makeupIDList[]' value='<?php echo $makeup->id;?>'/> <?php echo $makeup->id;?></label>
  96. <?php else:?>
  97. <?php echo $makeup->id;?>
  98. <?php endif;?>
  99. </td>
  100. <td><?php echo zget($users, $makeup->createdBy);?></td>
  101. <td class='visible-lg'><?php echo zget($deptList, $makeup->dept, ' ');?></td>
  102. <td><?php echo formatTime($makeup->begin . ' ' . $makeup->start, DT_DATETIME2);?></td>
  103. <td><?php echo formatTime($makeup->end . ' ' . $makeup->finish, DT_DATETIME2);?></td>
  104. <td class='visible-lg'><?php echo $makeup->hours == 0 ? '' : $makeup->hours;?></td>
  105. <td class='text-left' title='<?php echo $makeup->desc?>'><?php echo $makeup->desc;?></td>
  106. <td class='makeup-<?php echo $makeup->status?>'><?php echo $makeup->statusLabel;?></td>
  107. <td class='actionTD text-left'>
  108. <?php
  109. if($viewUrl) echo baseHTML::a($viewUrl, $lang->detail, "data-toggle='modal'");
  110. if($type == 'personal')
  111. {
  112. $switchLabel = $makeup->status == 'wait' ? $lang->makeup->cancel : $lang->makeup->commit;
  113. if(strpos(',wait,draft,', ",$makeup->status,") !== false)
  114. {
  115. extCommonModel::printLink('oa.makeup', 'switchstatus', "id=$makeup->id", $switchLabel, "class='reload'");
  116. }
  117. else
  118. {
  119. echo baseHTML::a('###', $switchLabel, "disabled='disabled'");
  120. }
  121. if(strpos(',wait,draft,reject,', ",$makeup->status,") !== false)
  122. {
  123. extCommonModel::printLink('oa.makeup', 'edit', "id=$makeup->id", $lang->edit, "data-toggle='modal'");
  124. extCommonModel::printLink('oa.makeup', 'delete', "id=$makeup->id", $lang->delete, "class='deleter'");
  125. }
  126. else
  127. {
  128. echo baseHTML::a('###', $lang->edit, "disabled='disabled'");
  129. echo baseHTML::a('###', $lang->delete, "disabled='disabled'");
  130. }
  131. }
  132. else
  133. {
  134. if(strpos(',wait,doing,', ",$makeup->status,") !== false)
  135. {
  136. extCommonModel::printLink('oa.makeup', 'review', "id=$makeup->id&status=pass", $lang->makeup->statusList['pass'], "class='reviewPass'");
  137. extCommonModel::printLink('oa.makeup', 'review', "id=$makeup->id&status=reject", $lang->makeup->statusList['reject'], "data-toggle='modal'");
  138. }
  139. else
  140. {
  141. echo baseHTML::a('###', $lang->makeup->statusList['pass'], "disabled='disabled'");
  142. echo baseHTML::a('###', $lang->makeup->statusList['reject'], "disabled='disabled'");
  143. }
  144. }
  145. ?>
  146. </td>
  147. </tr>
  148. <?php endforeach;?>
  149. </table>
  150. <?php if($makeupList && $batchReview):?>
  151. <?php endif;?>
  152. <?php if(!$makeupList):?>
  153. <?php endif;?>
  154. </div>
  155. <?php if($type != 'browseReview'):?>
  156. </div>
  157. </div>
  158. <?php endif;?>
  159. <?php include $app->getModuleRoot() . 'common/view/footer.html.php';?>