Move AccompanyingPeriodType, remove custom definition.

This commit is contained in:
Pol Dellaiera 2021-05-06 21:31:04 +02:00
parent 92b6f4e206
commit a9bdb1fe3b
3 changed files with 12 additions and 24 deletions

View File

@ -23,12 +23,6 @@ services:
tags: tags:
- { name: form.type, alias: closing_motive } - { name: form.type, alias: closing_motive }
Chill\PersonBundle\Form\AccompanyingPeriodType:
arguments:
$config: "%chill_person.accompanying_period_fields%"
tags:
- { name: form.type }
chill.person.form.type.pick_person: chill.person.form.type.pick_person:
class: Chill\PersonBundle\Form\Type\PickPersonType class: Chill\PersonBundle\Form\Type\PickPersonType
arguments: arguments:

View File

@ -26,7 +26,7 @@ use Chill\PersonBundle\Privacy\PrivacyEvent;
use Doctrine\DBAL\Exception; use Doctrine\DBAL\Exception;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Form\AccompanyingPeriodType; use Chill\PersonBundle\Form\Type\AccompanyingPeriodType;
use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Collections\Criteria;
use Chill\PersonBundle\Security\Authorization\PersonVoter; use Chill\PersonBundle\Security\Authorization\PersonVoter;

View File

@ -1,6 +1,6 @@
<?php <?php
namespace Chill\PersonBundle\Form; namespace Chill\PersonBundle\Form\Type;
use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Center;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
@ -14,12 +14,10 @@ use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Chill\MainBundle\Form\Type\UserPickerType; use Chill\MainBundle\Form\Type\UserPickerType;
use Symfony\Component\Security\Core\Role\Role; use Symfony\Component\Security\Core\Role\Role;
use Chill\PersonBundle\Form\Type\ClosingMotivePickerType; use Chill\PersonBundle\Form\Type\ClosingMotivePickerType;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
/** /**
* Class AccompanyingPeriodType * Class AccompanyingPeriodType
*
* @package Chill\PersonBundle\Form
*/ */
class AccompanyingPeriodType extends AbstractType class AccompanyingPeriodType extends AbstractType
{ {
@ -33,13 +31,9 @@ class AccompanyingPeriodType extends AbstractType
*/ */
protected $config = []; protected $config = [];
/** public function __construct(ParameterBagInterface $parameterBag)
*
* @param string[] $config configuration of visibility of some fields
*/
public function __construct(array $config)
{ {
$this->config = $config; $this->config = $parameterBag->get('chill_person.accompanying_period_fields');
} }
/** /**