browse.html.php 8.3 KB

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