issue641: don't list all children if parent is chosen

add mechanism to differenciate string in export
This commit is contained in:
Mathieu Jaumotte 2022-10-16 19:35:18 +02:00
parent ccea6dd95c
commit 6b1155b9d8

View File

@ -85,7 +85,8 @@ class SocialIssueFilter implements FilterInterface
if (null === $si) {
$issues[] = $this->translator->trans('Not given');
} else {
$issues[] = $this->socialIssueRender->renderString($si, []);
$issues[] = $this->renderIssue($si);
}
}
@ -127,4 +128,17 @@ class SocialIssueFilter implements FilterInterface
array_intersect_key($array, $unique_ids)
);
}
private function renderIssue(SocialIssue $si): string
{
$render_str = $this->socialIssueRender->renderString($si, []);
if (!$si->hasParent()) {
if (count($si->getDescendants()) > 0) {
return $render_str . " (et dérivés)";
}
}
return $render_str;
}
}