From ca56a4d3242996a4b4110941f7fc892ddfd960d7 Mon Sep 17 00:00:00 2001 From: SFDKHISSI Date: Tue, 19 Mar 2024 09:37:57 +0100 Subject: [PATCH] added both archiver and closer to differentiate easily --- src/Entity/EFNC.php | 25 +++++++++++++++---- src/Service/EntityDeletionService.php | 4 +-- .../modification/form_modification.html.twig | 8 +++--- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/Entity/EFNC.php b/src/Entity/EFNC.php index 9fd41fc..81a3021 100755 --- a/src/Entity/EFNC.php +++ b/src/Entity/EFNC.php @@ -63,7 +63,7 @@ class EFNC private ?\DateTimeInterface $ClosedDate = null; #[ORM\Column(length: 255, nullable: true)] - private ?string $PilotVisa = null; + private ?string $Archiver = null; #[ORM\Column(type: Types::TIME_MUTABLE, nullable: true)] private ?\DateTimeInterface $DetectionTime = null; @@ -101,6 +101,9 @@ class EFNC #[ORM\Column(type: Types::TEXT, nullable: true)] private ?string $archivingCommentary = null; + #[ORM\Column(length: 255, nullable: true)] + private ?string $closer = null; + public function __construct() { @@ -383,14 +386,14 @@ public function setClosedDate(\DateTimeInterface $ClosedDate): static return $this; } - public function getPilotVisa(): ?string + public function getArchiver(): ?string { - return $this->PilotVisa; + return $this->Archiver; } - public function setPilotVisa(?string $PilotVisa): static + public function setArchiver(?string $Archiver): static { - $this->PilotVisa = $PilotVisa; + $this->Archiver = $Archiver; return $this; } @@ -553,4 +556,16 @@ public function setArchivingCommentary(?string $archivingCommentary): static return $this; } + + public function getCloser(): ?string + { + return $this->closer; + } + + public function setCloser(?string $closer): static + { + $this->closer = $closer; + + return $this; + } } diff --git a/src/Service/EntityDeletionService.php b/src/Service/EntityDeletionService.php index 6c5bcd3..c03e9db 100755 --- a/src/Service/EntityDeletionService.php +++ b/src/Service/EntityDeletionService.php @@ -141,7 +141,7 @@ public function archivedEntity(string $entityType, int $id, string $commentary $this->em->remove($entity); } if ($entityType === 'efnc') { - $entity->setLastModifier($user); + $entity->setArchiver($user); $entity->setArchivingCommentary($commentary); $entity->setArchived(true); } @@ -553,7 +553,7 @@ public function closeEntity(string $entityType, int $id, string $commentary = nu } if ($entityType === 'efnc') { - $entity->setLastModifier($user); + $entity->setCloser($user); $entity->setArchived(true); $entity->setStatus(true); } diff --git a/templates/services/efnc/modification/form_modification.html.twig b/templates/services/efnc/modification/form_modification.html.twig index 1d6303a..22274f5 100755 --- a/templates/services/efnc/modification/form_modification.html.twig +++ b/templates/services/efnc/modification/form_modification.html.twig @@ -244,8 +244,8 @@ class="d-grid gap-2 d-md-flex justify-content-md-center mt-2 mb-2 text-white"> Archivage effectué par - {{ EFNC.LastModifier|capitalize|split('.')|first }} - {{ EFNC.LastModifier|upper|split('.')|last }} + {{ EFNC.Archiver|capitalize|split('.')|first }} + {{ EFNC.Archiver|upper|split('.')|last }} avec le commentaire suivant : {{ EFNC.archivingCommentary }} @@ -255,8 +255,8 @@ class="d-grid gap-2 d-md-flex justify-content-md-center mt-2 mb-2 text-white"> Cloture effectué par - {{ EFNC.LastModifier|capitalize|split('.')|first }} - {{ EFNC.LastModifier|upper|split('.')|last }} + {{ EFNC.Closer|capitalize|split('.')|first }} + {{ EFNC.Closer|upper|split('.')|last }} {% endif %}