Browse Source

Section : champs isOnlineFrontend

packProduct
Guillaume 2 years ago
parent
commit
940f0b2c7d
8 changed files with 35 additions and 4 deletions
  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 View File

->hideOnIndex(), ->hideOnIndex(),
BooleanField::new('isDefault'), BooleanField::new('isDefault'),
StatusField::new('status'), StatusField::new('status'),
BooleanField::new('isOnlineFrontend'),
], ],
$this->getSeoPanel(), $this->getSeoPanel(),
$this->getConfPanel(), $this->getConfPanel(),

+ 1
- 1
Controller/Section/SwitchSectionAdminController.php View File

class SwitchSectionAdminController extends AbstractController class SwitchSectionAdminController extends AbstractController
{ {
/** /**
* @Route("/admin/section/switch", name="carac_section_switch")
* @Route("/admin/section/switch", name="admin_section_switch")
*/ */
public function switchSection( public function switchSection(
Request $request, Request $request,

+ 17
- 0
Model/Section/SectionModel.php View File

*/ */
protected $pointSaleSections; protected $pointSaleSections;


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

public function __construct() public function __construct()
{ {
$this->orderShops = new ArrayCollection(); $this->orderShops = new ArrayCollection();


return $this; 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 View File

return $this->andWhereEqual('isDefault', $isDefault); return $this->andWhereEqual('isDefault', $isDefault);
} }



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


} }

+ 6
- 0
Repository/Section/SectionStore.php View File

// @TODO : à implémenter avec le nouveau système d'ouverture des commandes // @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 View File

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

+ 3
- 0
Resources/translations/admin.fr.yaml View File

Merchant: Merchant:
label: Marchand label: Marchand
label_plurial: Marchands label_plurial: Marchands

Section: Section:
label: Section label: Section
label_plurial: Sections label_plurial: Sections
cycle: Cycle de vente cycle: Cycle de vente
isDefault: Section par défaut isDefault: Section par défaut
cycleType: Cycle cycleType: Cycle
isOnlineFrontend: Visible sur le site

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

+ 1
- 1
Twig/FormTwigExtension.php View File

SwitchSectionFormType::class, SwitchSectionFormType::class,
null, null,
[ [
'action' => $this->urlGenerator->generate('carac_section_switch'),
'action' => $this->urlGenerator->generate('admin_section_switch'),
'attr' => ['class' => 'switch-section'], 'attr' => ['class' => 'switch-section'],
'section' => $section, 'section' => $section,
] ]

Loading…
Cancel
Save