mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
continue context for evaluations
This commit is contained in:
parent
2d319fcc42
commit
29134f0f11
@ -44,7 +44,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
* @ORM\Column(type="text", nullable=false, options={"default": ""})
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"read", "docgen:read"})
|
||||||
* @Serializer\Groups({"write"})
|
* @Serializer\Groups({"write"})
|
||||||
* @Serializer\Groups({"accompanying_period_work_evaluation:create"})
|
* @Serializer\Groups({"accompanying_period_work_evaluation:create"})
|
||||||
*/
|
*/
|
||||||
@ -52,7 +52,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
|
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"read", "docgen:read"})
|
||||||
*/
|
*/
|
||||||
private ?DateTimeImmutable $createdAt = null;
|
private ?DateTimeImmutable $createdAt = null;
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
|
|||||||
* @ORM\ManyToOne(
|
* @ORM\ManyToOne(
|
||||||
* targetEntity=User::class
|
* targetEntity=User::class
|
||||||
* )
|
* )
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"read", "docgen:read"})
|
||||||
*/
|
*/
|
||||||
private ?User $createdBy = null;
|
private ?User $createdBy = null;
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
|
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"read", "docgen:read"})
|
||||||
* @Serializer\Groups({"write"})
|
* @Serializer\Groups({"write"})
|
||||||
* @Serializer\Groups({"accompanying_period_work_evaluation:create"})
|
* @Serializer\Groups({"accompanying_period_work_evaluation:create"})
|
||||||
*/
|
*/
|
||||||
@ -86,7 +86,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
|
|||||||
* @ORM\ManyToOne(
|
* @ORM\ManyToOne(
|
||||||
* targetEntity=Evaluation::class
|
* targetEntity=Evaluation::class
|
||||||
* )
|
* )
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"read", "docgen:read"})
|
||||||
* @Serializer\Groups({"accompanying_period_work_evaluation:create"})
|
* @Serializer\Groups({"accompanying_period_work_evaluation:create"})
|
||||||
*/
|
*/
|
||||||
private ?Evaluation $evaluation = null;
|
private ?Evaluation $evaluation = null;
|
||||||
@ -95,7 +95,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
|
|||||||
* @ORM\Id
|
* @ORM\Id
|
||||||
* @ORM\GeneratedValue
|
* @ORM\GeneratedValue
|
||||||
* @ORM\Column(type="integer")
|
* @ORM\Column(type="integer")
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"read", "docgen:read"})
|
||||||
*/
|
*/
|
||||||
private ?int $id = null;
|
private ?int $id = null;
|
||||||
|
|
||||||
@ -116,14 +116,14 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
|
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"read", "docgen:read"})
|
||||||
* @Serializer\Groups({"accompanying_period_work_evaluation:create"})
|
* @Serializer\Groups({"accompanying_period_work_evaluation:create"})
|
||||||
*/
|
*/
|
||||||
private ?DateTimeImmutable $maxDate = null;
|
private ?DateTimeImmutable $maxDate = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
|
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"read", "docgen:read"})
|
||||||
* @Serializer\Groups({"write"})
|
* @Serializer\Groups({"write"})
|
||||||
* @Serializer\Groups({"accompanying_period_work_evaluation:create"})
|
* @Serializer\Groups({"accompanying_period_work_evaluation:create"})
|
||||||
*/
|
*/
|
||||||
@ -131,7 +131,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
|
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"read", "docgen:read"})
|
||||||
*/
|
*/
|
||||||
private ?DateTimeImmutable $updatedAt = null;
|
private ?DateTimeImmutable $updatedAt = null;
|
||||||
|
|
||||||
@ -139,7 +139,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
|
|||||||
* @ORM\ManyToOne(
|
* @ORM\ManyToOne(
|
||||||
* targetEntity=User::class
|
* targetEntity=User::class
|
||||||
* )
|
* )
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"read", "docgen:read"})
|
||||||
*/
|
*/
|
||||||
private ?User $updatedBy = null;
|
private ?User $updatedBy = null;
|
||||||
|
|
||||||
@ -244,6 +244,18 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU
|
|||||||
return $this->warningInterval;
|
return $this->warningInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Serializer\Groups({"docgen:read"})
|
||||||
|
*/
|
||||||
|
public function getWarningDate(): ?DateTimeImmutable
|
||||||
|
{
|
||||||
|
if (null === $this->getWarningDate() || null === $this->getWarningInterval()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->getWarningDate()->sub($this->getWarningInterval());
|
||||||
|
}
|
||||||
|
|
||||||
public function removeDocument(AccompanyingPeriodWorkEvaluationDocument $document): self
|
public function removeDocument(AccompanyingPeriodWorkEvaluationDocument $document): self
|
||||||
{
|
{
|
||||||
$this->documents->removeElement($document);
|
$this->documents->removeElement($document);
|
||||||
|
@ -28,21 +28,21 @@ class Evaluation
|
|||||||
* @ORM\Column(type="dateinterval", nullable=true, options={"default": null})
|
* @ORM\Column(type="dateinterval", nullable=true, options={"default": null})
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"read"})
|
||||||
*/
|
*/
|
||||||
private $delay;
|
private ?\DateInterval $delay = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Id
|
* @ORM\Id
|
||||||
* @ORM\GeneratedValue
|
* @ORM\GeneratedValue
|
||||||
* @ORM\Column(type="integer")
|
* @ORM\Column(type="integer")
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"read", "docgen:read"})
|
||||||
*/
|
*/
|
||||||
private $id;
|
private ?int $id = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="dateinterval", nullable=true, options={"default": null})
|
* @ORM\Column(type="dateinterval", nullable=true, options={"default": null})
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"read"})
|
||||||
*/
|
*/
|
||||||
private $notificationDelay;
|
private ?\DateInterval $notificationDelay = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\ManyToOne(
|
* @ORM\ManyToOne(
|
||||||
@ -50,13 +50,13 @@ class Evaluation
|
|||||||
* inversedBy="evaluations"
|
* inversedBy="evaluations"
|
||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
private $socialAction;
|
private ?SocialAction $socialAction = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="json")
|
* @ORM\Column(type="json")
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"read", "docgen:read"})
|
||||||
*/
|
*/
|
||||||
private $title = [];
|
private array $title = [];
|
||||||
|
|
||||||
public function getDelay(): ?DateInterval
|
public function getDelay(): ?DateInterval
|
||||||
{
|
{
|
||||||
|
@ -23,6 +23,8 @@ use Chill\PersonBundle\Repository\SocialWork\EvaluationRepository;
|
|||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||||
|
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||||
|
|
||||||
class AccompanyingPeriodWorkEvaluationContext implements
|
class AccompanyingPeriodWorkEvaluationContext implements
|
||||||
DocGeneratorContextWithAdminFormInterface,
|
DocGeneratorContextWithAdminFormInterface,
|
||||||
@ -34,17 +36,21 @@ class AccompanyingPeriodWorkEvaluationContext implements
|
|||||||
|
|
||||||
private EvaluationRepository $evaluationRepository;
|
private EvaluationRepository $evaluationRepository;
|
||||||
|
|
||||||
|
private NormalizerInterface $normalizer;
|
||||||
|
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper;
|
private TranslatableStringHelperInterface $translatableStringHelper;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
AccompanyingPeriodWorkContext $accompanyingPeriodWorkContext,
|
AccompanyingPeriodWorkContext $accompanyingPeriodWorkContext,
|
||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em,
|
||||||
EvaluationRepository $evaluationRepository,
|
EvaluationRepository $evaluationRepository,
|
||||||
|
NormalizerInterface $normalizer,
|
||||||
TranslatableStringHelperInterface $translatableStringHelper
|
TranslatableStringHelperInterface $translatableStringHelper
|
||||||
) {
|
) {
|
||||||
$this->accompanyingPeriodWorkContext = $accompanyingPeriodWorkContext;
|
$this->accompanyingPeriodWorkContext = $accompanyingPeriodWorkContext;
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->evaluationRepository = $evaluationRepository;
|
$this->evaluationRepository = $evaluationRepository;
|
||||||
|
$this->normalizer = $normalizer;
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
$this->translatableStringHelper = $translatableStringHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,14 +98,32 @@ class AccompanyingPeriodWorkEvaluationContext implements
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param AccompanyingPeriodWorkEvaluation $entity
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void
|
public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void
|
||||||
{
|
{
|
||||||
// TODO: Implement buildPublicForm() method.
|
$this->accompanyingPeriodWorkContext->buildPublicForm($builder, $template, $entity->getAccompanyingPeriodWork());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param AccompanyingPeriodWorkEvaluation $entity
|
||||||
|
*/
|
||||||
public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array
|
public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array
|
||||||
{
|
{
|
||||||
// TODO: Implement getData() method.
|
$data = $this->accompanyingPeriodWorkContext
|
||||||
|
->getData($template, $entity->getAccompanyingPeriodWork(), $contextGenerationData);
|
||||||
|
$data['evaluation'] = $this->normalizer->normalize(
|
||||||
|
$entity,
|
||||||
|
'docgen',
|
||||||
|
[
|
||||||
|
'docgen:expect' => AccompanyingPeriodWorkEvaluation::class,
|
||||||
|
AbstractNormalizer::GROUPS => ['docgen:read'],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDescription(): string
|
public function getDescription(): string
|
||||||
@ -127,9 +151,13 @@ class AccompanyingPeriodWorkEvaluationContext implements
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param AccompanyingPeriodWorkEvaluation $entity
|
||||||
|
*/
|
||||||
public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool
|
public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool
|
||||||
{
|
{
|
||||||
// TODO: Implement hasPublicForm() method.
|
return $this->accompanyingPeriodWorkContext
|
||||||
|
->hasPublicForm($template, $entity->getAccompanyingPeriodWork());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
|
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user