diff --git a/src/Entity/Issue.php b/src/Entity/Issue.php index 45b8bae..d9c29e5 100644 --- a/src/Entity/Issue.php +++ b/src/Entity/Issue.php @@ -31,7 +31,7 @@ class Issue private int $rowissue = 0; #[ORM\Column(nullable: true)] - private string $color = ''; + private ?string $color = null; #[ORM\ManyToOne(targetEntity: Project::class, inversedBy: 'issues')] #[ORM\JoinColumn(nullable: false)] @@ -130,7 +130,9 @@ class Issue public function getColor(): ?string { - return $this->rowsprint; + if($this->color) return $this->color; + elseif($this->parent) return $this->parent->getColor(); + else return null; } public function setColor(?string $color): static diff --git a/src/Form/Type/SelbgType.php b/src/Form/Type/SelbgType.php index fc080f7..5486f78 100644 --- a/src/Form/Type/SelbgType.php +++ b/src/Form/Type/SelbgType.php @@ -6,15 +6,16 @@ use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\OptionsResolver\OptionsResolver; + class SelbgType extends AbstractType { public function configureOptions(OptionsResolver $resolver): void { $choices = $this->loadCssClasses(); - + // clef => valeur $choices = array_combine($choices, $choices); - + $resolver->setDefaults([ 'choices' => $choices, 'choice_attr' => function ($choice, $key, $value) { diff --git a/templates/issue/edit.html.twig b/templates/issue/edit.html.twig index 9f3a02a..cda0557 100644 --- a/templates/issue/edit.html.twig +++ b/templates/issue/edit.html.twig @@ -6,7 +6,7 @@ {% endblock %} {% block title %} -Modification Issue = {{title}} + = Modification Issue = {{title}} {% endblock %} {% block body %} @@ -27,6 +27,7 @@ Modification Issue = {{title}}