minor changes to activity for amli

This commit is contained in:
Julien Fastré 2021-11-04 17:12:35 +01:00
parent 08bf5f9922
commit 03fb75edc8
3 changed files with 7 additions and 3 deletions

View File

@ -29,6 +29,7 @@ use Chill\MainBundle\Entity\HasCenterInterface;
use Chill\MainBundle\Entity\HasScopeInterface; use Chill\MainBundle\Entity\HasScopeInterface;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency; use Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency;
use Symfony\Component\Validator\Constraints as Assert;
/** /**
* Activity * Activity
@ -72,6 +73,8 @@ class Activity implements HasCenterInterface, HasScopeInterface
/** /**
* @var \Doctrine\Common\Collections\Collection * @var \Doctrine\Common\Collections\Collection
*
* @Assert\Count(min=1, minMessage="Add at least one reason")
*/ */
private $reasons; private $reasons;

View File

@ -99,11 +99,11 @@ class ActivityType extends AbstractType
)) ))
->add('attendee', ChoiceType::class, array( ->add('attendee', ChoiceType::class, array(
'expanded' => true, 'expanded' => true,
'required' => false, 'required' => true,
'choices_as_values' => true, 'choices_as_values' => true,
'choices' => array( 'choices' => array(
'present' => true, 'yes' => true,
'not present' => false 'no' => false
) )
)) ))
->add('user', UserPickerType::class, [ ->add('user', UserPickerType::class, [

View File

@ -1,2 +1,3 @@
The reasons's level should not be empty: Le niveau du sujet ne peut pas être vide The reasons's level should not be empty: Le niveau du sujet ne peut pas être vide
At least one reason must be choosen: Au moins un sujet doit être choisi At least one reason must be choosen: Au moins un sujet doit être choisi
Add at least one reason: L'activité doit comporter au moins un sujet