use Doctrine\ORM\QueryBuilder; | use Doctrine\ORM\QueryBuilder; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Collection\FieldCollection; | use EasyCorp\Bundle\EasyAdminBundle\Collection\FieldCollection; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Collection\FilterCollection; | use EasyCorp\Bundle\EasyAdminBundle\Collection\FilterCollection; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Config\KeyValueStore; | |||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface; | use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterMultipleMerchantsInterface; | use Lc\CaracoleBundle\Doctrine\Extension\FilterMultipleMerchantsInterface; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface; | use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface; | ||||
'user_merchant_factory' => UserMerchantFactory::class, | 'user_merchant_factory' => UserMerchantFactory::class, | ||||
]); | ]); | ||||
} | } | ||||
public function configureResponseParameters(KeyValueStore $responseParameters): KeyValueStore | |||||
{ | |||||
$responseParameters = parent::configureResponseParameters($responseParameters); | |||||
// affichage du filtre sur section | |||||
if($this->isInstanceOf(FilterSectionInterface::class)) { | |||||
$responseParameters->set('display_switch_section', true); | |||||
} | |||||
return $responseParameters; | |||||
} | |||||
public function createIndexQueryBuilder( | public function createIndexQueryBuilder( | ||||
SearchDto $searchDto, | SearchDto $searchDto, | ||||
EntityDto $entityDto, | EntityDto $entityDto, |
} | } | ||||
return $this->render( | return $this->render( | ||||
'@LcCaracole/admin/setting/edit_' . $type . '.html.twig', | |||||
[ | |||||
'resolver' => $resolver, | |||||
'setting_definition' => $settingDefinition, | |||||
'form' => $form->createView() | |||||
] | |||||
'@LcCaracole/admin/setting/edit_' . $type . '.html.twig', | |||||
[ | |||||
'display_switch_section' => ($type == 'section') ? true : false, | |||||
'resolver' => $resolver, | |||||
'setting_definition' => $settingDefinition, | |||||
'form' => $form->createView() | |||||
] | |||||
); | ); | ||||
} | } | ||||
} | } | ||||
*/ | */ | ||||
public function manageGlobal(Request $request) | public function manageGlobal(Request $request) | ||||
{ | { | ||||
$site = $this->siteRepository->findOneByDevAlias('default') ; | |||||
$site = $this->siteRepository->findOneByDevAlias('default'); | |||||
$form = $this->createForm(SiteSettingsFormType::class, $site); | $form = $this->createForm(SiteSettingsFormType::class, $site); | ||||
$form->handleRequest($request); | $form->handleRequest($request); | ||||
if ($form->isSubmitted() && $form->isValid()) { | if ($form->isSubmitted() && $form->isValid()) { | ||||
$this->em->update($site); | $this->em->update($site); | ||||
$this->em->flush(); | $this->em->flush(); | ||||
} | } | ||||
return $this->render( | return $this->render( | ||||
'@LcCaracole/admin/setting/edit_site.html.twig' , | |||||
'@LcCaracole/admin/setting/edit_site.html.twig', | |||||
[ | [ | ||||
'setting_definition' => $this->siteSettingDefinition, | 'setting_definition' => $this->siteSettingDefinition, | ||||
'form' => $form->createView() | 'form' => $form->createView() |
namespace Lc\CaracoleBundle\Controller\Ticket; | namespace Lc\CaracoleBundle\Controller\Ticket; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Config\KeyValueStore; | |||||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | use Lc\CaracoleBundle\Controller\AdminControllerTrait; | ||||
use Lc\SovBundle\Controller\Ticket\TicketAdminController as SovTicketAdminController; | use Lc\SovBundle\Controller\Ticket\TicketAdminController as SovTicketAdminController; | ||||
background-color: white; | background-color: white; | ||||
padding-top: 0px; | padding-top: 0px; | ||||
padding-bottom: 0px; | padding-bottom: 0px; | ||||
border-width: 2px; | |||||
border-width: 1px; | |||||
z-index: 1; | z-index: 1; | ||||
&.display-section-switch { | |||||
border-width: 2px; | |||||
} | |||||
ul.left { | ul.left { | ||||
position: relative; | position: relative; | ||||
top: 16px; | top: 16px; |
{{ parent() }} | {{ parent() }} | ||||
{% set section_current = section_resolver.getCurrent() %} | {% set section_current = section_resolver.getCurrent() %} | ||||
{% set is_display_switch_section = display_switch_section is defined and display_switch_section %} | |||||
<nav class="carac navbar navbar-expand navbar-light main-header" style="border-color: {{ section_current.color }};"> | |||||
<ul class="navbar-nav left"> | |||||
{% for section in carac_sections() %} | |||||
<li class="nav-item d-none d-sm-inline-block"> | |||||
{% set form_switch_section = carac_form_switch_section(section) %} | |||||
{% form_theme form_switch_section '@LcSov/adminlte/crud/form_theme.html.twig' %} | |||||
{{ form_start(form_switch_section) }} | |||||
{{ form(form_switch_section) }} | |||||
{{ form_end(form_switch_section) }} | |||||
</li> | |||||
{% endfor %} | |||||
</ul> | |||||
<nav class="carac navbar navbar-expand navbar-light main-header{% if is_display_switch_section %} display-section-switch{% endif %}" {% if is_display_switch_section %}style="border-color: {{ section_current.color }};"{% endif %}> | |||||
{% if is_display_switch_section %} | |||||
<ul class="navbar-nav left"> | |||||
{% for section in carac_sections() %} | |||||
<li class="nav-item d-none d-sm-inline-block"> | |||||
{% set form_switch_section = carac_form_switch_section(section) %} | |||||
{% form_theme form_switch_section '@LcSov/adminlte/crud/form_theme.html.twig' %} | |||||
{{ form_start(form_switch_section) }} | |||||
{{ form(form_switch_section) }} | |||||
{{ form_end(form_switch_section) }} | |||||
</li> | |||||
{% endfor %} | |||||
</ul> | |||||
{% endif %} | |||||
<ul class="navbar-nav ml-auto right"> | <ul class="navbar-nav ml-auto right"> | ||||
<li class="nav-item nav-switch-merchant"> | <li class="nav-item nav-switch-merchant"> | ||||
<i class="fa fa-store"></i> | <i class="fa fa-store"></i> |