browse.html.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. /**
  3. * The browse of meetingroom module of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2021 禅道软件(青岛)有限公司(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 Liyuchun <liyuchun@easycorp.ltd>
  8. * @package meetingroom
  9. * @version $Id: browse.html.php 4903 2021-06-09 13:48:59Z $
  10. * @link https://www.zentao.net
  11. */
  12. ?>
  13. <?php include $app->getModuleRoot() . "common/view/header.html.php"?>
  14. <div id="mainMenu" class="clearfix">
  15. <div class="btn-toobar pull-left">
  16. <?php
  17. $active = $browseType == 'all' ? 'btn-active-text' : '';
  18. $label = "<span class='text'>{$lang->meetingroom->all}</span>";
  19. echo html::a(inlink('browse', "browseType=all"), $label, '', "class='btn btn-link $active'");
  20. ?>
  21. <a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->meetingroom->byQuery;?></a>
  22. </div>
  23. <div class="btn-toolbar pull-right">
  24. <?php if((common::hasPriv('meetingroom', 'create')) or (common::hasPriv('meetingroom', 'batchCreate'))):?>
  25. <div class='btn-group dropdown'>
  26. <?php
  27. if(common::hasPriv('meetingroom', 'create'))
  28. {
  29. $actionLink = $this->createLink('meetingroom', 'create');
  30. echo html::a($actionLink, "<i class='icon icon-plus'></i> {$lang->meetingroom->create}", '', "class='btn btn-primary'");
  31. }
  32. elseif(common::hasPriv('meetingroom', 'batchCreate'))
  33. {
  34. $actionLink = $this->createLink('meetingroom', 'batchCreate');
  35. echo html::a($actionLink, "<i class='icon icon-plus'></i> {$lang->meetingroom->batchCreate}", '', "class='btn btn-primary'");
  36. }
  37. ?>
  38. <?php if((common::hasPriv('meetingroom', 'create')) and (common::hasPriv('meetingroom', 'batchCreate'))):?>
  39. <button type='button' class='btn btn-primary dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>
  40. <ul class='dropdown-menu pull-right'>
  41. <li><?php echo html::a($actionLink, $lang->meetingroom->create);?></li>
  42. <li><?php echo html::a($this->createLink('meetingroom', 'batchCreate'), $lang->meetingroom->batchCreate);?></li>
  43. </ul>
  44. <?php endif;?>
  45. </div>
  46. <?php endif;?>
  47. </div>
  48. </div>
  49. <div class="cell<?php if($browseType == 'bysearch') echo ' show';?>" id="queryBox" data-url="<?php echo $this->createLink('search', 'buildOldForm', 'module=meetingroom');?>" data-module='meetingroom'></div>
  50. <div id="mainContent" class="main-table">
  51. <?php if(empty($rooms)):?>
  52. <div class="table-empty-tip">
  53. <p>
  54. <span class="text-muted"><?php echo $lang->noData;?></span>
  55. <?php if(common::hasPriv('meetingroom', 'create')):?>
  56. <?php echo html::a($this->createLink('meetingroom', 'create'), "<i class='icon icon-plus'></i> " . $lang->meetingroom->create, '', "class='btn btn-info'");?>
  57. <?php endif;?>
  58. </p>
  59. </div>
  60. <?php else:?>
  61. <form class='main-table' id='meetingroomForm' method='post' data-ride="table" action='<?php echo inLink('batchEdit');?>'>
  62. <table class="table has-sort-head" id='meetingroomList'>
  63. <?php
  64. $vars = "browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
  65. $canBatchEdit = common::hasPriv('meetingroom', 'batchEdit', !empty($meetingroom) ? $meetingroom : null);
  66. ?>
  67. <thead>
  68. <tr>
  69. <th class='text-left w-80px'>
  70. <?php
  71. if($canBatchEdit) echo "<div class='checkbox-primary check-all' title='{$this->lang->selectAll}'><label></label></div>";
  72. common::printOrderLink('id', $orderBy, $vars, $lang->meetingroom->id);
  73. ?>
  74. </th>
  75. <th class='text-left'><?php common::printOrderLink('name', $orderBy, $vars, $lang->meetingroom->name);?></th>
  76. <th class='w-120px'><?php common::printOrderLink('position', $orderBy, $vars, $lang->meetingroom->position);?></th>
  77. <th class='w-80px'><?php common::printOrderLink('seats', $orderBy, $vars, $lang->meetingroom->seats);?></th>
  78. <th class='w-280px'><?php echo $lang->meetingroom->equipment;?></th>
  79. <th class='w-280px'><?php echo $lang->meetingroom->openTime;?></th>
  80. <th class='w-50px'><?php echo $lang->actions;?></th>
  81. </tr>
  82. </thead>
  83. <tbody>
  84. <?php foreach($rooms as $room):?>
  85. <tr>
  86. <td>
  87. <?php echo $canBatchEdit ? html::checkbox('roomIDList', array($room->id => '')) . sprintf('%03d',$room->id) : sprintf('%03d',$room->id);?>
  88. </td>
  89. <td><?php echo html::a($this->createLink('meetingroom', 'view', "meetingroomID=$room->id"), $room->name);?></td>
  90. <td class='position' title="<?php echo $room->position;?>"><?php echo $room->position;?></td>
  91. <td><?php echo $room->seats;?></td>
  92. <td class='equipment' title="<?php echo $room->equipmentName;?>"><?php echo $room->equipmentName;?></td>
  93. <td class='openTime' title="<?php echo $room->openTimeName;?>"><?php echo $room->openTimeName;?></td>
  94. <td class='c-actions'>
  95. <?php
  96. $params = "meetingroomID=$room->id";
  97. common::printIcon('meetingroom', 'edit', $params, $room, "list");
  98. ?>
  99. </td>
  100. </tr>
  101. <?php endforeach;?>
  102. </tbody>
  103. </table>
  104. <div class='table-footer'>
  105. <?php if($canBatchEdit):?>
  106. <div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
  107. <div class="table-actions btn-toolbar"><?php echo html::submitButton($lang->meetingroom->edit, '', 'btn');?></div>
  108. <?php endif;?>
  109. <?php $pager->show('right', 'pagerjs');?>
  110. </div>
  111. <?php endif;?>
  112. </form>
  113. </div>
  114. <?php include $app->getModuleRoot() . "common/view/footer.html.php"?>