allow to query other users timesheets via api (#563)

This commit is contained in:
Kevin Papst
2019-02-14 00:04:27 +01:00
committed by GitHub
parent ef33233624
commit 8005679e60
13 changed files with 153 additions and 72 deletions

View File

@@ -1,33 +0,0 @@
<?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 Symfony\Component\Form\FormBuilderInterface;
/**
* Defines the form used for filtering the admin timesheet.
*/
class TimesheetAdminToolbarForm extends TimesheetToolbarForm
{
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$this->addTimesheetStateChoice($builder);
$this->addPageSizeChoice($builder);
$this->addUserChoice($builder);
$this->addDateRangeChoice($builder);
$this->addCustomerChoice($builder);
$this->addProjectChoice($builder);
$this->addActivityChoice($builder);
$this->addHiddenPagination($builder);
}
}

View File

@@ -26,6 +26,9 @@ class TimesheetToolbarForm extends AbstractToolbarForm
{
$this->addTimesheetStateChoice($builder);
$this->addPageSizeChoice($builder);
if ($options['include_user']) {
$this->addUserChoice($builder);
}
$this->addDateRangeChoice($builder);
$this->addCustomerChoice($builder);
$this->addProjectChoice($builder);
@@ -58,6 +61,7 @@ class TimesheetToolbarForm extends AbstractToolbarForm
$resolver->setDefaults([
'data_class' => TimesheetQuery::class,
'csrf_protection' => false,
'include_user' => false,
]);
}
}