feat: admin view listing a travel's mailing recipients from bpn-connect

This commit is contained in:
fromme committed 2026-10-14 12:32:23 +02:00
1 parent 63ffe0b0b4
commit e796dd01ee
10 files changed
+347

No files matched your search

@@ -0,0 +1,44 @@
<?php
declare(strict_types=1);
namespace App\Form\Admin;
use App\Form\Model\TravelMailingLookupDto;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* Submits as GET with an empty block prefix, so a lookup is the plain URL `?travelCode=…`
* and can be bookmarked or shared.
*
* @extends AbstractType<TravelMailingLookupDto>
*/
class TravelMailingLookupType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder->add('travelCode', TextType::class, [
'label' => 'Reisecode',
'attr' => [
'placeholder' => 'z. B. LPJMP281126',
],
]);
}
public function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'data_class' => TravelMailingLookupDto::class,
'method' => 'GET',
'csrf_protection' => false,
]);
}
public function getBlockPrefix(): string
{
return '';
}
}
+13
View File
@@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
namespace App\Form\Model;
use Symfony\Component\Validator\Constraints as Assert;
class TravelMailingLookupDto
{
#[Assert\NotBlank(message: 'Bitte einen Reisecode angeben.')]
public ?string $travelCode = null;
}