Merge branch '146_parcours_annules' into rector/rules-symfony

This commit is contained in:
2023-10-16 17:52:06 +02:00
28 changed files with 314 additions and 16 deletions

View File

@@ -16,6 +16,7 @@ use Chill\MainBundle\Templating\Entity\BoxUtilsChillEntityRenderTrait;
use Chill\MainBundle\Templating\Entity\ChillEntityRenderInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive;
use Symfony\Contracts\Translation\TranslatorInterface;
/**
* Render closing motive.
@@ -54,6 +55,7 @@ class ClosingMotiveRender implements ChillEntityRenderInterface
private function renderStringRecursive(ClosingMotive $motive, string $existing, array $options)
{
$newExisting = $this->translatableStringHelper->localize($motive->getName());
$isCancled = $motive->getIsCanceledAccompanyingPeriod() ? $this->translator->trans('( Canceled period )') : '';
if ($motive->hasParent()) {
if ('' !== $existing) {
@@ -62,7 +64,7 @@ class ClosingMotiveRender implements ChillEntityRenderInterface
return $this->renderStringRecursive(
$motive->getParent(),
$newExisting,
$newExisting . ' ' . $isCancled,
$options
);
}
@@ -71,6 +73,6 @@ class ClosingMotiveRender implements ChillEntityRenderInterface
return $newExisting . self::SEPARATOR . $existing;
}
return $newExisting;
return $newExisting . ' ' . $isCancled;
}
}