From d214525e24b2c37f1e44afdd698da5564fd70ae5 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Tue, 25 Dec 2018 10:25:32 +0100 Subject: [PATCH] Sort Angels Alphabetical closes #541 (Shift Signup: Sort Angels Alphabetical) --- includes/controller/shift_entries_controller.php | 4 +++- includes/pages/admin_free.php | 1 + includes/pages/admin_groups.php | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/controller/shift_entries_controller.php b/includes/controller/shift_entries_controller.php index a6659598..3c6c3a7c 100644 --- a/includes/controller/shift_entries_controller.php +++ b/includes/controller/shift_entries_controller.php @@ -2,6 +2,7 @@ use Engelsystem\Models\User\User; use Engelsystem\ShiftSignupState; +use Illuminate\Database\Eloquent\Collection; /** * Route shift entry actions. @@ -109,7 +110,8 @@ function shift_entry_create_controller_admin($shift, $angeltype) redirect(shift_link($shift)); } - $users = User::all(); + /** @var User[]|Collection $users */ + $users = User::query()->orderBy('name')->get(); $users_select = []; foreach ($users as $user) { $users_select[$user->id] = $user->name; diff --git a/includes/pages/admin_free.php b/includes/pages/admin_free.php index 7b694659..f666b077 100644 --- a/includes/pages/admin_free.php +++ b/includes/pages/admin_free.php @@ -45,6 +45,7 @@ function admin_free() }) ->where('users_state.arrived', '=', 1) ->whereNull('Shifts.SID') + ->orderBy('users.name') ->groupBy('users.id'); if (!empty($angelType)) { diff --git a/includes/pages/admin_groups.php b/includes/pages/admin_groups.php index ca6aba72..6ba2ceaf 100644 --- a/includes/pages/admin_groups.php +++ b/includes/pages/admin_groups.php @@ -27,6 +27,7 @@ function admin_groups() FROM `GroupPrivileges` JOIN `Privileges` ON (`GroupPrivileges`.`privilege_id` = `Privileges`.`id`) WHERE `group_id`=? + ORDER BY `name` ', [$group['UID']]); $privileges_html = [];