Release 2.19 (#4922)
This commit is contained in:
@@ -11,7 +11,6 @@ namespace App\Form;
|
||||
|
||||
use App\Configuration\SystemConfiguration;
|
||||
use App\Form\Type\QuickEntryWeekType;
|
||||
use App\Form\Type\WeekPickerType;
|
||||
use App\Model\QuickEntryWeek;
|
||||
use App\Validator\Constraints\QuickEntryModel;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
@@ -57,13 +56,6 @@ final class QuickEntryForm extends AbstractType
|
||||
}
|
||||
));
|
||||
|
||||
$builder->add('date', WeekPickerType::class, [
|
||||
'model_timezone' => $options['timezone'],
|
||||
'view_timezone' => $options['timezone'],
|
||||
'start_date' => $options['start_date'],
|
||||
'label' => false,
|
||||
]);
|
||||
|
||||
$builder->add('rows', CollectionType::class, [
|
||||
'label' => false,
|
||||
'entry_type' => QuickEntryWeekType::class,
|
||||
|
||||
48
src/Form/WeekByUserForm.php
Normal file
48
src/Form/WeekByUserForm.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?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 App\Form\Type\WeekPickerType;
|
||||
use App\Reporting\WeekByUser\WeekByUser;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
final class WeekByUserForm extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder->add('date', WeekPickerType::class, [
|
||||
'model_timezone' => $options['timezone'],
|
||||
'view_timezone' => $options['timezone'],
|
||||
'start_date' => $options['start_date'],
|
||||
]);
|
||||
|
||||
if ($options['include_user']) {
|
||||
$builder->add('user', UserType::class, [
|
||||
'width' => false,
|
||||
'include_current_user_if_system_account' => true
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => WeekByUser::class,
|
||||
'timezone' => date_default_timezone_get(),
|
||||
'start_date' => new \DateTime(),
|
||||
'include_user' => false,
|
||||
'csrf_protection' => false,
|
||||
'method' => 'GET',
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user