feat: import work hours from SaaS and exchange signed time sheet
This commit is contained in:
1 parent
7cf39850e6
commit
1a7c272414
73 files changed
+10488
-72
No files matched your search
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Enum\WorkMonthStatus;
|
||||
use App\Model\WorkMonthFilterDto;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class WorkMonthFilterType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('teamerName', TextType::class, [
|
||||
'label' => 'Name',
|
||||
'required' => false,
|
||||
])
|
||||
// The day is irrelevant here; FirstDayOfMonthDateTransformer pins it to the 1st.
|
||||
->add('period', AbbreviatedDateType::class, [
|
||||
'label' => 'Monat',
|
||||
'required' => false,
|
||||
'years' => range((int) date('Y') + 1, (int) date('Y') - 5),
|
||||
])
|
||||
->add('statuses', MultiselectType::class, [
|
||||
'label' => 'Status',
|
||||
'required' => false,
|
||||
'empty_label' => 'nicht filtern',
|
||||
'choices' => WorkMonthStatus::cases(),
|
||||
'choice_label' => static fn (WorkMonthStatus $status) => $status->label(),
|
||||
'choice_value' => static fn (?WorkMonthStatus $status) => $status?->value,
|
||||
])
|
||||
->add('includeApproved', CheckboxType::class, [
|
||||
'label' => 'geprüfte Monate anzeigen',
|
||||
'required' => false,
|
||||
])
|
||||
->add('includeMismatchedOnly', CheckboxType::class, [
|
||||
'label' => 'nur Monate mit abweichenden Stunden',
|
||||
'required' => false,
|
||||
])
|
||||
// AbstractFilterHandler::handleRequest() branches on exactly these two names
|
||||
->add('apply', SubmitType::class, [
|
||||
'label' => 'filtern',
|
||||
])
|
||||
->add('reset', SubmitType::class, [
|
||||
'label' => 'reset',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => WorkMonthFilterDto::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Enum\WorkMonthStatus;
|
||||
use App\Model\WorkMonthReviewDto;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class WorkMonthReviewType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('status', ChoiceType::class, [
|
||||
'label' => 'Entscheidung',
|
||||
'expanded' => true,
|
||||
'placeholder' => false,
|
||||
// Only the two outcomes a review produces: "offen" and "eingereicht" are
|
||||
// states the teamer puts the month into, not the office.
|
||||
'choices' => [
|
||||
WorkMonthStatus::APPROVED->label() => WorkMonthStatus::APPROVED,
|
||||
WorkMonthStatus::REJECTED->label() => WorkMonthStatus::REJECTED,
|
||||
],
|
||||
'choice_value' => static fn (?WorkMonthStatus $status) => $status?->value,
|
||||
])
|
||||
->add('comment', TextareaType::class, [
|
||||
'label' => 'Kommentar/Begründung',
|
||||
'required' => false,
|
||||
'attr' => [
|
||||
'rows' => 3,
|
||||
],
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => WorkMonthReviewDto::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user