From 85710eab687e79722471d75ee13892c3027ac4f0 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 10 Jan 2019 19:46:16 +0100 Subject: [PATCH] Consistent sort order of user group suggestions See #2790 --- .../install/files/lib/acp/form/UserOptionListForm.class.php | 2 +- wcfsetup/install/files/lib/data/user/UserAction.class.php | 4 ++++ .../option/user/group/UserGroupsUserGroupOptionType.class.php | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) 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) { -- 2.20.1