Commit 7d1fb02a by Yvon

5895-add-territory-to-address-section

parent 7ba7843f
......@@ -85,13 +85,12 @@ Création des tables et des contraintes :
Charger les fixtures standards :
Pour une instance non TAV :
Pour une instance non SSA :
**$ php bin/console hautelook:fixtures:load --purge-with-truncate --env=pro**
Pour une instance TAV :
Pour une instance TAV, ou bien :
**$ php bin/console hautelook:fixtures:load --purge-with-truncate --env=tavpro**
ou bien :
**$ php bin/console hautelook:fixtures:load --purge-with-truncate --env=ssagirondepro**
Vous obtiendrez cette erreur ci dessous, c'est normal !
......@@ -100,13 +99,13 @@ There is no main category related to context: rubrique
**$ php bin/console sonata:media:fix-media-context**
Pour une instance non TAV :
Pour une instance non SSA :
**$ php bin/console hautelook:fixtures:load --append --env=pro**
Pour une instance TAV :
Pour une instance TAV, ou bien :
**$ php bin/console hautelook:fixtures:load --append --env=tavpro**
ou bien :
**$ php bin/console hautelook:fixtures:load --append --env=ssagirondepro**
Supprimer le cache (si besoin)
......
# Configuration des données initiales
App\Entity\EtatPrestataire:
etatSuspendu:
enabled: true
name: 'Suspendu'
content: 'Prestataires suspendus pour diverses raisons'
etatRappel:
enabled: true
name: 'Rappel'
content: 'Prestataires à rappeler'
etatAnnule:
enabled: true
name: 'Annulé'
content: 'Prestataires annulé'
etatProspect:
enabled: true
name: 'Prospects'
content: 'Prospects'
App\Entity\TypePrestataire:
typepresta1:
name: 'Prestataire'
typepresta2:
name: 'Partenaire'
App\Entity\Usergroup:
usergroup_adherent:
__construct: ['Adherent', ['ROLE_ADHERENT']]
usergroup_prestataire:
__construct: ['Prestataire', ['ROLE_PRESTATAIRE']]
usergroup_caissier:
__construct: ['Caissier', ['ROLE_CAISSIER']]
usergroup_adminsiege:
__construct: ['Administrateur du Siege', [
'ROLE_ADMIN_SIEGE',
'ROLE_SONATA_USER_ADMIN_USER_ALL',
'ROLE_SONATA_USER_ADMIN_GROUP_ALL',
'ROLE_ADMIN_COMPTOIR_GERER_LIST',
'ROLE_ADMIN_COMPTOIR_GERER_VIEW',
'ROLE_ADMIN_ADHERENT_GERER_ALL',
'ROLE_ADMIN_ALL_COTISATIONS_ALL',
'ROLE_ADMIN_ALL_ACHATSMONNAIE_ALL',
'ROLE_ADMIN_GROUPE_GERER_ALL',
'ROLE_ADMIN_GLOBALPARAMETER_GERER_ALL',
'ROLE_ADMIN_TRANSFERT_GERER_ALL',
'ROLE_ADMIN_ALL_DEMANDE_ACHATSMONNAIE_ALL',
'ROLE_ADMIN_OPERATION_PRESTATAIRE_GERER_LIST',
'ROLE_ADMIN_OPERATION_ADHERENT_GERER_LIST',
'ROLE_ADMIN_OPERATION_COMPTOIR_GERER_LIST',
'ROLE_ADMIN_OPERATION_GROUPE_GERER_LIST',
'ROLE_ADMIN_OPERATION_SIEGE_GERER_LIST',
'ROLE_ADMIN_ADHERENT_COTISATIONS_ALL',
'ROLE_ADMIN_PRESTATAIRE_COTISATIONS_ALL',
'ROLE_ADMIN_ALL_COTISATIONS_ALL',
'ROLE_ADMIN_HELLOASSO_ALL',
'ROLE_ADMIN_DONS_ALL']]
usergroup_redacteur:
__construct: ['Rédacteur', [
'ROLE_REDACTEUR',
'ROLE_SONATA_MEDIA_ADMIN_MEDIA_ALL',
'ROLE_SONATA_MEDIA_ADMIN_GALLERY_ALL',
'ROLE_SONATA_MEDIA_ADMIN_GALLERY_HAS_MEDIA_ALL',
'ROLE_PRODIGIOUS_SONATA_MENU_ADMIN_MENU_ALL',
'ROLE_PRODIGIOUS_SONATA_MENU_ADMIN_MENU_ITEM_ALL',
'ROLE_ADMIN_NEWS_GERER_ALL',
'ROLE_ADMIN_DOCUMENT_GERER_ALL',
'ROLE_ADMIN_RUBRIQUE_GERER_ALL',
'ROLE_ADMIN_FAQ_GERER_ALL',
'ROLE_ADMIN_PAGE_GERER_ALL',
'ROLE_ADMIN_TRADUCTION_GERER_ALL']]
usergroup_controleur:
__construct: ['Contrôleur', [
'ROLE_CONTROLEUR',
'ROLE_ADMIN_TRANSACTION_GERER_LIST',
'ROLE_ADMIN_TRANSACTION_GERER_VIEW',
'ROLE_ADMIN_OPERATION_PRESTATAIRE_GERER_LIST',
'ROLE_ADMIN_OPERATION_ADHERENT_GERER_LIST']]
usergroup_tresorier:
__construct: ['Trésorier', [
'ROLE_TRESORIER',
'ROLE_ADMIN_COMPTOIR_GERER_LIST',
'ROLE_ADMIN_COMPTOIR_GERER_VIEW',
'ROLE_ADMIN_ALL_COTISATIONS_ALL',
'ROLE_ADMIN_ALL_ACHATSMONNAIE_ALL',
'ROLE_ADMIN_RECONVERSION_GERER_ALL',
'ROLE_ADMIN_TRANSFERT_GERER_ALL',
'ROLE_ADMIN_ALL_DEMANDE_ACHATSMONNAIE_ALL',
'ROLE_ADMIN_OPERATION_PRESTATAIRE_GERER_ALL',
'ROLE_ADMIN_OPERATION_ADHERENT_GERER_ALL',
'ROLE_ADMIN_OPERATION_COMPTOIR_GERER_ALL',
'ROLE_ADMIN_OPERATION_GROUPE_GERER_ALL',
'ROLE_ADMIN_OPERATION_SIEGE_GERER_ALL',
'ROLE_ADMIN_HELLOASSO_ALL',
'ROLE_ADMIN_DONS_ALL']]
usergroup_gestiongroupe:
__construct: ['Gestionnaire de Groupe', [
'ROLE_GESTION_GROUPE',
'ROLE_SONATA_USER_ADMIN_USER_ALL',
'ROLE_ADMIN_ADHERENT_GERER_ALL',
'ROLE_ADMIN_ADHERENT_COTISATIONS_ALL',
'ROLE_ADMIN_PRESTATAIRE_GERER_ALL',
'ROLE_ADMIN_PRESTATAIRE_COTISATIONS_ALL',
'ROLE_ADMIN_GROUPE_GERER_EDIT',
'ROLE_ADMIN_GROUPE_GERER_VIEW',
'ROLE_ADMIN_COMPTOIR_GERER_ALL',
'ROLE_ADMIN_GROUPEPRESTA_GERER_ALL',
'ROLE_ADMIN_DOCUMENT_GERER_ALL',
'ROLE_ADMIN_TRANSFERT_GERER_EDIT',
'ROLE_ADMIN_TRANSFERT_GERER_LIST',
'ROLE_ADMIN_TRANSFERT_GERER_CREATE',
'ROLE_ADMIN_TRANSFERT_GERER_EXPORT',
'ROLE_ADMIN_OPERATION_PRESTATAIRE_GERER_LIST',
'ROLE_ADMIN_OPERATION_ADHERENT_GERER_LIST',
'ROLE_ADMIN_OPERATION_COMPTOIR_GERER_LIST']]
usergroup_comptoir:
__construct: ['Comptoir', [
'ROLE_COMPTOIR',
'ROLE_ADMIN_ADHERENT_GERER_EDIT',
'ROLE_ADMIN_ADHERENT_GERER_LIST',
'ROLE_ADMIN_ADHERENT_GERER_CREATE',
'ROLE_ADMIN_ADHERENT_GERER_VIEW',
'ROLE_ADMIN_ADHERENT_COTISATIONS_ALL',
'ROLE_ADMIN_COMPTOIR_GERER_EDIT',
'ROLE_ADMIN_COMPTOIR_GERER_VIEW',
'ROLE_ADMIN_TRANSFERT_GERER_LIST',
'ROLE_ADMIN_TRANSFERT_GERER_CREATE',
'ROLE_ADMIN_TRANSFERT_GERER_VIEW',
'ROLE_ADMIN_PRESTATAIRE_GERER_VIEW',
'ROLE_ADMIN_PRESTATAIRE_COTISATIONS_VIEW',
'ROLE_ADMIN_PRESTATAIRE_GERER_LIST',
'ROLE_ADMIN_PRESTATAIRE_GERER_EDIT',
'ROLE_ADMIN_PRESTATAIRE_COTISATIONS_EDIT',
'ROLE_ADMIN_PRESTATAIRE_COTISATIONS_LIST',
'ROLE_ADMIN_PRESTATAIRE_COTISATIONS_CREATE']]
usergroup_contact:
__construct: ['Contact', [
'ROLE_CONTACT',
'ROLE_ADMIN_ADHERENT_GERER_ALL',
'ROLE_ADMIN_ADHERENT_COTISATIONS_ALL',
'ROLE_ADMIN_PRESTATAIRE_GERER_ALL',
'ROLE_ADMIN_PRESTATAIRE_COTISATIONS_ALL',
'ROLE_ADMIN_COMPTOIR_GERER_ALL',
'ROLE_ADMIN_GROUPEPRESTA_GERER_ALL',
'ROLE_ADMIN_NEWS_GERER_ALL',
'ROLE_ADMIN_DOCUMENT_GERER_ALL',
'ROLE_ADMIN_RUBRIQUE_GERER_ALL']]
usergroup_superadmin:
__construct: ['Super Admin', ['ROLE_SUPER_ADMIN']]
Prodigious\Sonata\MenuBundle\Entity\Menu:
menu_main:
name: 'Main menu'
alias: 'main'
Prodigious\Sonata\MenuBundle\Entity\MenuItem:
menuitem4:
menu: '@menu_main'
name: 'Points de vente'
url: '#'
position: 1
target: 0
enabled: 1
menuitem5:
menu: '@menu_main'
name: 'Carte des prestataires'
parent: '@menuitem4'
url: '/prestataires/carte'
position: 0
target: 0
enabled: 1
menuitem6:
menu: '@menu_main'
name: 'Liste des prestataires'
parent: '@menuitem4'
url: '/prestataires/liste'
position: 1
target: 0
enabled: 1
menuitem7:
menu: '@menu_main'
name: 'Liste des partenaires'
parent: '@menuitem4'
url: '/partenaires/liste'
position: 2
target: 0
enabled: 1
menuitem8:
menu: '@menu_main'
name: 'Rubriques'
parent: '@menuitem4'
url: '/prestataires/rubriques'
position: 3
target: 0
enabled: 1
menuitem9:
menu: '@menu_main'
name: 'Comptoirs des habitants'
url: '#'
position: 2
target: 0
enabled: 1
menuitem10:
menu: '@menu_main'
name: 'Carte des comptoirs'
parent: '@menuitem9'
url: '/comptoirs/carte'
position: 0
target: 0
enabled: 1
menuitem11:
menu: '@menu_main'
name: 'Liste des comptoirs'
parent: '@menuitem9'
url: '/comptoirs/liste'
position: 1
target: 0
enabled: 1
menuitem12:
menu: '@menu_main'
name: 'Carte des amaps'
parent: '@menuitem9'
url: '/groupe/prestataires/amap/carte'
position: 2
target: 0
enabled: 1
menuitem13:
menu: '@menu_main'
name: 'Carte des marchés'
parent: '@menuitem9'
url: '/groupe/prestataires/marche/carte'
position: 3
target: 0
enabled: 1
menuitem14:
menu: '@menu_main'
name: 'Aide'
url: '#'
position: 3
target: 0
enabled: 1
menuitem15:
menu: '@menu_main'
name: 'Foire aux questions'
parent: '@menuitem14'
url: '/faq'
position: 0
target: 0
enabled: 1
menuitem16:
menu: '@menu_main'
name: 'Nous contacter'
parent: '@menuitem14'
url: '/contact'
position: 1
target: 0
enabled: 1
menuitem17:
menu: '@menu_main'
name: 'Actualités'
url: '/news'
position: 4
target: 0
enabled: 1
App\Entity\Subterritory:
subterritory1:
name: "Bordeaux Nord / Bordeaux La Benauge"
subterritory2:
name: "Pays foyen"
subterritory3:
name: "Bègles"
subterritory4:
name: "Sud Gironde / Bazadais"
App\Application\Sonata\MediaBundle\Entity\Media:
media6:
name: 'wosmpl-marker-icon17-produits-de-lagriculture-et-elevage.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: e5d9701e23fcfa5822d7c93092a522f82cf970ad.png
provider_metadata: {"filename":"wosmpl-marker-icon17-produits-de-lagriculture-et-elevage.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 29446
context: 'rubrique'
media7:
name: 'wosmpl-marker-icon3-metier-darts-creation.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: 3b56c41033edbc04176b2bc943716820b8d5859e.png
provider_metadata: {"filename":"wosmpl-marker-icon3-metier-darts-creation.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 38284
context: 'rubrique'
media8:
name: 'wosmpl-marker-icon-commerce-alimentaire.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: 3f7b75fef4df63756fd425d23fe90fce04757011.png
provider_metadata: {"filename":"wosmpl-marker-icon-commerce-alimentaire.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 33137
context: 'rubrique'
media9:
name: 'wosmpl-marker-icon2-restaurant-bar-traiteur.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: 6eaa4bbdf1225932d30c5ae54fb9996658836d7d.png
provider_metadata: {"filename":"wosmpl-marker-icon2-restaurant-bar-traiteur.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 32622
context: 'rubrique'
media10:
name: 'wosmpl-marker-icon4-habillement-mode-accessoires.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: 91f22423eaf61b22e7365250d902efecdce698fc.png
provider_metadata: {"filename":"wosmpl-marker-icon4-habillement-mode-accessoires.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 24911
context: 'rubrique'
media11:
name: 'wosmpl-marker-icon5-higiene-beaute.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: 749a4285560be42315ac3c4c888557eedc76e81d.png
provider_metadata: {"filename":"wosmpl-marker-icon5-higiene-beaute.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 25898
context: 'rubrique'
media12:
name: 'wosmpl-marker-icon6-Papeterie-librairie-presse-édition.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: aab9d557c3f77b9682ee6726c059badd89eb9ed8.png
provider_metadata: {"filename":"wosmpl-marker-icon6-Papeterie-librairie-presse-e\u0301dition.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 37730
context: 'rubrique'
media13:
name: 'wosmpl-marker-icon9-sortie-culturelle.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: 978c0d269d054f0e4f2e88de31eae8d0f0b44bfa.png
provider_metadata: {"filename":"wosmpl-marker-icon9-sortie-culturelle.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 32317
context: 'rubrique'
media14:
name: 'wosmpl-marker-icon11-santé-bien-etre.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: cf4510e313a050931ffae55a7c72651e765e4145.png
provider_metadata: {"filename":"wosmpl-marker-icon11-sante\u0301-bien-etre.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 36273
context: 'rubrique'
media15:
name: 'wosmpl-marker-icon14-Web-multimédia-communication-imprimerie.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: 6286598dea47116e34b4e9635eccf05a3fb9368f.png
provider_metadata: {"filename":"wosmpl-marker-icon14-Web-multime\u0301dia-communication-imprimerie.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 29416
context: 'rubrique'
media16:
name: 'wosmpl-marker-icon15-sport-et-loisirs.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: 1ecae95f3729865d8f249b17146d7aaef9d9b5c3.png
provider_metadata: {"filename":"wosmpl-marker-icon15-sport-et-loisirs.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 43002
context: 'rubrique'
media17:
name: 'wosmpl-marker-icon16-formation-education.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: 72609fa54f78962259708e4e3ff3da37239b224e.png
provider_metadata: {"filename":"wosmpl-marker-icon16-formation-education.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 31656
context: 'rubrique'
media18:
name: 'wosmpl-marker-icon19-immobillier.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: c1a399604ae2599ffbc5701a1d138830d2ececb7.png
provider_metadata: {"filename":"wosmpl-marker-icon19-immobillier.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 28576
context: 'rubrique'
media19:
name: 'wosmpl-marker-icon21-divers.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: 434524af87d1e989f8fd476a838fb6d0243a34f3.png
provider_metadata: {"filename":"wosmpl-marker-icon21-divers.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 25092
context: 'rubrique'
media20:
name: 'wosmpl-marker-icon22-marche-amap.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: 348b65dcd5ed271c94bf28eb353b12c6bf4d45ac.png
provider_metadata: {"filename":"wosmpl-marker-icon22-marche-amap.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 34804
context: 'rubrique'
media21:
name: 'wosmpl-marker-icon23-Artisanat-constructions-réparations.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: fc1af9dfa9da71e26464879365203a7d9158bc90.png
provider_metadata: {"filename":"wosmpl-marker-icon23-Artisanat-constructions-re\u0301parations.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 25215
context: 'rubrique'
media22:
name: 'wosmpl-marker-icon20-service-a-la-personne.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: b48e9ed9bf500aabfca8cd70445d2b9274587dfe.png
provider_metadata: {"filename":"wosmpl-marker-icon20-service-a-la-personne.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 34234
context: 'rubrique'
media23:
name: 'wosmpl-marker-icon7-decoration-ameublement-bricolage-jardin.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: e1ea5c5d2a395a0d947ed736a3289fea3fdb821b.png
provider_metadata: {"filename":"wosmpl-marker-icon7-decoration-ameublement-bricolage-jardin.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 39650
context: 'rubrique'
media24:
name: 'wosmpl-marker-icon8-Commerces-divers.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: 3433854a2e8d5bf720db32631533afe54600ec87.png
provider_metadata: {"filename":"wosmpl-marker-icon8-Commerces-divers.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 35621
context: 'rubrique'
media25:
name: 'wosmpl-marker-icon10-Informatique-Electronique.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: 7a313aa2622f4db659d526e76b24322f64c4f910.png
provider_metadata: {"filename":"wosmpl-marker-icon10-Informatique-Electronique.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 25964
context: 'rubrique'
media26:
name: 'wosmpl-marker-icon13-transports-livraison.png'
enabled: true
provider_name: 'sonata.media.provider.image'
provider_status: true
provider_reference: ca83dd7189873cf07639668b48e4d6e940745dda.png
provider_metadata: {"filename":"wosmpl-marker-icon13-transports-livraison.png"}
width: 512
height: 512
content_type: 'image/png'
content_size: 31625
context: 'rubrique'
App\Entity\Rubrique:
rubrique1:
name: "Produit de l'agriculture et élevage"
content: ""
enabled: true
media: '@media6'
rubrique2:
name: "Sports et loisirs"
content: ""
enabled: true
media: '@media16'
rubrique3:
name: "Commerce alimentaire"
content: ""
enabled: true
media: '@media8'
rubrique4:
name: "Restaurant, bar, traiteur"
content: ""
enabled: true
media: '@media9'
rubrique5:
name: "Commerces divers"
content: ""
enabled: true
media: '@media24'
rubrique6:
name: "Métiers d'art, créations"
content: ""
enabled: true
media: '@media7'
rubrique7:
name: "Habillement, mode, accessoires"
content: ""
enabled: true
media: '@media10'
rubrique8:
name: "Papeterie, librairie, presse, édition"
content: ""
enabled: true
media: '@media12'
rubrique9:
name: "Marchés, AMAP"
content: ""
enabled: true
media: '@media20'
rubrique10:
name: "Web, multimédia, communication, imprimerie"
content: ""
enabled: true
media: '@media15'
rubrique11:
name: "Sorties culturelles"
content: ""
enabled: true
media: '@media13'
rubrique12:
name: "Informatique, Electronique"
content: ""
enabled: true
media: '@media25'
rubrique13:
name: "Décoration, ameublement, bricolage, jardin"
content: ""
enabled: true
media: '@media23'
rubrique14:
name: "Artisanat, constructions, réparations"
content: ""
enabled: true
media: '@media21'
rubrique15:
name: "Transports, Livraisons"
content: ""
enabled: true
media: '@media26'
rubrique16:
name: "Divers"
content: ""
enabled: true
media: '@media19'
rubrique17:
name: "Hygiène, beauté"
content: ""
enabled: true
media: '@media11'
rubrique18:
name: "Santé, bien-être"
content: ""
enabled: true
media: '@media14'
rubrique19:
name: "Immobilier"
content: ""
enabled: true
media: '@media18'
rubrique20:
name: "Services à la personne"
content: ""
enabled: true
media: '@media22'
rubrique21:
name: "Formation, éducation"
content: ""
enabled: true
media: '@media17'
\ No newline at end of file
......@@ -160,6 +160,9 @@ class AdherentAdmin extends AbstractAdmin
'required' => true,
'with_geoloc' => false,
'with_latlon' => false,
'with_subterritory' =>
$this->getConfigurationPool()->getContainer()->getParameter('tav_env')
&& $this->getConfigurationPool()->getContainer()->getParameter('household_based_allowance')
])
->end()
->with('Groupe', ['class' => 'col-md-5'])
......
......@@ -66,6 +66,14 @@ class Geoloc
*/
private $lon;
/**
* @var Subterritory
*
* @ORM\ManyToOne(targetEntity="Subterritory")
* @ORM\JoinColumn(name="subterritory_id", referencedColumnName="id", nullable=true)
*/
private $subterritory;
public function getId()
{
return $this->id;
......@@ -171,6 +179,26 @@ class Geoloc
return $this;
}
/**
* @return Subterritory|null
*/
public function getSubterritory(): ?Subterritory
{
return $this->subterritory;
}
/**
* @param Subterritory|null $subterritory
*
* @return Geoloc
*/
public function setSubterritory(?Subterritory $subterritory): Geoloc
{
$this->subterritory = $subterritory;
return $this;
}
public function __toString(): string
{
return (!empty($this->adresse) ? $this->adresse : '') . ' ' . (!empty($this->cpostal) ? $this->cpostal : '') . ' ' . (!empty($this->ville) ? $this->ville : '');
......
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Ramsey\Uuid\Doctrine\UuidGenerator;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Table(name="subterritory")
*/
class Subterritory
{
/**
* @var \Ramsey\Uuid\UuidInterface
*
* @ORM\Id
* @ORM\Column(type="uuid", unique=true)
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class=UuidGenerator::class)
*/
protected $id;
/**
* @var string|null
*
* @ORM\Column(type="string", unique=true)
* @Assert\NotBlank
*/
protected $name;
public function getId()
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name)
{
$this->name = $name;
return $this;
}
}
......@@ -3,6 +3,8 @@
namespace App\Form\Type;
use App\Entity\Geoloc;
use App\Entity\Subterritory;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ButtonType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
......@@ -71,6 +73,18 @@ class GeolocFormType extends AbstractType
])
;
}
if (true === $options['with_subterritory']) {
$builder
->add('subterritory', EntityType::class, [
'class' => Subterritory::class,
'label' => 'Territoire',
'required' => true,
'choice_label' => 'name',
'placeholder' => "Choix du territoire",
'attr' => ['autocomplete' => 'off']
])
;
}
}
public function configureOptions(OptionsResolver $resolver)
......@@ -80,6 +94,7 @@ class GeolocFormType extends AbstractType
'data_class' => Geoloc::class,
'with_geoloc' => true,
'with_latlon' => true,
'with_subterritory' => 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 Version20240311154311 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('CREATE TABLE subterritory (id CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', name VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_7D1B925F5E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_general_ci` ENGINE = InnoDB');
$this->addSql("INSERT INTO subterritory (id, name) VALUES (UUID(), 'Bordeaux Nord / Bordeaux La Benauge')");
$this->addSql("INSERT INTO subterritory (id, name) VALUES (UUID(), 'Pays foyen')");
$this->addSql("INSERT INTO subterritory (id, name) VALUES (UUID(), 'Bègles')");
$this->addSql("INSERT INTO subterritory (id, name) VALUES (UUID(), 'Sud Gironde / Bazadais')");
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE subterritory');
}
}
<?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 Version20240311155641 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 subterritory_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE geoloc ADD CONSTRAINT FK_E1B7F4E7C8B38DB4 FOREIGN KEY (subterritory_id) REFERENCES subterritory (id)');
$this->addSql('CREATE INDEX IDX_E1B7F4E7C8B38DB4 ON geoloc (subterritory_id)');
$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 FOREIGN KEY FK_E1B7F4E7C8B38DB4');
$this->addSql('DROP INDEX IDX_E1B7F4E7C8B38DB4 ON geoloc');
$this->addSql('ALTER TABLE geoloc DROP subterritory_id');
$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