diff options
Diffstat (limited to 'app/php')
-rw-r--r-- | app/php/components/UserSelection.php | 9 | ||||
-rw-r--r-- | app/php/dto/CalendarGroupDTO.php | 6 |
2 files changed, 14 insertions, 1 deletions
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 []; } diff --git a/app/php/dto/CalendarGroupDTO.php b/app/php/dto/CalendarGroupDTO.php index 3adb6c1..e1f39b5 100644 --- a/app/php/dto/CalendarGroupDTO.php +++ b/app/php/dto/CalendarGroupDTO.php @@ -23,6 +23,12 @@ class CalendarGroupDTO { } ) ); + usort( + $this->Calendars, + function ($cal1, $cal2) { + return strcmp($cal1->Name, $cal2->Name); + } + ); } } |