Sort Angels Alphabetical

closes #541 (Shift Signup: Sort Angels Alphabetical)
main
Igor Scheller 6 years ago
parent 8c5b52aa11
commit d214525e24

@ -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;

@ -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)) {

@ -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 = [];

Loading…
Cancel
Save