選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

usersList.view.php 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php echo $this->partial('Layout/nav'); ?>
  2. <div class="container-fluid">
  3. <div class="container-page-wrapper shodowed bordered">
  4. <div class="container-page-container">
  5. <div class="row">
  6. <div class="col-lg-4">
  7. <h1><?php echo $this->actionTitle; ?></h1>
  8. </div>
  9. <div class="col-lg-8 clearfix">
  10. <div class="float-right">
  11. <span class="mr-3">
  12. <?php echo _('Users').": ".$this->view->getTotUsers;?>
  13. <?php if($this->config['settings']['free'] == 0){
  14. echo " - "._('Roles'); ?>: <span style="color:#7f8c8d"><?php echo strtolower(_('Used')); ?></span> <?php echo $this->view->getTotRoles; ?> / <span style="color:#7f8c8d"><?php echo strtolower(_('Total')); ?></span> <?php echo $this->view->getMaxAddRoles;
  15. } ?>
  16. </span>
  17. <?php if($this->config['settings']['free'] == 0){
  18. if($this->view->getTotRoles >= $this->view->getMaxAddRoles){
  19. ?>
  20. <a class="btn btn-success disabled" href="#"><?php echo _('New user'); ?></a>
  21. <?php
  22. }else{
  23. ?>
  24. <a class="btn btn-success" href="#" data-toggle="modal" data-target="#newuser-dialog"><?php echo _('New user'); ?></a>
  25. <?php
  26. }
  27. }else{
  28. ?>
  29. <a class="btn btn-success" href="<?php echo $this->helper->setHash(vsprintf($this->view->editLinkHash, [0])); ?>"><?php echo _('New user'); ?></a>
  30. <?php
  31. }
  32. ?>
  33. <button type="button" class="btn btn-danger btn-recycle-bin"><?php echo _('Deactivate'); ?> <span class="bin-label"></span></button>
  34. </div>
  35. </div>
  36. </div>
  37. <?php //debug($this->view->lastQuery); ?>
  38. <div class="table-overflow">
  39. <form id="table-search-users">
  40. <table class="table table-hover">
  41. <thead class="thead-light">
  42. <tr>
  43. <th width="1%"></th>
  44. <!--<th nowrap><?php echo $this->helper->setSortableCol(_('Username'), 'users/'.time(), 'username', 'desc'); ?></th>-->
  45. <th nowrap><?php echo $this->helper->setSortableCol(_('Created'), 'users/'.time(), 'created_at', 'desc'); ?></th>
  46. <th nowrap><?php echo $this->helper->setSortableCol(_('Updated'), 'users/'.time(), 'updated_at', 'desc'); ?></th>
  47. <th nowrap><?php echo $this->helper->setSortableCol(_('Surname'), 'users/'.time(), 'surname', 'desc'); ?></th>
  48. <th nowrap><?php echo $this->helper->setSortableCol(_('Name'), 'users/'.time(), 'name', 'desc'); ?></th>
  49. <th nowrap><?php echo $this->helper->setSortableCol(_('E-mail'), 'users/'.time(), 'email', 'desc'); ?></th>
  50. <th nowrap><?php echo $this->helper->setSortableCol(_('Roles'), 'users/'.time(), 'roles', 'desc'); ?></th>
  51. <th nowrap><?php echo $this->helper->setSortableCol(_('Status'), 'users/'.time(), 'status', 'desc'); ?></th>
  52. <th nowrap></th>
  53. </tr>
  54. <tr>
  55. <th></th>
  56. <!--<th><input type="text" class="form-control form-control-sm user-search-ctrl" value="<?php echo isset($this->view->strOutput['search']['username']) ? $this->view->strOutput['search']['username'] : ''; ?>" name="search[username]"></th>-->
  57. <th></th>
  58. <th></th>
  59. <th><input type="text" class="form-control form-control-sm user-search-ctrl" value="<?php echo isset($this->view->strOutput['search']['surname']) ? $this->view->strOutput['search']['surname'] : ''; ?>" name="search[surname]"></th>
  60. <th><input type="text" class="form-control form-control-sm user-search-ctrl" value="<?php echo isset($this->view->strOutput['search']['name']) ? $this->view->strOutput['search']['name'] : ''; ?>" name="search[name]"></th>
  61. <th><input type="text" class="form-control form-control-sm user-search-ctrl" value="<?php echo isset($this->view->strOutput['search']['email']) ? $this->view->strOutput['search']['email'] : ''; ?>" name="search[email]"></th>
  62. <th>
  63. <select name="search[roles]" class="form-control form-control-sm user-search-ctrl">
  64. <option value=""></option>
  65. <?php if(is_array($this->view->roleSelectList)): ?>
  66. <?php foreach($this->view->roleSelectList as $roleItem): ?>
  67. <option value="<?php echo $roleItem['value']; ?>" <?php echo $roleItem['selected'] ? 'selected' : ''; ?>><?php echo $roleItem['name']; ?></option>
  68. <?php endforeach; ?>
  69. <?php endif; ?>
  70. </select>
  71. </th>
  72. <th></th>
  73. <th><a href="<?php echo $this->helper->setHash('users/'.time().'/surname/desc/1'); ?>" class="btn btn-info btn-sm float-right"><span class="icon-search"></span></a></th>
  74. </tr>
  75. </thead>
  76. <tbody>
  77. <?php if (is_array($this->view->usersList) && !empty($this->view->usersList)): ?>
  78. <?php foreach($this->view->usersList as $user): ?>
  79. <tr>
  80. <?php /*<td><input type="checkbox" class="recycle-bin-checkbox" name="trash_user[]" value="<?php echo $user['id']; ?>"></td>*/ ?>
  81. <td>
  82. <?php echo $this->helper->setAvatarView($this->user->getAvatar($user['id']), ['timestamp'=>md5($user['updated_at']), 'class'=>'list-avatar']); ?>
  83. </td>
  84. <!--<td><?php echo $user['username']; ?></td>-->
  85. <td><?php echo $this->helper->getDateString($user['created_at'], false); ?></td>
  86. <td><?php echo $this->helper->getDateString($user['updated_at'], false); ?></td>
  87. <td><?php echo $user['surname']; ?></td>
  88. <td><?php echo $user['name']; ?></td>
  89. <td><?php echo $user['email']; ?></td>
  90. <td><?php echo $user['roles']; ?></td>
  91. <?php
  92. switch((int)$user['status']) {
  93. case 0:
  94. $iconTitle = _('Not active');
  95. $iconCode = '<span class="icon-sad color-yellow"></span>';
  96. break;
  97. case 1:
  98. $iconTitle = _('Active');
  99. $iconCode = '<span class="icon-smile2 color-green"></span>';
  100. break;
  101. case 2:
  102. $iconTitle = STATUS_TECH_NAME;
  103. $iconCode = '<span class="icon-wrench"></span>';
  104. break;
  105. }
  106. ?>
  107. <td class="text-center" title="<?php echo $iconTitle; ?>"><?php echo $iconCode; ?></td>
  108. <td class="text-right"><a href="<?php echo $this->helper->setHash(vsprintf($this->view->editLinkHash, [$user['id']])); ?>" title="<?php echo _('Edit user'); ?>" class="btn btn-outline-dark btn-sm"><span class="icon-pencil"></span></a></td>
  109. </tr>
  110. <?php endforeach; ?>
  111. <?php endif; ?>
  112. </tbody>
  113. </table>
  114. <?php if (empty($this->view->usersList)): ?>
  115. <div class="alert alert-warning" role="alert">
  116. <?php echo _('No data available in this list.'); ?>
  117. </div>
  118. <?php endif; ?>
  119. </form>
  120. </div>
  121. <?php echo $this->partial('Layout/pagination'); ?>
  122. </div>
  123. </div>
  124. <?php echo $this->partial('User/new-user-dialog'); ?>
  125. </div>