feat: improved teamer status label in overview
This commit is contained in:
+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