mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
fix deprecation: no more passing of type instances
This commit is contained in:
parent
ed00833eb8
commit
478e1c505d
@ -25,9 +25,11 @@ namespace Chill\ActivityBundle\Controller;
|
|||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
|
|
||||||
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
|
use Chill\ActivityBundle\Form\ActivityType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activity controller.
|
* Activity controller.
|
||||||
@ -130,7 +132,7 @@ class ActivityController extends Controller
|
|||||||
*/
|
*/
|
||||||
private function createCreateForm(Activity $entity)
|
private function createCreateForm(Activity $entity)
|
||||||
{
|
{
|
||||||
$form = $this->createForm('chill_activitybundle_activity', $entity,
|
$form = $this->createForm(ActivityType::class, $entity,
|
||||||
array(
|
array(
|
||||||
'action' => $this->generateUrl('chill_activity_activity_create', [
|
'action' => $this->generateUrl('chill_activity_activity_create', [
|
||||||
'person_id' => $entity->getPerson()->getId(),
|
'person_id' => $entity->getPerson()->getId(),
|
||||||
@ -250,7 +252,7 @@ class ActivityController extends Controller
|
|||||||
*/
|
*/
|
||||||
private function createEditForm(Activity $entity)
|
private function createEditForm(Activity $entity)
|
||||||
{
|
{
|
||||||
$form = $this->createForm('chill_activitybundle_activity', $entity, array(
|
$form = $this->createForm(ActivityType::class, $entity, array(
|
||||||
'action' => $this->generateUrl('chill_activity_activity_update',
|
'action' => $this->generateUrl('chill_activity_activity_update',
|
||||||
array(
|
array(
|
||||||
'id' => $entity->getId(),
|
'id' => $entity->getId(),
|
||||||
|
@ -63,7 +63,7 @@ class ActivityReasonCategoryController extends Controller
|
|||||||
*/
|
*/
|
||||||
private function createCreateForm(ActivityReasonCategory $entity)
|
private function createCreateForm(ActivityReasonCategory $entity)
|
||||||
{
|
{
|
||||||
$form = $this->createForm(new ActivityReasonCategoryType(), $entity, array(
|
$form = $this->createForm(ActivityReasonCategoryType::class, $entity, array(
|
||||||
'action' => $this->generateUrl('chill_activity_activityreasoncategory_create'),
|
'action' => $this->generateUrl('chill_activity_activityreasoncategory_create'),
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
));
|
));
|
||||||
@ -138,7 +138,7 @@ class ActivityReasonCategoryController extends Controller
|
|||||||
*/
|
*/
|
||||||
private function createEditForm(ActivityReasonCategory $entity)
|
private function createEditForm(ActivityReasonCategory $entity)
|
||||||
{
|
{
|
||||||
$form = $this->createForm(new ActivityReasonCategoryType(), $entity, array(
|
$form = $this->createForm(ActivityReasonCategoryType::class, $entity, array(
|
||||||
'action' => $this->generateUrl('chill_activity_activityreasoncategory_update', array('id' => $entity->getId())),
|
'action' => $this->generateUrl('chill_activity_activityreasoncategory_update', array('id' => $entity->getId())),
|
||||||
'method' => 'PUT',
|
'method' => 'PUT',
|
||||||
));
|
));
|
||||||
|
@ -63,7 +63,7 @@ class ActivityReasonController extends Controller
|
|||||||
*/
|
*/
|
||||||
private function createCreateForm(ActivityReason $entity)
|
private function createCreateForm(ActivityReason $entity)
|
||||||
{
|
{
|
||||||
$form = $this->createForm(new ActivityReasonType(), $entity, array(
|
$form = $this->createForm(ActivityReasonType::class, $entity, array(
|
||||||
'action' => $this->generateUrl('chill_activity_activityreason_create'),
|
'action' => $this->generateUrl('chill_activity_activityreason_create'),
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
));
|
));
|
||||||
@ -138,7 +138,7 @@ class ActivityReasonController extends Controller
|
|||||||
*/
|
*/
|
||||||
private function createEditForm(ActivityReason $entity)
|
private function createEditForm(ActivityReason $entity)
|
||||||
{
|
{
|
||||||
$form = $this->createForm(new ActivityReasonType(), $entity, array(
|
$form = $this->createForm(ActivityReasonType::class, $entity, array(
|
||||||
'action' => $this->generateUrl('chill_activity_activityreason_update', array('id' => $entity->getId())),
|
'action' => $this->generateUrl('chill_activity_activityreason_update', array('id' => $entity->getId())),
|
||||||
'method' => 'PUT',
|
'method' => 'PUT',
|
||||||
));
|
));
|
||||||
|
@ -63,7 +63,7 @@ class ActivityTypeController extends Controller
|
|||||||
*/
|
*/
|
||||||
private function createCreateForm(ActivityType $entity)
|
private function createCreateForm(ActivityType $entity)
|
||||||
{
|
{
|
||||||
$form = $this->createForm(new ActivityTypeType(), $entity, array(
|
$form = $this->createForm(ActivityTypeType::class, $entity, array(
|
||||||
'action' => $this->generateUrl('chill_activity_activitytype_create'),
|
'action' => $this->generateUrl('chill_activity_activitytype_create'),
|
||||||
'method' => 'POST',
|
'method' => 'POST',
|
||||||
));
|
));
|
||||||
@ -138,7 +138,7 @@ class ActivityTypeController extends Controller
|
|||||||
*/
|
*/
|
||||||
private function createEditForm(ActivityType $entity)
|
private function createEditForm(ActivityType $entity)
|
||||||
{
|
{
|
||||||
$form = $this->createForm(new ActivityTypeType(), $entity, array(
|
$form = $this->createForm(ActivityTypeType::class, $entity, array(
|
||||||
'action' => $this->generateUrl('chill_activity_activitytype_update', array('id' => $entity->getId())),
|
'action' => $this->generateUrl('chill_activity_activitytype_update', array('id' => $entity->getId())),
|
||||||
'method' => 'PUT',
|
'method' => 'PUT',
|
||||||
));
|
));
|
||||||
|
@ -17,6 +17,7 @@ use Symfony\Component\Form\FormEvents;
|
|||||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
|
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||||
use Chill\ActivityBundle\Form\Type\TranslatableActivityType;
|
use Chill\ActivityBundle\Form\Type\TranslatableActivityType;
|
||||||
use Chill\ActivityBundle\Form\Type\TranslatableActivityReason;
|
use Chill\ActivityBundle\Form\Type\TranslatableActivityReason;
|
||||||
|
|
||||||
@ -90,7 +91,7 @@ class ActivityType extends AbstractType
|
|||||||
);
|
);
|
||||||
|
|
||||||
$builder
|
$builder
|
||||||
->add('date', 'date', array(
|
->add('date', DateType::class, array(
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'widget' => 'single_text',
|
'widget' => 'single_text',
|
||||||
'format' => 'dd-MM-yyyy')
|
'format' => 'dd-MM-yyyy')
|
||||||
|
@ -24,6 +24,7 @@ namespace Chill\ActivityBundle\Form\Type;
|
|||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
|
||||||
@ -49,7 +50,7 @@ class TranslatableActivityReason extends AbstractType
|
|||||||
|
|
||||||
public function getParent()
|
public function getParent()
|
||||||
{
|
{
|
||||||
return 'entity';
|
return EntityType::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
|
@ -25,6 +25,7 @@ namespace Chill\ActivityBundle\Form\Type;
|
|||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Component\HttpFoundation\RequestStack;
|
use Symfony\Component\HttpFoundation\RequestStack;
|
||||||
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -53,7 +54,7 @@ class TranslatableActivityReasonCategory extends AbstractType
|
|||||||
|
|
||||||
public function getParent()
|
public function getParent()
|
||||||
{
|
{
|
||||||
return 'entity';
|
return EntityType::class;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user