add user angeltype info in shift entries (#1262)

This commit is contained in:
xuwhite 2023-11-24 15:11:36 +01:00 committed by GitHub
parent d8310ed6e7
commit fd56966435
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -113,10 +113,14 @@ function shift_entry_create_controller_admin(Shift $shift, ?AngelType $angeltype
}
/** @var User[]|Collection $users */
$users = User::query()->orderBy('name')->get();
$users = User::with('userAngelTypes')->orderBy('name')->get();
$users_select = [];
foreach ($users as $user) {
$users_select[$user->id] = $user->displayName;
$name = $user->displayName;
if ($user->userAngelTypes->where('id', $angeltype->id)->isEmpty()) {
$name = __('%s (not "%s")', [$name, $angeltype->name]);
}
$users_select[$user->id] = $name;
}
$angeltypes_select = $angeltypes->pluck('name', 'id')->toArray();

View File

@ -185,6 +185,9 @@ msgstr "%s bearbeiten"
msgid "Team %s"
msgstr "Team %s"
msgid "%s (not \"%s\")"
msgstr "%s (kein \"%s\")"
msgid "view"
msgstr "ansehen"