Consistent sort order of user group suggestions
authorAlexander Ebert <ebert@woltlab.com>
Thu, 10 Jan 2019 18:46:16 +0000 (19:46 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 10 Jan 2019 18:46:16 +0000 (19:46 +0100)
See #2790

wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php
wcfsetup/install/files/lib/data/user/UserAction.class.php
wcfsetup/install/files/lib/system/option/user/group/UserGroupsUserGroupOptionType.class.php

index 1b421b35c5c84a78622b3b4167590e3c762d4089..f4b8089ef636386e970c2bf8fd3f16749e0e517e 100644 (file)
@@ -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;
index 44c25a3ccdd9c41c0685e69d45e3f3c3fffb9c95..a39edf8642fdc75da412459a23a40b5dccca57a5 100644 (file)
@@ -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
index 5fadc2bdd05ff4ed75803a95a1bb45df91521914..11b4f9d75a9bb53d63399dafc46ddfcb4572b6bb 100644 (file)
@@ -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) {