mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 19:43:49 +00:00
logic moved to controller instead of form
This commit is contained in:
@@ -93,10 +93,6 @@ class ActivityType extends AbstractType
|
||||
/** @var \Chill\ActivityBundle\Entity\ActivityType $activityType */
|
||||
$activityType = $options['activityType'];
|
||||
|
||||
if (!$activityType->isActive() && $options['edit'] !== true) {
|
||||
throw new \InvalidArgumentException('Activity type must be active');
|
||||
}
|
||||
|
||||
// TODO revoir la gestion des center au niveau du form des activité.
|
||||
if ($options['center']) {
|
||||
$builder->add('scope', ScopePickerType::class, [
|
||||
@@ -378,12 +374,11 @@ class ActivityType extends AbstractType
|
||||
]);
|
||||
|
||||
$resolver
|
||||
->setRequired(['center', 'role', 'activityType', 'accompanyingPeriod', 'edit'])
|
||||
->setRequired(['center', 'role', 'activityType', 'accompanyingPeriod'])
|
||||
->setAllowedTypes('center', ['null', 'Chill\MainBundle\Entity\Center'])
|
||||
->setAllowedTypes('role', 'Symfony\Component\Security\Core\Role\Role')
|
||||
->setAllowedTypes('activityType', \Chill\ActivityBundle\Entity\ActivityType::class)
|
||||
->setAllowedTypes('accompanyingPeriod', [\Chill\PersonBundle\Entity\AccompanyingPeriod::class, 'null'])
|
||||
->setAllowedTypes('edit', 'bool')
|
||||
;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user