<thead>
<tr>
<th class="columnID columnGroupID{if $sortField == 'groupID'} active {@$sortOrder}{/if}" colspan="2"><a href="{link controller='UserGroupList'}pageNo={@$pageNo}&sortField=groupID&sortOrder={if $sortField == 'groupID' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.global.objectID{/lang}</a></th>
- <th class="columnTitle columnGroupName{if $sortField == 'groupName'} active {@$sortOrder}{/if}"><a href="{link controller='UserGroupList'}pageNo={@$pageNo}&sortField=groupName&sortOrder={if $sortField == 'groupName' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.global.name{/lang}</a></th>
+ <th class="columnTitle columnGroupName{if $sortField == 'groupNameI18n'} active {@$sortOrder}{/if}"><a href="{link controller='UserGroupList'}pageNo={@$pageNo}&sortField=groupNameI18n&sortOrder={if $sortField == 'groupNameI18n' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.global.name{/lang}</a></th>
<th class="columnDigits columnMembers{if $sortField == 'members'} active {@$sortOrder}{/if}"><a href="{link controller='UserGroupList'}pageNo={@$pageNo}&sortField=members&sortOrder={if $sortField == 'members' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.group.members{/lang}</a></th>
<th class="columnDigits columnPriority{if $sortField == 'priority'} active {@$sortOrder}{/if}"><a href="{link controller='UserGroupList'}pageNo={@$pageNo}&sortField=priority&sortOrder={if $sortField == 'priority' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{/link}">{lang}wcf.acp.group.priority{/lang}</a></th>
<?php
namespace wcf\acp\page;
-use wcf\data\user\group\UserGroupList;
+use wcf\data\user\group\I18nUserGroupList;
use wcf\page\SortablePage;
use wcf\system\WCF;
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\Acp\Page
*
- * @property UserGroupList $objectList
+ * @property I18nUserGroupList $objectList
*/
class UserGroupListPage extends SortablePage {
/**
/**
* @inheritDoc
*/
- public $defaultSortField = 'groupName';
+ public $defaultSortField = 'groupNameI18n';
/**
* @inheritDoc
*/
- public $validSortFields = ['groupID', 'groupName', 'groupType', 'members', 'priority'];
+ public $validSortFields = ['groupID', 'groupNameI18n', 'groupType', 'members', 'priority'];
/**
* @inheritDoc
*/
- public $objectListClassName = UserGroupList::class;
+ public $objectListClassName = I18nUserGroupList::class;
/**
* indicates if a group has just been deleted
protected function initObjectList() {
parent::initObjectList();
+ if (!empty($this->objectList->sqlSelects)) $this->objectList->sqlSelects .= ',';
$this->objectList->sqlSelects .= "(SELECT COUNT(*) FROM wcf".WCF_N."_user_to_group WHERE groupID = user_group.groupID) AS members";
}
* @inheritDoc
*/
protected function readObjects() {
- $this->sqlOrderBy = ($this->sortField != 'members' ? 'user_group.' : '').$this->sortField." ".$this->sortOrder;
+ $this->sqlOrderBy = (($this->sortField != 'members' && $this->sortField != 'groupNameI18n') ? 'user_group.' : '').$this->sortField." ".$this->sortOrder;
parent::readObjects();
}
--- /dev/null
+<?php
+namespace wcf\data\user\group;
+use wcf\data\I18nDatabaseObjectList;
+
+/**
+ * I18n implementation of user group list.
+ *
+ * @author Alexander Ebert
+ * @copyright 2001-2019 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\Data\User\Group
+ * @since 5.2
+ *
+ * @method UserGroup current()
+ * @method UserGroup[] getObjects()
+ * @method UserGroup|null search($objectID)
+ * @property UserGroup[] $objects
+ */
+class I18nUserGroupList extends I18nDatabaseObjectList {
+ /**
+ * @inheritDoc
+ */
+ public $i18nFields = ['groupName' => 'groupNameI18n'];
+
+ /**
+ * @inheritDoc
+ */
+ public $className = UserGroup::class;
+}