|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?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(),
- ];
- }
- }
|