No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

71 líneas
3.3KB

  1. <?php
  2. namespace Lc\CaracoleBundle\Definition\Field\Order;
  3. use EasyCorp\Bundle\EasyAdminBundle\Field\DateTimeField;
  4. use EasyCorp\Bundle\EasyAdminBundle\Field\Field;
  5. use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField;
  6. use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
  7. use EasyCorp\Bundle\EasyAdminBundle\Field\TextareaField;
  8. use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
  9. use Lc\CaracoleBundle\Context\MerchantContextTrait;
  10. use Lc\CaracoleBundle\Field\AssociationField;
  11. use Lc\SovBundle\Definition\Field\AbstractFieldDefinition;
  12. use Symfony\Component\Form\Extension\Core\Type\TextType;
  13. class OrderShopFieldDefinition extends AbstractFieldDefinition
  14. {
  15. use MerchantContextTrait;
  16. public function configureFieldsIndex(): array
  17. {
  18. return ['id'];
  19. }
  20. public function configurePanels(): array
  21. {
  22. return [];
  23. }
  24. public function configureFields(): array
  25. {
  26. return [
  27. 'id' => IntegerField::new('id', 'ID')->setSortable(true),
  28. 'userLastname' => TextareaField::new('user.lastname')->setSortable(true),
  29. //->setTemplatePath('@LcShop/backend/default/field/textorempty.html.twig'),
  30. 'userFirstname' => TextareaField::new('user.firstname')->setSortable(true),
  31. //->setTemplatePath('@LcShop/backend/default/field/textorempty.html.twig'),
  32. 'userEmail' => TextareaField::new('user.email')->setSortable(true),
  33. //->setTemplatePath('@LcShop/backend/default/field/user.html.twig'),
  34. 'total' => NumberField::new('total')
  35. ->setTemplatePath('@LcCaracole/admin/order/field/total.html.twig'),
  36. 'orderStatus' => AssociationField::new('orderStatus')->setSortable(true)
  37. ->setTemplatePath('@LcCaracole/admin/order/field/order_status.html.twig'),
  38. 'createdAt' => DateTimeField::new('createdAt')->setSortable(true),
  39. 'updatedAt' => DateTimeField::new('updatedAt')->setSortable(true),
  40. 'orderShopCreatedAt' => DateTimeField::new('orderShopCreatedAt')->setSortable(true),
  41. 'distribution' => AssociationField::new('distribution')
  42. ->setSortable(true)
  43. ->setCustomOption('filter_type', TextType::class)
  44. ->setCustomOption('filter_on', 'cycleNumber')
  45. ,
  46. 'cycleDeliveryId' => IntegerField::new('cycleDeliveryId')->setSortable(true),
  47. 'cycleId' => IntegerField::new('cycleId')->setSortable(true),
  48. 'deliveryType' => Field::new('deliveryType')->setSortable(true),
  49. //->setTemplatePath('@LcShop/backend/default/field/options_translatable.html.twig'),
  50. 'reference' => TextField::new('reference')->setSortable(true),
  51. 'complementaryOrderShops' => AssociationField::new('complementaryOrderShops')
  52. ->setFormTypeOption('mapped', false)
  53. ->setTemplatePath('@LcCaracole/admin/order/field/complementary.html.twig')
  54. ->setCustomOption('filter', false)
  55. ,
  56. 'orderPayments' => AssociationField::new('orderPayments')
  57. ->setTemplatePath('@LcCaracole/admin/order/field/order_payment.html.twig')
  58. ->setCustomOption('filter', false),
  59. 'user'=> AssociationField::new('user')->setSortable(true)
  60. ];
  61. }
  62. }