Commit cb3312a3 by Yvon

5932-add-quartier-to-address-section

parent 7d1fb02a
......@@ -162,6 +162,9 @@ class AdherentAdmin extends AbstractAdmin
'with_latlon' => false,
'with_subterritory' =>
$this->getConfigurationPool()->getContainer()->getParameter('tav_env')
&& $this->getConfigurationPool()->getContainer()->getParameter('household_based_allowance'),
'with_quartier' =>
$this->getConfigurationPool()->getContainer()->getParameter('tav_env')
&& $this->getConfigurationPool()->getContainer()->getParameter('household_based_allowance')
])
->end()
......
......@@ -73,7 +73,16 @@ class Geoloc
* @ORM\JoinColumn(name="subterritory_id", referencedColumnName="id", nullable=true)
*/
private $subterritory;
/**
* @var string|null
*
* @ORM\Column(name="quartier", type="string", length=255, nullable=true)
* @Groups({"read", "write"})
*/
private $quartier;
public function getId()
{
return $this->id;
......@@ -199,6 +208,26 @@ class Geoloc
return $this;
}
/**
* @return string|null
*/
public function getQuartier(): ?string
{
return $this->quartier;
}
/**
* @param string|null $quartier
*
* @return Geoloc
*/
public function setQuartier(?string $quartier)
{
$this->quartier = $quartier;
return $this;
}
public function __toString(): string
{
return (!empty($this->adresse) ? $this->adresse : '') . ' ' . (!empty($this->cpostal) ? $this->cpostal : '') . ' ' . (!empty($this->ville) ? $this->ville : '');
......
......@@ -73,6 +73,13 @@ class GeolocFormType extends AbstractType
])
;
}
if (true === $options['with_quartier']) {
$builder
->add('quartier', TextType::class, [
'required' => false,
])
;
}
if (true === $options['with_subterritory']) {
$builder
->add('subterritory', EntityType::class, [
......@@ -94,7 +101,8 @@ class GeolocFormType extends AbstractType
'data_class' => Geoloc::class,
'with_geoloc' => true,
'with_latlon' => true,
'with_subterritory' => false
'with_subterritory' => false,
'with_quartier' => false
]);
}
......
<?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 Version20240311161651 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 geoloc ADD quartier VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:personal_data)\'');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE geoloc DROP quartier');
$this->addSql('ALTER TABLE prestataire CHANGE iban iban LONGTEXT CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_general_ci` COMMENT \'(DC2Type:personal_data)\'');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment