51 lines
1.3 KiB
PHP
51 lines
1.3 KiB
PHP
<?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\Toolbar;
|
|
|
|
use App\Repository\Query\TimesheetQuery;
|
|
use Symfony\Component\Form\FormBuilderInterface;
|
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
|
|
|
/**
|
|
* Defines the form used for filtering the timesheet.
|
|
*/
|
|
class TimesheetToolbarForm extends AbstractToolbarForm
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
|
{
|
|
$this->addTimesheetStateChoice($builder);
|
|
$this->addPageSizeChoice($builder);
|
|
if ($options['include_user']) {
|
|
$this->addUserChoice($builder);
|
|
}
|
|
$this->addDateRangeChoice($builder);
|
|
$this->addCustomerChoice($builder);
|
|
$this->addProjectChoice($builder);
|
|
$this->addActivityChoice($builder);
|
|
$this->addTagInputField($builder);
|
|
$this->addHiddenPagination($builder);
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function configureOptions(OptionsResolver $resolver)
|
|
{
|
|
$resolver->setDefaults([
|
|
'data_class' => TimesheetQuery::class,
|
|
'csrf_protection' => false,
|
|
'include_user' => false,
|
|
]);
|
|
}
|
|
}
|