PlanificaitionLivraison : bien avancé sur le reporting des achats à faire, manque plus que le détail des commandes pour chaque produit
This commit is contained in:
@@ -2,8 +2,11 @@
|
||||
|
||||
namespace PlanificationLivraison\Hook;
|
||||
|
||||
use PlanificationLivraison\PlanificationLivraison;
|
||||
use Thelia\Core\Event\Hook\HookRenderEvent;
|
||||
use Thelia\Core\Hook\BaseHook;
|
||||
use Thelia\Core\Security\AccessManager;
|
||||
use Thelia\Core\Security\SecurityContext;
|
||||
|
||||
/**
|
||||
* Class BackHook
|
||||
@@ -11,10 +14,51 @@ use Thelia\Core\Hook\BaseHook;
|
||||
*/
|
||||
class BackHook extends BaseHook
|
||||
{
|
||||
protected $securityContext;
|
||||
|
||||
public function __construct(SecurityContext $securityContext)
|
||||
{
|
||||
$this->securityContext = $securityContext;
|
||||
}
|
||||
|
||||
|
||||
public function onModuleConfiguration(HookRenderEvent $event)
|
||||
{
|
||||
$module_id = self::getModule()->getModuleId();
|
||||
|
||||
$event->add($this->render("module_configuration.html", ['module_id' => $module_id]));
|
||||
}
|
||||
|
||||
public function onMainTopMenuTools(HookRenderEvent $event)
|
||||
{
|
||||
$isGranted = $this->securityContext->isGranted(
|
||||
["ADMIN"],
|
||||
[],
|
||||
[PlanificationLivraison::getModuleCode()],
|
||||
[AccessManager::VIEW]
|
||||
);
|
||||
|
||||
if ($isGranted) {
|
||||
$event->add($this->render("menu-hook.html", $event->getArguments()));
|
||||
}
|
||||
}
|
||||
|
||||
public function onAddJS(HookRenderEvent $event)
|
||||
{
|
||||
$datePickerJS = $this->addJS('assets/js/bootstrap-datepicker.js');
|
||||
$event->add($datePickerJS);
|
||||
|
||||
$frenchDatePickerJS = $this->addJS('assets/js/bootstrap-datepicker.fr.js');
|
||||
$event->add($frenchDatePickerJS);
|
||||
}
|
||||
|
||||
public function onAddCSS(HookRenderEvent $event)
|
||||
{
|
||||
$datePickerCSS = $this->addCSS('assets/css/bootstrap-datepicker3.css');
|
||||
$event->add($datePickerCSS);
|
||||
|
||||
$customCSS = $this->addCSS('assets/css/custom.css');
|
||||
$event->add($customCSS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user