Fixed: [Activity] fix appearance of reason list in Activity form

Fix https://gitlab.com/Chill-Projet/chill-bundles/-/issues/44
This commit is contained in:
2023-01-13 16:15:05 +01:00
parent 25dd65fbd8
commit 164beb3ca9
5 changed files with 30 additions and 43 deletions

View File

@@ -43,6 +43,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Role\Role;
use Symfony\Component\Serializer\SerializerInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
use function array_key_exists;
final class ActivityController extends AbstractController
@@ -73,6 +74,8 @@ final class ActivityController extends AbstractController
private ThirdPartyRepository $thirdPartyRepository;
private TranslatorInterface $translator;
private UserRepositoryInterface $userRepository;
public function __construct(
@@ -89,7 +92,8 @@ final class ActivityController extends AbstractController
LoggerInterface $logger,
SerializerInterface $serializer,
UserRepositoryInterface $userRepository,
CenterResolverManagerInterface $centerResolver
CenterResolverManagerInterface $centerResolver,
TranslatorInterface $translator
) {
$this->activityACLAwareRepository = $activityACLAwareRepository;
$this->activityTypeRepository = $activityTypeRepository;
@@ -105,6 +109,7 @@ final class ActivityController extends AbstractController
$this->serializer = $serializer;
$this->userRepository = $userRepository;
$this->centerResolver = $centerResolver;
$this->translator = $translator;
}
/**
@@ -160,7 +165,7 @@ final class ActivityController extends AbstractController
$this->entityManager->remove($activity);
$this->entityManager->flush();
$this->addFlash('success', $this->get('translator')
$this->addFlash('success', $this->translator
->trans('The activity has been successfully removed.'));
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);
@@ -245,7 +250,7 @@ final class ActivityController extends AbstractController
);
}
$this->addFlash('success', $this->get('translator')->trans('Success : activity updated!'));
$this->addFlash('success', $this->translator->trans('Success : activity updated!'));
return $this->redirectToRoute('chill_activity_activity_show', $params);
}
@@ -473,7 +478,7 @@ final class ActivityController extends AbstractController
);
}
$this->addFlash('success', $this->get('translator')->trans('Success : activity created!'));
$this->addFlash('success', $this->translator->trans('Success : activity created!'));
$params = $this->buildParamsToUrl($person, $accompanyingPeriod);