allow switching user displayed in calendar (#3314)

This commit is contained in:
Kevin Papst
2022-05-18 21:30:58 +02:00
committed by GitHub
parent 913839727c
commit 3c71640547
8 changed files with 165 additions and 69 deletions

34
src/Form/CalendarForm.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Form;
use App\Form\Type\UserType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class CalendarForm extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder->add('user', UserType::class, [
'required' => false,
'attr' => ['onchange' => 'this.form.submit()']
]);
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'csrf_protection' => false,
'method' => 'GET',
]);
}
}