feat: improved teamer status label in overview
This commit is contained in:
1 parent
8030f0b050
commit
f596290960
3 files changed
+22
-4
No files matched your search
+20
-2
@@ -25,9 +25,27 @@ class AppRuntime implements RuntimeExtensionInterface
|
||||
) {
|
||||
}
|
||||
|
||||
public function teamerStatusLabel(string $status): string
|
||||
public function teamerStatusLabel(Teamer $teamer): string
|
||||
{
|
||||
if (Teamer::STATUS_NEW === $status) {
|
||||
$labelItems = [];
|
||||
|
||||
if ($teamer->getUser()->hasRole('ROLE_ADMIN')) {
|
||||
$labelItems[] = 'Admin';
|
||||
}
|
||||
|
||||
if ($teamer->getUser()->hasRole('ROLE_MANAGER')) {
|
||||
$labelItems[] = 'Reisemanagement';
|
||||
}
|
||||
|
||||
if ($teamer->getUser()->hasRole('ROLE_HOUSE_MANAGER')) {
|
||||
$labelItems[] = 'Hausleitung';
|
||||
}
|
||||
|
||||
if (0 < count($labelItems)) {
|
||||
return implode(', ', $labelItems);
|
||||
}
|
||||
|
||||
if (Teamer::STATUS_NEW === $teamer->getStatus()) {
|
||||
return 'Neuteamer:in';
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user