browse.html.php 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <?php
  2. /**
  3. * The browse view file of product dept of ZenTaoPMS.
  4. *
  5. * @copyright Copyright 2009-2015 禅道软件(青岛)有限公司(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 Chunsheng Wang <chunsheng@cnezsoft.com>
  8. * @package product
  9. * @version $Id: browse.html.php 5096 2013-07-11 07:02:43Z chencongzhi520@gmail.com $
  10. * @link http://www.zentao.net
  11. */
  12. ?>
  13. <?php
  14. include '../../common/view/header.html.php';
  15. js::set('deptID', $deptID);
  16. js::set('browseType', $browseType);
  17. js::set('confirmDelete', $lang->user->confirmDelete);
  18. ?>
  19. <div id='mainMenu' class='clearfix'>
  20. <div id='sidebarHeader'>
  21. <div class="title">
  22. <?php echo empty($dept->name) ? $lang->dept->common : $dept->name;?>
  23. <?php if($deptID) echo html::a(inlink('browse', "deptID=0"), "<i class='icon icon-sm icon-close'></i>", '', "class='text-muted'");?>
  24. </div>
  25. </div>
  26. <div class='btn-toolbar pull-left'>
  27. <?php echo html::a($this->createLink('company', 'browse', 'browseType=inside'), '<span class="text">' . $lang->user->inside . '</span>', '', 'class="btn btn-link inside"');?>
  28. <?php echo html::a($this->createLink('company', 'browse', 'browseType=outside'), '<span class="text">' . $lang->user->outside . '</span>', '', 'class="btn btn-link outside"');?>
  29. <a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->user->search;?></a>
  30. </div>
  31. <div class='btn-toolbar pull-right'>
  32. <?php if(commonModel::isTutorialMode()):?>
  33. <?php
  34. $wizardParams = helper::safe64Encode("dept=$deptID");
  35. $link = $this->createLink('tutorial', 'wizard', "module=user&method=create&params=$wizardParams");
  36. echo html::a($link, "<i class='icon icon-plus'></i> {$lang->user->create}", '', "class='btn btn-primary create-user-btn'");
  37. ?>
  38. <?php else:?>
  39. <?php if(common::hasPriv('custom', 'set')):?>
  40. <?php common::printLink('custom', 'set', "module=user&field=roleList", "<i class='icon icon-cog-outline'></i> " . $lang->company->manageRole, '', "class='btn btn-link'");?>
  41. <?php endif;?>
  42. <?php if(common::hasPriv('user', 'create') and common::hasPriv('user', 'batchCreate')):?>
  43. <?php
  44. $createUserLink = $this->createLink('user', 'create', "dept={$deptID}");
  45. $batchCreateUserLink = $this->createLink('user', 'batchCreate', "dept={$deptID}");
  46. ?>
  47. <div class='btn-group dropdown'>
  48. <?php common::printLink('user', 'create', "dept={$deptID}", "<i class='icon icon-plus'></i> " . $lang->user->create, '', "class='btn btn-primary create-user-btn'");?>
  49. <button type='button' class='btn btn-primary dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>
  50. <ul class='dropdown-menu'>
  51. <li><?php echo html::a($createUserLink, $lang->user->create);?></li>
  52. <li><?php echo html::a($batchCreateUserLink, $lang->user->batchCreate);?></li>
  53. </ul>
  54. </div>
  55. <?php else:?>
  56. <?php common::printLink('user', 'batchCreate', "dept={$deptID}", "<i class='icon icon-plus'></i> " . $lang->user->batchCreate, '', "class='btn btn-secondary'");?>
  57. <?php common::printLink('user', 'create', "dept={$deptID}", "<i class='icon icon-plus'></i> " . $lang->user->create, '', "class='btn btn-primary'");?>
  58. <?php endif;?>
  59. <?php endif;?>
  60. </div>
  61. </div>
  62. <div id='mainContent' class='main-row fade'>
  63. <div class='side-col' id='sidebar'>
  64. <div class="sidebar-toggle"><i class="icon icon-angle-left"></i></div>
  65. <div class='cell'>
  66. <?php echo $deptTree;?>
  67. <div class='text-center'>
  68. <?php common::printLink('dept', 'browse', '', $lang->dept->manage, '', "class='btn btn-info btn-wide'");?>
  69. </div>
  70. </div>
  71. </div>
  72. <div class='main-col'>
  73. <div class="cell<?php if($type == 'bysearch') echo ' show';?>" id="queryBox" data-module='user'></div>
  74. <form class='main-table table-user' data-ride='table' action='<?php echo $this->createLink('user', 'batchEdit', "deptID=$deptID")?>' method='post' id='userListForm'>
  75. <?php $canBatchEdit = common::hasPriv('user', 'batchEdit');?>
  76. <table class='table has-sort-head' id='userList'>
  77. <thead>
  78. <tr>
  79. <?php $vars = "browseType=$browseType&param=$param&type=$type&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
  80. <th class='c-id'>
  81. <?php if($canBatchEdit):?>
  82. <div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
  83. <label></label>
  84. </div>
  85. <?php endif;?>
  86. <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
  87. </th>
  88. <th><?php common::printOrderlink('realname', $orderBy, $vars, $lang->user->realname);?></th>
  89. <th><?php common::printOrderLink('account', $orderBy, $vars, $lang->user->account);?></th>
  90. <?php if($browseType == 'inside'):?>
  91. <th class="c-role"><?php common::printOrderLink('role', $orderBy, $vars, $lang->user->role);?></th>
  92. <?php else:?>
  93. <th class="c-company"><?php common::printOrderLink('company', $orderBy, $vars, $lang->user->company);?></th>
  94. <?php endif;?>
  95. <th class="c-url"><?php common::printOrderLink('email', $orderBy, $vars, $lang->user->email);?></th>
  96. <th class="c-type"><?php common::printOrderLink('gender', $orderBy, $vars, $lang->user->gender);?></th>
  97. <?php if(!commonModel::isTutorialMode()): ?>
  98. <th><?php common::printOrderLink('phone', $orderBy, $vars, $lang->user->phone);?></th>
  99. <th><?php !empty($this->config->isINT) ? common::printOrderLink('skype', $orderBy, $vars, $lang->user->skype) : common::printOrderLink('qq', $orderBy, $vars, $lang->user->qq);?></th>
  100. <th class="c-date"><?php common::printOrderLink('last', $orderBy, $vars, $lang->user->last);?></th>
  101. <th class="c-visits"><?php common::printOrderLink('visits', $orderBy, $vars, $lang->user->visits);?></th>
  102. <?php endif; ?>
  103. <th class='c-actions'><?php echo $lang->actions;?></th>
  104. </tr>
  105. </thead>
  106. <tbody>
  107. <?php foreach($users as $user):?>
  108. <tr>
  109. <td class='c-id'>
  110. <?php if($canBatchEdit):?>
  111. <?php echo html::checkbox('users', array($user->id => '')) . sprintf('%03d', $user->id);?>
  112. <?php else:?>
  113. <?php printf('%03d', $user->id);?>
  114. <?php endif;?>
  115. </td>
  116. <td title="<?php echo $user->realname;?>"><?php echo $user->realname;?></td>
  117. <td><?php echo $user->account;?></td>
  118. <?php if($browseType == 'inside'):?>
  119. <td title='<?php echo zget($lang->user->roleList, $user->role, '');?>'><?php echo zget($lang->user->roleList, $user->role, '');?></td>
  120. <?php else:?>
  121. <td title='<?php echo zget($companies, $user->company, '');?>'><?php echo zget($companies, $user->company, '');?></td>
  122. <?php endif;?>
  123. <td class="c-url" title="<?php echo $user->email;?>"><?php echo html::mailto($user->email);?></td>
  124. <td class="c-type"><?php echo zget($lang->user->genderList, $user->gender, $user->gender);?></td>
  125. <?php if(!commonModel::isTutorialMode()): ?>
  126. <td title="<?php echo $user->phone;?>"><?php echo $user->phone;?></td>
  127. <td><?php echo !empty($this->config->isINT) ? $user->skype : ($user->qq ? html::a("tencent://message/?uin=$user->qq", $user->qq) : '');?></td>
  128. <td class='c-date'><?php if($user->last) echo date('Y-m-d', $user->last);?></td>
  129. <td class='c-num text-center'><?php echo $user->visits;?></td>
  130. <?php endif; ?>
  131. <td class='c-actions'>
  132. <?php
  133. if(!empty($config->sso->turnon)) common::printIcon('user', 'unbind', "userID=$user->id", $user, 'list', 'unlink', "hiddenwin");
  134. common::printIcon('user', 'unlock', "userID=$user->id", $user, 'list', 'unlock', "hiddenwin");
  135. common::printIcon('user', 'edit', "userID=$user->id&from=company", '', 'list');
  136. $deleteClass = (strpos($this->app->company->admins, ",{$user->account},") === false and common::hasPriv('user', 'delete')) ? 'btn iframe' : 'btn disabled';
  137. echo html::a($this->createLink('user', 'delete', "userID=$user->id"), '<i class="icon-trash"></i>', '', "title='{$lang->user->delete}' class='{$deleteClass}'");
  138. ?>
  139. </td>
  140. </tr>
  141. <?php endforeach;?>
  142. </tbody>
  143. </table>
  144. <?php if($users):?>
  145. <div class='table-footer'>
  146. <?php if($canBatchEdit):?>
  147. <div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
  148. <div class="table-actions btn-toolbar"><?php echo html::submitButton($lang->edit, '', 'btn');?></div>
  149. <?php endif;?>
  150. <?php $pager->show('right', 'pagerjs');?>
  151. </div>
  152. <?php endif;?>
  153. </form>
  154. </div>
  155. </div>
  156. <script lanugage='javascript'>
  157. $('#dept<?php echo $deptID;?>').addClass('active');
  158. $('.pull-left .' + browseType).addClass('btn-active-text');
  159. </script>
  160. <?php include '../../common/view/footer.html.php';?>