Browse Source

thematique facultatif

develop
Charly 3 years ago
parent
commit
1e7b41093a
6 changed files with 12 additions and 7 deletions
  1. +1
    -1
      Controller/IndividualData/IndividualDataAdminController.php
  2. +7
    -2
      Definition/Field/IndividualData/IndividualDataFieldDefinition.php
  3. +1
    -1
      Form/Dream/DreamType.php
  4. +1
    -1
      Form/ProjectBoost/ProjectBoostType.php
  5. +1
    -1
      Form/ProjectInspiring/ProjectInspiringType.php
  6. +1
    -1
      Form/Revolt/RevoltType.php

+ 1
- 1
Controller/IndividualData/IndividualDataAdminController.php View File

): RepositoryQueryInterface { ): RepositoryQueryInterface {
$repositoryQuery = parent::createIndexRepositoryQuery($searchDto, $entityDto, $fields, $filters); $repositoryQuery = parent::createIndexRepositoryQuery($searchDto, $entityDto, $fields, $filters);
$status = $searchDto->getRequest()->get('status'); $status = $searchDto->getRequest()->get('status');
if ($status || $status == 0) {
if ($status || $status === 0) {
$repositoryQuery->filterByStatus($searchDto->getRequest()->get('status')); $repositoryQuery->filterByStatus($searchDto->getRequest()->get('status'));
} }
return $repositoryQuery; return $repositoryQuery;

+ 7
- 2
Definition/Field/IndividualData/IndividualDataFieldDefinition.php View File

use Lc\PietroBundle\Form\ProjectBoost\ProjectBoostType; use Lc\PietroBundle\Form\ProjectBoost\ProjectBoostType;
use Lc\PietroBundle\Form\ProjectInspiring\ProjectInspiringType; use Lc\PietroBundle\Form\ProjectInspiring\ProjectInspiringType;
use Lc\PietroBundle\Form\Revolt\RevoltType; use Lc\PietroBundle\Form\Revolt\RevoltType;
use Lc\PietroBundle\Repository\Territory\TerritoryStore;
use Lc\SovBundle\Definition\Field\AbstractFieldDefinition; use Lc\SovBundle\Definition\Field\AbstractFieldDefinition;
use Lc\SovBundle\Field\CollectionField; use Lc\SovBundle\Field\CollectionField;
use Lc\SovBundle\Field\StatusField; use Lc\SovBundle\Field\StatusField;
{ {


protected AuthorizationCheckerInterface $authorizationChecker; protected AuthorizationCheckerInterface $authorizationChecker;
protected TerritoryStore $territoryStore;


public function __construct(TranslatorAdmin $translatorAdmin, AuthorizationCheckerInterface $authorizationChecker)
public function __construct(TranslatorAdmin $translatorAdmin, AuthorizationCheckerInterface $authorizationChecker, TerritoryStore $territoryStore)
{ {
$this->authorizationChecker = $authorizationChecker; $this->authorizationChecker = $authorizationChecker;
$this->territoryStore = $territoryStore;


parent::__construct($translatorAdmin); parent::__construct($translatorAdmin);
} }
{ {
$fields = array(); $fields = array();


$territoryArray = $this->territoryStore->get();

$fields['firstname'] = TextField::new('firstname'); $fields['firstname'] = TextField::new('firstname');
$fields['lastname'] = TextField::new('lastname'); $fields['lastname'] = TextField::new('lastname');
$fields['email'] = EmailField::new('email'); $fields['email'] = EmailField::new('email');
$fields['territory'] = AssociationField::new('territory');
$fields['territory'] = AssociationField::new('territory')->setFormTypeOption('choices', $territoryArray);
$fields['nbDream'] = TextField::new('nbDream'); $fields['nbDream'] = TextField::new('nbDream');
$fields['nbRevolt'] = TextField::new('nbRevolt'); $fields['nbRevolt'] = TextField::new('nbRevolt');
$fields['nbProjectBoost'] = TextField::new('nbProjectBoost'); $fields['nbProjectBoost'] = TextField::new('nbProjectBoost');

+ 1
- 1
Form/Dream/DreamType.php View File

] ]
); );
} }
if ($options['context'] == "backend") {
if ($options['context'] == "backend" && $options['thematic'] == true) {
$builder->add( $builder->add(
'subthematic', 'subthematic',
EntityType::class, EntityType::class,

+ 1
- 1
Form/ProjectBoost/ProjectBoostType.php View File

] ]
); );
} }
if ($options['context'] == "backend") {
if ($options['context'] == "backend" && $options['thematic'] == true) {
$builder->add( $builder->add(
'subthematic', 'subthematic',
EntityType::class, EntityType::class,

+ 1
- 1
Form/ProjectInspiring/ProjectInspiringType.php View File

] ]
); );
} }
if ($options['context'] == "backend") {
if ($options['context'] == "backend" && $options['thematic'] == true) {
$builder->add( $builder->add(
'subthematic', 'subthematic',
EntityType::class, EntityType::class,

+ 1
- 1
Form/Revolt/RevoltType.php View File

] ]
); );
} }
if ($options['context'] == "backend") {
if ($options['context'] == "backend" && $options['thematic'] == true) {
$builder->add( $builder->add(
'subthematic', 'subthematic',
EntityType::class, EntityType::class,

Loading…
Cancel
Save