mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix cs
This commit is contained in:
parent
2b257cc402
commit
18836f312a
@ -13,7 +13,6 @@ namespace Chill\DocStoreBundle\Workflow;
|
||||
|
||||
use Chill\DocStoreBundle\Entity\AccompanyingCourseDocument;
|
||||
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||
use Chill\MainBundle\Workflow\EntityWorkflowHandlerInterface;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
@ -59,8 +58,7 @@ class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandler
|
||||
$doc = $this->getRelatedEntity($entityWorkflow);
|
||||
|
||||
return $this->translator->trans('workflow.Document (n°%doc%)', ['%doc%' => $entityWorkflow->getRelatedEntityId()])
|
||||
.' - '.$doc->getTitle()
|
||||
;
|
||||
. ' - ' . $doc->getTitle();
|
||||
}
|
||||
|
||||
public function getRelatedEntity(EntityWorkflow $entityWorkflow): ?AccompanyingCourseDocument
|
||||
|
@ -62,12 +62,8 @@ class WorkflowTwigExtensionRuntime implements RuntimeExtensionInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Environment $environment
|
||||
* @param string $relatedEntityClass
|
||||
* @param int $relatedEntityId
|
||||
* @param array $options
|
||||
* @param array{relatedEntityClass: string, relatedEntityId: int} $supplementaryRelated
|
||||
* @return string
|
||||
*
|
||||
* @throws \Symfony\Component\Serializer\Exception\ExceptionInterface
|
||||
* @throws \Twig\Error\LoaderError
|
||||
* @throws \Twig\Error\RuntimeError
|
||||
@ -75,10 +71,10 @@ class WorkflowTwigExtensionRuntime implements RuntimeExtensionInterface
|
||||
*/
|
||||
public function listWorkflows(Environment $environment, string $relatedEntityClass, int $relatedEntityId, array $options = [], array $supplementaryRelated = []): string
|
||||
{
|
||||
list($blankEntityWorkflow, $workflowsAvailable, $entityWorkflows) = $this->getWorkflowsForRelated($relatedEntityClass, $relatedEntityId);
|
||||
[$blankEntityWorkflow, $workflowsAvailable, $entityWorkflows] = $this->getWorkflowsForRelated($relatedEntityClass, $relatedEntityId);
|
||||
|
||||
foreach ($supplementaryRelated as $supplementary) {
|
||||
list($supplementaryBlankEntityWorkflow, $supplementaryWorkflowsAvailable, $supplementaryEntityWorkflows)
|
||||
[$supplementaryBlankEntityWorkflow, $supplementaryWorkflowsAvailable, $supplementaryEntityWorkflows]
|
||||
= $this->getWorkflowsForRelated($supplementary['relatedEntityClass'], $supplementary['relatedEntityId']);
|
||||
|
||||
$entityWorkflows = array_merge($entityWorkflows, $supplementaryEntityWorkflows);
|
||||
@ -94,8 +90,6 @@ class WorkflowTwigExtensionRuntime implements RuntimeExtensionInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $relatedEntityClass
|
||||
* @param int $relatedEntityId
|
||||
* @return array where keys are: {0: blankWorkflow, 1: entityWorkflows, 2: workflowList}
|
||||
*/
|
||||
private function getWorkflowsForRelated(string $relatedEntityClass, int $relatedEntityId): array
|
||||
@ -112,7 +106,8 @@ class WorkflowTwigExtensionRuntime implements RuntimeExtensionInterface
|
||||
$blankEntityWorkflow,
|
||||
$workflowsList,
|
||||
$this->repository->findBy(
|
||||
['relatedEntityClass' => $relatedEntityClass, 'relatedEntityId' => $relatedEntityId]),
|
||||
['relatedEntityClass' => $relatedEntityClass, 'relatedEntityId' => $relatedEntityId]
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -23,10 +23,10 @@ class AccompanyingPeriodWorkEvaluationWorkflowHandler implements EntityWorkflowH
|
||||
{
|
||||
private AccompanyingPeriodWorkEvaluationRepository $repository;
|
||||
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
public function __construct(
|
||||
AccompanyingPeriodWorkEvaluationRepository $repository,
|
||||
TranslatableStringHelperInterface $translatableStringHelper,
|
||||
@ -51,8 +51,9 @@ class AccompanyingPeriodWorkEvaluationWorkflowHandler implements EntityWorkflowH
|
||||
$evaluation = $this->getRelatedEntity($entityWorkflow);
|
||||
|
||||
return $this->translator->trans(
|
||||
'workflow.Evaluation (n°%eval%)', ['%eval%' => $entityWorkflow->getRelatedEntityId()]
|
||||
).' - '.$this->translatableStringHelper->localize($evaluation->getEvaluation()->getTitle());
|
||||
'workflow.Evaluation (n°%eval%)',
|
||||
['%eval%' => $entityWorkflow->getRelatedEntityId()]
|
||||
) . ' - ' . $this->translatableStringHelper->localize($evaluation->getEvaluation()->getTitle());
|
||||
}
|
||||
|
||||
public function getRelatedEntity(EntityWorkflow $entityWorkflow): ?AccompanyingPeriodWorkEvaluation
|
||||
|
@ -22,10 +22,10 @@ class AccompanyingPeriodWorkWorkflowHandler implements EntityWorkflowHandlerInte
|
||||
{
|
||||
private AccompanyingPeriodWorkRepository $repository;
|
||||
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||
|
||||
private TranslatorInterface $translator;
|
||||
|
||||
public function __construct(
|
||||
AccompanyingPeriodWorkRepository $repository,
|
||||
TranslatableStringHelperInterface $translatableStringHelper,
|
||||
@ -50,7 +50,7 @@ class AccompanyingPeriodWorkWorkflowHandler implements EntityWorkflowHandlerInte
|
||||
|
||||
return
|
||||
$this->translator->trans('workflow.Work (n°%w%)', ['%w%' => $entityWorkflow->getRelatedEntityId()])
|
||||
.' - '.$this->translatableStringHelper->localize($work->getSocialAction()->getTitle());
|
||||
. ' - ' . $this->translatableStringHelper->localize($work->getSocialAction()->getTitle());
|
||||
}
|
||||
|
||||
public function getRelatedEntity(EntityWorkflow $entityWorkflow): ?AccompanyingPeriodWork
|
||||
|
Loading…
x
Reference in New Issue
Block a user