From: Alexander Ebert Date: Thu, 10 Jan 2019 18:46:16 +0000 (+0100) Subject: Consistent sort order of user group suggestions X-Git-Tag: 5.2.0_Alpha_1~365^2~15 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=85710eab687e79722471d75ee13892c3027ac4f0;p=GitHub%2FWoltLab%2FWCF.git Consistent sort order of user group suggestions See #2790 --- diff --git a/wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php b/wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php index 1b421b35c5..f4b8089ef6 100644 --- a/wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php @@ -37,7 +37,7 @@ abstract class UserOptionListForm extends AbstractOptionListForm { } uasort($userGroups, function(UserGroup $groupA, UserGroup $groupB) { - return strcmp($groupA->getName(), $groupB->getName()); + return strcasecmp($groupA->getName(), $groupB->getName()); }); return $userGroups; diff --git a/wcfsetup/install/files/lib/data/user/UserAction.class.php b/wcfsetup/install/files/lib/data/user/UserAction.class.php index 44c25a3ccd..a39edf8642 100644 --- a/wcfsetup/install/files/lib/data/user/UserAction.class.php +++ b/wcfsetup/install/files/lib/data/user/UserAction.class.php @@ -517,6 +517,10 @@ class UserAction extends AbstractDatabaseObjectAction implements IClipboardActio } } } + + usort($list, function(array $item1, array $item2) { + return strcasecmp($item1['label'], $item2['label']); + }); } // find users diff --git a/wcfsetup/install/files/lib/system/option/user/group/UserGroupsUserGroupOptionType.class.php b/wcfsetup/install/files/lib/system/option/user/group/UserGroupsUserGroupOptionType.class.php index 5fadc2bdd0..11b4f9d75a 100644 --- a/wcfsetup/install/files/lib/system/option/user/group/UserGroupsUserGroupOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/user/group/UserGroupsUserGroupOptionType.class.php @@ -26,6 +26,10 @@ class UserGroupsUserGroupOptionType extends AbstractOptionType implements IUserG // get all groups $groups = UserGroup::getGroupsByType(); + usort($groups, function(UserGroup $groupA, UserGroup $groupB) { + return strcasecmp($groupA->getName(), $groupB->getName()); + }); + // generate html $html = ''; foreach ($groups as $group) {