Feature: allow filtering for users in the public form for docgen acc course - php code fix

This commit is contained in:
nobohan 2023-03-16 16:10:09 +01:00
parent 1167ff25b1
commit 3927a7f62b

View File

@ -137,6 +137,7 @@ class ListActivitiesByAccompanyingPeriodContext implements
public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array
{
$normalized = $this->accompanyingPeriodContext->contextGenerationDataNormalize($template, $entity, $data);
foreach (['myActivitiesOnly', 'myWorksOnly'] as $k) {
$normalized[$k] = null !== ($data[$k] ?? null) ? $data[$k] : false;
}
@ -191,6 +192,7 @@ class ListActivitiesByAccompanyingPeriodContext implements
if ($myWorksOnly) {
$data['course']['works'] = $this->filterWorksByCurrentUser($data['course']['works']);
}
return $data;
}