diff --git a/app/model/Export/ExportService.php b/app/model/Export/ExportService.php index ba2593223e..bd5a244653 100644 --- a/app/model/Export/ExportService.php +++ b/app/model/Export/ExportService.php @@ -79,6 +79,7 @@ public function getNewPage(): string public function getParticipants(int $aid, string $type = EventType::GENERAL, string $participantType = ParticipatingPerson::PARTICIPANT): string { + $title = 'Seznam účastníků'; if ($type === EventType::CAMP) { $templateFile = __DIR__ . '/templates/participantCamp.latte'; $camp = $this->queryBus->handle(new CampQuery(new SkautisCampId($aid))); @@ -92,14 +93,17 @@ public function getParticipants(int $aid, string $type = EventType::GENERAL, str assert($education instanceof Education); $displayName = $education->getDisplayName(); $unitId = $education->getUnitId(); - $list = $participantType === ParticipatingPerson::INSTRUCTOR - ? array_map( + if ($participantType === ParticipatingPerson::INSTRUCTOR) { + $title = 'Seznam členů týmu'; + $list = array_map( function (Instructor $instructor): InstructorEnriched { return $this->queryBus->handle(new EducationInstructorEnrichmentQuery($instructor)); }, $this->queryBus->handle(new EducationInstructorListQuery($education->getId())), - ) - : $this->queryBus->handle(new EducationParticipantListQuery($education->getId())); + ); + } else { + $list = $this->queryBus->handle(new EducationParticipantListQuery($education->getId())); + } } else { $templateFile = __DIR__ . '/templates/participant.latte'; $event = $this->queryBus->handle(new EventQuery(new SkautisEventId($aid))); @@ -110,6 +114,7 @@ function (Instructor $instructor): InstructorEnriched { } return $this->templateFactory->create($templateFile, [ + 'title' => $title, 'list' => $list, 'displayName' => $displayName, 'unitFullNameWithAddress' => $this->units->getOfficialUnit($unitId->toInt())->getFullDisplayNameWithAddress(), diff --git a/app/model/Export/templates/participantEducation.latte b/app/model/Export/templates/participantEducation.latte index ae8eb25b62..731df8d197 100644 --- a/app/model/Export/templates/participantEducation.latte +++ b/app/model/Export/templates/participantEducation.latte @@ -28,7 +28,7 @@ td {
{$unitFullNameWithAddress}
-

Seznam účastníků - {$displayName}

+

{$title} - {$displayName}