Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

41 lines
1.3KB

  1. <?php
  2. namespace Lc\CaracoleBundle\Controller\Ticket;
  3. use EasyCorp\Bundle\EasyAdminBundle\Config\Actions;
  4. use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
  5. use Lc\CaracoleBundle\Controller\AdminControllerTrait;
  6. use Lc\CaracoleBundle\Definition\ActionDefinition;
  7. use Lc\SovBundle\Controller\Ticket\TicketAdminController as SovTicketAdminController;
  8. abstract class TicketAdminController extends SovTicketAdminController
  9. {
  10. use AdminControllerTrait;
  11. public function createEntity(string $entityFqcn)
  12. {
  13. return $this->getTicketContainer()
  14. ->getFactory()
  15. ->setSection($this->getSectionCurrent())
  16. ->setMerchant($this->getMerchantCurrent())
  17. ->create();
  18. }
  19. public function configureFields(string $pageName): iterable
  20. {
  21. return $this->getTicketContainer()->getFieldDefinition()
  22. ->setMerchant($this->getMerchantCurrent())
  23. ->setSection($this->getSectionCurrent())
  24. ->getFields($pageName);
  25. }
  26. public function configureActions(Actions $actions): Actions
  27. {
  28. $actions = parent::configureActions($actions);
  29. $actions->disable( ActionDefinition::EDIT, ActionDefinition::DUPLICATE,ActionDefinition::DUPLICATE_TO_OTHER_SECTION, ActionDefinition::DELETE);
  30. return $actions;
  31. }
  32. }