|
|
@@ -3,10 +3,14 @@ |
|
|
|
namespace Lc\SovBundle\Controller\Ticket; |
|
|
|
|
|
|
|
use App\Entity\Ticket\Ticket; |
|
|
|
use EasyCorp\Bundle\EasyAdminBundle\Config\Action; |
|
|
|
use EasyCorp\Bundle\EasyAdminBundle\Config\Actions; |
|
|
|
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; |
|
|
|
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\IntegerField; |
|
|
|
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; |
|
|
|
use Lc\SovBundle\Field\StatusField; |
|
|
|
use Lc\SovBundle\Model\Ticket\TicketInterface; |
|
|
@@ -22,16 +26,23 @@ abstract class TicketAdminController extends AbstractAdminController |
|
|
|
|
|
|
|
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(), |
|
|
|
IntegerField::new('id') |
|
|
|
->hideOnForm(), |
|
|
|
DateField::new('createdAt')->setFormat('short') |
|
|
|
->hideOnForm(), |
|
|
|
TextField::new('visitorFirstName') |
|
|
|
->setTemplatePath('@LcSov/admin/ticket/index-username.html.twig') |
|
|
|
->hideOnForm(), |
|
|
|
TextField::new('visitorEmail') |
|
|
|
->setTemplatePath('@LcSov/admin/ticket/index-email.html.twig') |
|
|
|
->hideOnForm(), |
|
|
|
AssociationField::new('user') |
|
|
|
->hideOnIndex(), |
|
|
|
TextField::new('subject'), |
|
|
|
TextField::new('lastMessage') |
|
|
|
->setTemplatePath('@LcSov/admin/ticket/index-lastmessage.html.twig') |
|
|
|
->hideOnForm(), |
|
|
|
ChoiceField::new('type') |
|
|
|
->autocomplete() |
|
|
|
->setChoices( |
|
|
@@ -40,7 +51,34 @@ abstract class TicketAdminController extends AbstractAdminController |
|
|
|
'entity.Ticket.fields.typeOptions.' . Ticket::TYPE_TECHNICAL_PROBLEM => Ticket::TYPE_TECHNICAL_PROBLEM, |
|
|
|
] |
|
|
|
), |
|
|
|
StatusField::new('status')->setRequired(false)->hideOnForm(), |
|
|
|
ChoiceField::new('status') |
|
|
|
->autocomplete() |
|
|
|
->setChoices( |
|
|
|
[ |
|
|
|
'entity.Ticket.fields.statusOptions.' . Ticket::TICKET_STATUS_OPEN => Ticket::TICKET_STATUS_OPEN, |
|
|
|
'entity.Ticket.fields.statusOptions.' . Ticket::TICKET_STATUS_BEING_PROCESSED => Ticket::TICKET_STATUS_BEING_PROCESSED, |
|
|
|
'entity.Ticket.fields.statusOptions.' . Ticket::TICKET_STATUS_CLOSED => Ticket::TICKET_STATUS_CLOSED, |
|
|
|
] |
|
|
|
) |
|
|
|
->setTemplatePath('@LcSov/admin/ticket/index-status.html.twig') |
|
|
|
->hideOnForm(), |
|
|
|
]; |
|
|
|
} |
|
|
|
|
|
|
|
// public function configureCrud(Crud $crud): Crud |
|
|
|
// { |
|
|
|
// $crud |
|
|
|
// ->overrideTemplate('layout', '@LcSov/admin/layout.html.twig'); |
|
|
|
//// ->overrideTemplate('layout', '@LcCaracole/adminlte/layout.html.twig'); |
|
|
|
// |
|
|
|
// return parent::configureCrud($crud); |
|
|
|
// } |
|
|
|
|
|
|
|
public function configureActions(Actions $actions): Actions |
|
|
|
{ |
|
|
|
$actions |
|
|
|
->add(Crud::PAGE_INDEX, Action::DETAIL); |
|
|
|
// ->remove(Crud::PAGE_EDIT, Action::EDIT); |
|
|
|
return parent::configureActions($actions); |
|
|
|
} |
|
|
|
} |