browse.html.php 7.8 KB

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