Add first step to select Activity Type

This commit is contained in:
Jean-Francois Monfort
2021-04-15 13:08:30 +02:00
parent dad8fd5378
commit ff450215c6
8 changed files with 101 additions and 46 deletions

View File

@@ -0,0 +1,19 @@
<?php
namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Form\Type\TranslatableActivityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
class ActivitySelectTypeType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('type', TranslatableActivityType::class, array(
'placeholder' => 'Choose a type',
'active_only' => true,
'mapped' => false,
));
}
}

View File

@@ -15,7 +15,6 @@ use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTra
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Chill\ActivityBundle\Form\Type\TranslatableActivityType;
use Chill\ActivityBundle\Form\Type\TranslatableActivityReason;
use Chill\MainBundle\Form\Type\UserPickerType;
@@ -24,7 +23,6 @@ use Chill\MainBundle\Form\Type\ChillDateType;
class ActivityType extends AbstractType
{
/**
* the user running this form
*
@@ -36,7 +34,7 @@ class ActivityType extends AbstractType
*
* @var AuthorizationHelper
*/
protected $authorizationHelper;
protected AuthorizationHelper $authorizationHelper;
/**
*
@@ -113,10 +111,6 @@ class ActivityType extends AbstractType
'multiple' => true,
'required' => false,
))
->add('type', TranslatableActivityType::class, array(
'placeholder' => 'Choose a type',
'active_only' => true
))
->add('comment', CommentType::class, [
'required' => false,
])