browse.html.php 7.9 KB

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