浏览代码

listing

packProduct
Charly 3 年前
父节点
当前提交
2d32718274
共有 3 个文件被更改,包括 38 次插入33 次删除
  1. +22
    -22
      Controller/PointSale/PointSaleAdminController.php
  2. +14
    -11
      Controller/Product/ProductCategoryAdminController.php
  3. +2
    -0
      Resources/translations/admin.fr.yaml

+ 22
- 22
Controller/PointSale/PointSaleAdminController.php 查看文件

@@ -3,6 +3,8 @@
namespace Lc\CaracoleBundle\Controller\PointSale;

use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField;
use EasyCorp\Bundle\EasyAdminBundle\Field\MoneyField;
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use Lc\CaracoleBundle\Container\PointSale\PointSaleContainer;
@@ -13,6 +15,7 @@ use Lc\CaracoleBundle\Resolver\MerchantResolver;
use Lc\SovBundle\Controller\AbstractAdminController;
use Lc\SovBundle\Field\BooleanField;
use Lc\SovBundle\Field\StatusField;
use Lc\SovBundle\Field\ToggleField;

abstract class PointSaleAdminController extends AbstractAdminController
{
@@ -20,34 +23,31 @@ abstract class PointSaleAdminController extends AbstractAdminController

public function configureFields(string $pageName): iterable
{

return array_merge(
[
FormField::addPanel('general'),
TextField::new('title'),
NumberField::new('orderAmountMin')
->setCustomOption('appendHtml','€')
->hideOnIndex(),
NumberField::new('deliveryPrice')
->setCustomOption('appendHtml','€')
->hideOnIndex(),
BooleanField::new('isPublic'),
BooleanField::new('isDepository'),
StatusField::new('status')
->hideOnIndex(),
FormField::addPanel('address'),
AddressField::new('address')
->setRequired(true)
],
$this->getSeoPanel(),
$this->getConfPanel(),
[
FormField::addPanel('general'),
IntegerField::new('id')->onlyOnIndex(),
TextField::new('title'),
MoneyField::new('orderAmountMin')->setCurrency('EUR'),
NumberField::new('deliveryPrice')
->setCustomOption('appendHtml', '€')
->hideOnIndex(),
StatusField::new('status'),
ToggleField::new('isPublic'),
ToggleField::new('isDepository'),
FormField::addPanel('address'),
AddressField::new('address')
->setRequired(true)
],
$this->getSeoPanel(),
$this->getConfPanel(),
);
}

public function createEntity(string $entityFqcn)
{
return $this->get(PointSaleContainer::class)
->getFactory()
->create($this->get(MerchantResolver::class)->getCurrent());
->getFactory()
->create($this->get(MerchantResolver::class)->getCurrent());
}
}

+ 14
- 11
Controller/Product/ProductCategoryAdminController.php 查看文件

@@ -7,6 +7,7 @@ use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
use EasyCorp\Bundle\EasyAdminBundle\Field\FormField;
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
use EasyCorp\Bundle\EasyAdminBundle\Field\DateTimeField;
use Lc\CaracoleBundle\Container\Order\OrderShopContainer;
use Lc\CaracoleBundle\Controller\AdminControllerTrait;
use Lc\CaracoleBundle\Field\Address\AddressField;
@@ -15,6 +16,7 @@ use Lc\SovBundle\Controller\AbstractAdminController;
use Lc\SovBundle\Field\BooleanField;
use Lc\SovBundle\Field\CKEditorField;
use Lc\SovBundle\Field\StatusField;
use Lc\SovBundle\Field\ToggleField;
use Lc\SovBundle\Translation\TranslatorAdmin;

abstract class ProductCategoryAdminController extends AbstractAdminController
@@ -24,18 +26,19 @@ abstract class ProductCategoryAdminController extends AbstractAdminController
public function configureFields(string $pageName): iterable
{
return array_merge(
[
FormField::addPanel('general'),
TextField::new('title'),
NumberField::new('position')->hideOnForm(),
AssociationField::new('parent'),
CKEditorField::new('description'),
BooleanField::new('saleStatus'),
StatusField::new('status'),
[
FormField::addPanel('general'),
TextField::new('title'),
NumberField::new('position')->hideOnForm(),
AssociationField::new('parent')->hideOnIndex(),
DateTimeField::new('createdAt')->setFormat('short'),
CKEditorField::new('description')->hideOnIndex(),
ToggleField::new('saleStatus'),
StatusField::new('status'),

],
$this->getSeoPanel(),
$this->getConfPanel()
],
$this->getSeoPanel(),
$this->getConfPanel()
);
}


+ 2
- 0
Resources/translations/admin.fr.yaml 查看文件

@@ -65,6 +65,8 @@ entity:
label_plurial: Points de vente
fields:
orderAmountMin: Montant minimum de commande
isPublic: Public
isDepository: Dépôt

Address:
fields:

正在加载...
取消
保存