浏览代码

Section : champs isOnlineFrontend

packProduct
Guillaume 2 年前
父节点
当前提交
940f0b2c7d
共有 8 个文件被更改,包括 35 次插入4 次删除
  1. +1
    -0
      Controller/Section/SectionAdminController.php
  2. +1
    -1
      Controller/Section/SwitchSectionAdminController.php
  3. +17
    -0
      Model/Section/SectionModel.php
  4. +5
    -1
      Repository/Section/SectionRepositoryQuery.php
  5. +6
    -0
      Repository/Section/SectionStore.php
  6. +1
    -1
      Resolver/SectionResolver.php
  7. +3
    -0
      Resources/translations/admin.fr.yaml
  8. +1
    -1
      Twig/FormTwigExtension.php

+ 1
- 0
Controller/Section/SectionAdminController.php 查看文件

@@ -55,6 +55,7 @@ abstract class SectionAdminController extends AbstractAdminController
->hideOnIndex(),
BooleanField::new('isDefault'),
StatusField::new('status'),
BooleanField::new('isOnlineFrontend'),
],
$this->getSeoPanel(),
$this->getConfPanel(),

+ 1
- 1
Controller/Section/SwitchSectionAdminController.php 查看文件

@@ -14,7 +14,7 @@ use Symfony\Component\Routing\Annotation\Route;
class SwitchSectionAdminController extends AbstractController
{
/**
* @Route("/admin/section/switch", name="carac_section_switch")
* @Route("/admin/section/switch", name="admin_section_switch")
*/
public function switchSection(
Request $request,

+ 17
- 0
Model/Section/SectionModel.php 查看文件

@@ -102,6 +102,11 @@ abstract class SectionModel extends AbstractFullEntity implements FilterMerchant
*/
protected $pointSaleSections;

/**
* @ORM\Column(type="boolean", nullable=true)
*/
protected $isOnlineFrontend;

public function __construct()
{
$this->orderShops = new ArrayCollection();
@@ -441,4 +446,16 @@ abstract class SectionModel extends AbstractFullEntity implements FilterMerchant

return $this;
}

public function getIsOnlineFrontend(): ?bool
{
return $this->isOnlineFrontend;
}

public function setIsOnlineFrontend(?bool $isOnlineFrontend): self
{
$this->isOnlineFrontend = $isOnlineFrontend;

return $this;
}
}

+ 5
- 1
Repository/Section/SectionRepositoryQuery.php 查看文件

@@ -20,6 +20,10 @@ class SectionRepositoryQuery extends AbstractRepositoryQuery
return $this->andWhereEqual('isDefault', $isDefault);
}


public function filterIsOnlineFrontend()
{
return $this->filterIsOnline()
&& $this->andWhereEqual('isOnlineFrontend', true);
}

}

+ 6
- 0
Repository/Section/SectionStore.php 查看文件

@@ -75,5 +75,11 @@ class SectionStore extends AbstractStore
// @TODO : à implémenter avec le nouveau système d'ouverture des commandes
}

public function getOnlineFrontend($query = null)
{
$query = $this->createDefaultQuery($query);
$query->filterIsOnlineFrontend();
return $query->find();
}

}

+ 1
- 1
Resolver/SectionResolver.php 查看文件

@@ -94,7 +94,7 @@ class SectionResolver
if (isset($requestAttributesArray['section'])) {
$sectionCurrent = $sectionStore
->setMerchant($merchantCurrent)
->getOneBySlug($requestAttributesArray['section'], false);
->getOneBySlug($requestAttributesArray['section']);
if($sectionCurrent===null){
throw new NotFoundHttpException('Aucun espace n\'a été trouvé');
}

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

@@ -112,6 +112,7 @@ entity:
Merchant:
label: Marchand
label_plurial: Marchands

Section:
label: Section
label_plurial: Sections
@@ -119,6 +120,8 @@ entity:
cycle: Cycle de vente
isDefault: Section par défaut
cycleType: Cycle
isOnlineFrontend: Visible sur le site

TaxRate:
label: Règle de taxe
label_plurial: Règles de taxes

+ 1
- 1
Twig/FormTwigExtension.php 查看文件

@@ -54,7 +54,7 @@ class FormTwigExtension extends AbstractExtension
SwitchSectionFormType::class,
null,
[
'action' => $this->urlGenerator->generate('carac_section_switch'),
'action' => $this->urlGenerator->generate('admin_section_switch'),
'attr' => ['class' => 'switch-section'],
'section' => $section,
]

正在加载...
取消
保存