use EasyCorp\Bundle\EasyAdminBundle\Config\Assets; | use EasyCorp\Bundle\EasyAdminBundle\Config\Assets; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; | use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; | ||||
use Lc\SovBundle\Controller\Dashboard\DashboardAdminController as SovDashboardController ; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Config\UserMenu; | |||||
use Lc\SovBundle\Controller\Dashboard\DashboardAdminController as SovDashboardController; | |||||
use Symfony\Component\Security\Core\User\UserInterface; | |||||
class DashboardAdminAdminController extends SovDashboardController | class DashboardAdminAdminController extends SovDashboardController | ||||
{ | { | ||||
$crud | $crud | ||||
->overrideTemplate('layout', '@LcCaracole/adminlte/layout.html.twig'); | ->overrideTemplate('layout', '@LcCaracole/adminlte/layout.html.twig'); | ||||
return $crud ; | |||||
return $crud; | |||||
} | } | ||||
public function configureAssets(): Assets | public function configureAssets(): Assets | ||||
{ | { | ||||
$assets = parent::configureAssets(); // TODO: Change the autogenerated stub | $assets = parent::configureAssets(); // TODO: Change the autogenerated stub | ||||
$assets->addWebpackEncoreEntry('carac-common') ; | |||||
$assets->addWebpackEncoreEntry('carac-switch-merchant') ; | |||||
$assets->addWebpackEncoreEntry('carac-common'); | |||||
$assets->addWebpackEncoreEntry('carac-switch-merchant'); | |||||
return $assets ; | |||||
return $assets; | |||||
} | |||||
public function configureUserMenu(UserInterface $user): UserMenu | |||||
{ | |||||
return parent::configureUserMenu($user) | |||||
->setMenuItems( | |||||
[ | |||||
MenuItem::linkToRoute('Mon profil', 'fa fa-id-card', 'sov_admin_account_profile'), | |||||
MenuItem::linkToLogout('Déconnexion', 'sign-out-alt'), | |||||
] | |||||
); | |||||
} | } | ||||
} | } |
<?php | |||||
namespace Lc\CaracoleBundle\Factory; | |||||
use Doctrine\ORM\EntityManagerInterface; | |||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface; | |||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface; | |||||
use Lc\CaracoleBundle\Resolver\MerchantResolver; | |||||
use Lc\CaracoleBundle\Resolver\SectionResolver; | |||||
use Lc\SovBundle\Factory\AbstractFactory as SovAbstractFactory; | |||||
trait FactoryTrait | |||||
{ | |||||
protected $merchantResolver; | |||||
protected $sectionResolver; | |||||
public function __construct( | |||||
EntityManagerInterface $em, | |||||
MerchantResolver $merchantResolver, | |||||
SectionResolver $sectionResolver | |||||
) { | |||||
parent::__construct($em); | |||||
$this->merchantResolver = $merchantResolver; | |||||
$this->sectionResolver = $sectionResolver; | |||||
} | |||||
public function create($params = array()) | |||||
{ | |||||
$entityClass = $this->em->getEntityName($this->getEntityClass()); | |||||
$entity = new $entityClass; | |||||
if ($entity instanceof FilterMerchantInterface && !isset($params['merchant'])) { | |||||
$params['merchant'] = $this->merchantResolver->getCurrent(); | |||||
} | |||||
if ($entity instanceof FilterSectionInterface && !isset($params['section'])) { | |||||
$params['section'] = $this->sectionResolver->getCurrent(); | |||||
} | |||||
return parent::create($params); | |||||
} | |||||
} |
<?php | |||||
namespace Lc\CaracoleBundle\Factory\Reminder; | |||||
use Lc\CaracoleBundle\Factory\FactoryTrait; | |||||
use Lc\SovBundle\Factory\Reminder\ReminderFactory as SovReminderFactory; | |||||
class ReminderFactory extends SovReminderFactory | |||||
{ | |||||
use FactoryTrait; | |||||
} |
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface; | use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface; | |||||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | ||||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | |||||
use Lc\SovBundle\Model\Reminder\ReminderModel as SovReminderModel; | use Lc\SovBundle\Model\Reminder\ReminderModel as SovReminderModel; | ||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class ReminderModel extends SovReminderModel implements FilterMerchantInterface | |||||
abstract class ReminderModel extends SovReminderModel implements FilterMerchantInterface, FilterSectionInterface | |||||
{ | { | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface") | * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface") | ||||
*/ | */ | ||||
protected $merchant; | protected $merchant; | ||||
/** | |||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface") | |||||
*/ | |||||
protected $section; | |||||
public function getMerchant(): MerchantInterface | public function getMerchant(): MerchantInterface | ||||
{ | { | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getSection(): ?SectionInterface | |||||
{ | |||||
return $this->section; | |||||
} | |||||
public function setSection(?SectionInterface $section): self | |||||
{ | |||||
$this->section = $section; | |||||
return $this; | |||||
} | |||||
} | } |
<?php | |||||
namespace Lc\CaracoleBundle\Repository\Reminder; | |||||
use Lc\CaracoleBundle\Repository\RepositoryTrait; | |||||
use Lc\SovBundle\Model\Reminder\ReminderInterface; | |||||
use Lc\SovBundle\Repository\Reminder\ReminderRepository as SovReminderRepository; | |||||
/** | |||||
* @method ReminderInterface|null find($id, $lockMode = null, $lockVersion = null) | |||||
* @method ReminderInterface|null findOneBy(array $criteria, array $orderBy = null) | |||||
* @method ReminderInterface[] findAll() | |||||
* @method ReminderInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | |||||
*/ | |||||
class ReminderRepository extends SovReminderRepository | |||||
{ | |||||
use RepositoryTrait; | |||||
} |
padding-top: 0px; | padding-top: 0px; | ||||
padding-bottom: 0px; | padding-bottom: 0px; | ||||
border-width: 2px; | border-width: 2px; | ||||
z-index: 1; | |||||
ul.left { | ul.left { | ||||
position: relative; | position: relative; |