Skip to content

Commit

Permalink
Merge pull request #72 from kiloutyg/71-differentiate-between-closer-…
Browse files Browse the repository at this point in the history
…modifier-and-archiver-closer-and-archiver-needs-to-also-be-simple-strings-but-needs-to-be-request-the-same-way-as-modifier

added both archiver and closer to differentiate easily
  • Loading branch information
kiloutyg authored Mar 19, 2024
2 parents d2e0ea2 + ca56a4d commit 90c240e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
25 changes: 20 additions & 5 deletions src/Entity/EFNC.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()
{
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
}
4 changes: 2 additions & 2 deletions src/Service/EntityDeletionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
</div>
{% endif %}

Expand Down

0 comments on commit 90c240e

Please sign in to comment.