|
- <?php
-
- namespace Lc\SovBundle\Controller\Ticket;
-
- use App\Entity\Ticket\Ticket;
- use EasyCorp\Bundle\EasyAdminBundle\Config\Filters;
- use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\DateField;
- use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
- use Lc\SovBundle\Field\StatusField;
- use Lc\SovBundle\Model\Ticket\TicketInterface;
- use Lc\SovBundle\Controller\AbstractAdminController;
-
- abstract class TicketAdminController extends AbstractAdminController
- {
-
- public static function getEntityFqcn(): string
- {
- return TicketInterface::class;
- }
-
- public function configureFields(string $pageName): iterable
- {
-
- return [
- TextField::new('id')->hideOnForm(),
- DateField::new('createdAt')->setFormat('short')->hideOnForm(),
- TextField::new('visitorFirstName')->hideOnForm(),
- TextField::new('visitorLastName')->hideOnForm(),
- TextField::new('visitorEmail')->hideOnForm(),
- AssociationField::new('user')
- ->hideOnIndex(),
- TextField::new('subject'),
- ChoiceField::new('type')
- ->autocomplete()
- ->setChoices(
- [
- 'entity.Ticket.fields.typeOptions.' . Ticket::TYPE_GENERAL_QUESTION => Ticket::TYPE_GENERAL_QUESTION,
- 'entity.Ticket.fields.typeOptions.' . Ticket::TYPE_TECHNICAL_PROBLEM => Ticket::TYPE_TECHNICAL_PROBLEM,
- ]
- ),
- StatusField::new('status')->setRequired(false)->hideOnForm(),
- ];
- }
- }
|