billable timesheets, inactive projects report, bookmark export search (#2503)

This commit is contained in:
Kevin Papst
2021-04-18 21:51:27 +02:00
committed by GitHub
parent 8664d94ea6
commit 0330f45c6a
97 changed files with 1516 additions and 664 deletions

View File

@@ -10,6 +10,7 @@
namespace App\Form;
use App\Entity\Timesheet;
use App\Form\Type\BillableType;
use App\Form\Type\DateTimePickerType;
use App\Form\Type\DescriptionType;
use App\Form\Type\DurationType;
@@ -128,6 +129,7 @@ class TimesheetEditForm extends AbstractType
$builder->add('metaFields', MetaFieldsCollectionType::class);
$this->addExported($builder, $options);
$this->addBillable($builder, $options);
}
protected function showCustomer(array $options, bool $isNew, int $customerCount): bool
@@ -264,6 +266,15 @@ class TimesheetEditForm extends AbstractType
]);
}
protected function addBillable(FormBuilderInterface $builder, array $options)
{
if (!$options['include_billable']) {
return;
}
$builder->add('billable', BillableType::class, []);
}
/**
* {@inheritdoc}
*/
@@ -276,6 +287,7 @@ class TimesheetEditForm extends AbstractType
'csrf_token_id' => 'timesheet_edit',
'include_user' => false,
'include_exported' => false,
'include_billable' => true,
'include_rate' => true,
'docu_chapter' => 'timesheet.html',
'method' => 'POST',

View File

@@ -12,7 +12,6 @@ namespace App\Form\Toolbar;
use App\Repository\Query\ExportQuery;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -27,6 +26,7 @@ class ExportToolbarForm extends AbstractToolbarForm
public function buildForm(FormBuilderInterface $builder, array $options)
{
$this->addSearchTermInputField($builder);
$this->addBillableChoice($builder);
$this->addExportStateChoice($builder);
$this->addTimesheetStateChoice($builder);
if ($options['include_user']) {
@@ -42,9 +42,6 @@ class ExportToolbarForm extends AbstractToolbarForm
'label' => 'label.mark_as_exported',
'required' => false,
]);
$builder->add('preview', SubmitType::class, [
'label' => 'button.preview',
]);
}
/**

View File

@@ -38,6 +38,7 @@ class TimesheetToolbarForm extends AbstractToolbarForm
$this->addUsersChoice($builder);
}
$this->addTimesheetStateChoice($builder);
$this->addBillableChoice($builder);
$this->addExportStateChoice($builder);
$this->addPageSizeChoice($builder);
$this->addHiddenPagination($builder);