From f2459057389f7bbb751eaf325d1783c15f856ebc Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 15 Mar 2016 22:12:52 +0100 Subject: * sorting user selection --- app/php/components/UserSelection.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'app/php/components/UserSelection.php') diff --git a/app/php/components/UserSelection.php b/app/php/components/UserSelection.php index 99dd2ab..681e154 100644 --- a/app/php/components/UserSelection.php +++ b/app/php/components/UserSelection.php @@ -50,7 +50,7 @@ class UserSelection extends TTemplateControl { ) ) ); - return array_map( + $categories = array_map( function($category) use($calendars) { $dto = new CalendarGroupDTO(); $dto->loadRecord($category, $calendars); @@ -58,6 +58,13 @@ class UserSelection extends TTemplateControl { }, $categories ); + usort( + $categories, + function ($cat1, $cat2) { + return strcmp($cat1->Name, $cat2->Name); + } + ); + return $categories; } return []; } -- cgit v1.2.3