added project detail report (#2651)

- avatars via css only
- random colors for entities
- improves print view
- added colors for teams
- added color to tag
This commit is contained in:
Kevin Papst
2021-07-06 22:01:20 +02:00
committed by GitHub
parent cc6031bfde
commit 9ddb87a6fd
122 changed files with 2736 additions and 1549 deletions

View File

@@ -233,7 +233,11 @@ final class TimesheetFixtures implements TestFixture
}
$faker = Factory::create();
$user = $this->user;
$users = [$this->user];
if ($this->user === null) {
$users = $this->getAllUsers($manager);
}
$tags = $this->getTagObjectList();
foreach ($tags as $tag) {
@@ -251,6 +255,7 @@ final class TimesheetFixtures implements TestFixture
}
}
$user = $users[array_rand($users)];
$activity = $activities[array_rand($activities)];
$project = $activity->getProject();
@@ -277,6 +282,7 @@ final class TimesheetFixtures implements TestFixture
for ($i = 0; $i < $this->running; $i++) {
$activity = $activities[array_rand($activities)];
$project = $activity->getProject();
$user = $users[array_rand($users)];
if (null === $project) {
$project = $projects[array_rand($projects)];
@@ -370,6 +376,22 @@ final class TimesheetFixtures implements TestFixture
return $all;
}
/**
* @param ObjectManager $manager
* @return array<int|string, User>
*/
private function getAllUsers(ObjectManager $manager): array
{
$all = [];
/** @var User[] $entries */
$entries = $manager->getRepository(User::class)->findAll();
foreach ($entries as $temp) {
$all[$temp->getId()] = $temp;
}
return $all;
}
/**
* @param User $user
* @param Activity $activity