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