✨ feat(email): Affiche les emails du client avec stockage et date de création.
🐛 fix(CustomerDnsEmail): Ajoute la propriété `isDeleted` à l'entité.
This commit is contained in:
32
migrations/Version20250927112447.php
Normal file
32
migrations/Version20250927112447.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20250927112447 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE customer_dns_email ADD is_deleted BOOLEAN NOT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE SCHEMA public');
|
||||
$this->addSql('ALTER TABLE customer_dns_email DROP is_deleted');
|
||||
}
|
||||
}
|
||||
@@ -301,6 +301,7 @@ class CustomerController extends AbstractController
|
||||
$nddEmail->setEmail($mailBox->local_part);
|
||||
$nddEmail->setDns($customerNdd);
|
||||
$nddEmail->setIsBilling(true);
|
||||
$nddEmail->setIsDeleted(false);
|
||||
$nddEmail->setCreateAt(\DateTimeImmutable::createFromFormat('Y-m-d H:i:s',$mailBox->created));
|
||||
}
|
||||
$nddEmail->setStorage($mailBox->quota);
|
||||
|
||||
@@ -31,6 +31,9 @@ class CustomerDnsEmail
|
||||
#[ORM\Column]
|
||||
private ?bool $isBilling = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?bool $isDeleted = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
@@ -107,4 +110,16 @@ class CustomerDnsEmail
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isDeleted(): ?bool
|
||||
{
|
||||
return $this->isDeleted;
|
||||
}
|
||||
|
||||
public function setIsDeleted(bool $isDeleted): static
|
||||
{
|
||||
$this->isDeleted = $isDeleted;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,21 @@ class TwigOrderExtensions extends AbstractExtension
|
||||
{
|
||||
return [
|
||||
new TwigFilter('totalOrder',[$this,'totalOrder']),
|
||||
new TwigFilter('skFormat',[$this,'skFormat']),
|
||||
];
|
||||
}
|
||||
|
||||
public function skFormat(string $bytes)
|
||||
{
|
||||
$units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'];
|
||||
$i = 0;
|
||||
while ($bytes >= 1024 && $i < count($units) - 1) {
|
||||
$bytes /= 1024;
|
||||
$i++;
|
||||
}
|
||||
return round($bytes, ($i > 0 ? 2 : 0)) . ' ' . $units[$i];
|
||||
}
|
||||
|
||||
public function totalOrder($object): float|int
|
||||
{
|
||||
if($object instanceof CustomerAdvertPayment) {
|
||||
|
||||
@@ -5,12 +5,25 @@
|
||||
<th scope="col" class="px-6 py-3 text-left text-xs font-semibold uppercase tracking-wider">
|
||||
Domaine
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3 text-left text-xs font-semibold uppercase tracking-wider">
|
||||
Stockage
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3 text-left text-xs font-semibold uppercase tracking-wider">
|
||||
Date de création
|
||||
</th>
|
||||
<th scope="col" class="px-6 py-3 text-left text-xs font-semibold uppercase tracking-wider">
|
||||
Actions
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-200 dark:divide-gray-700">
|
||||
{% for email in nddEmails %}
|
||||
<tr class="hover:bg-gray-100 dark:hover:bg-gray-700">
|
||||
<td class="px-6 py-4 whitespace-nowrap font-medium text-blue-600 dark:text-blue-400">{{ email.email }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap font-medium text-blue-600 dark:text-blue-400"><a href="mailto:{{ email.email }}@{{ email.dns.ndd }}">{{ email.email }}@{{ email.dns.ndd }}</a></td>
|
||||
<td class="px-6 py-4 whitespace-nowrap font-medium text-blue-600 dark:text-blue-400">{{ email.storage|skFormat }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap font-medium text-blue-600 dark:text-blue-400">{{ email.createAt|date('d/m/Y') }}</td>
|
||||
<td class="px-6 py-4 whitespace-nowrap font-medium text-blue-600 dark:text-blue-400">
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user