Sort Angels Alphabetical

closes #541 (Shift Signup: Sort Angels Alphabetical)
This commit is contained in:
Igor Scheller 2018-12-25 10:25:32 +01:00
parent 8c5b52aa11
commit d214525e24
3 changed files with 5 additions and 1 deletions

View File

@ -2,6 +2,7 @@
use Engelsystem\Models\User\User; use Engelsystem\Models\User\User;
use Engelsystem\ShiftSignupState; use Engelsystem\ShiftSignupState;
use Illuminate\Database\Eloquent\Collection;
/** /**
* Route shift entry actions. * Route shift entry actions.
@ -109,7 +110,8 @@ function shift_entry_create_controller_admin($shift, $angeltype)
redirect(shift_link($shift)); redirect(shift_link($shift));
} }
$users = User::all(); /** @var User[]|Collection $users */
$users = User::query()->orderBy('name')->get();
$users_select = []; $users_select = [];
foreach ($users as $user) { foreach ($users as $user) {
$users_select[$user->id] = $user->name; $users_select[$user->id] = $user->name;

View File

@ -45,6 +45,7 @@ function admin_free()
}) })
->where('users_state.arrived', '=', 1) ->where('users_state.arrived', '=', 1)
->whereNull('Shifts.SID') ->whereNull('Shifts.SID')
->orderBy('users.name')
->groupBy('users.id'); ->groupBy('users.id');
if (!empty($angelType)) { if (!empty($angelType)) {

View File

@ -27,6 +27,7 @@ function admin_groups()
FROM `GroupPrivileges` FROM `GroupPrivileges`
JOIN `Privileges` ON (`GroupPrivileges`.`privilege_id` = `Privileges`.`id`) JOIN `Privileges` ON (`GroupPrivileges`.`privilege_id` = `Privileges`.`id`)
WHERE `group_id`=? WHERE `group_id`=?
ORDER BY `name`
', [$group['UID']]); ', [$group['UID']]);
$privileges_html = []; $privileges_html = [];