<?php

namespace Modules\Commande\MenuContextuel;

use Entity\Model\Paravrac;
use Helpers\ChampsSupplementaire\ChampSupp;
use Helpers\Outil\MenuContextuel;
use Helpers\Outil\Sql;
use Helpers\Trad\ITrad;
use Helpers\Trad\Trad;
use Modules\Commande\Rules\GestionCommande;
use Modules\GlobalApplication\Repository\LicenceOxalys;
use Skeleton\Router;

class NotationMenuContextuel extends MenuContextuel
{
    /**
     * @var array<mixed> $droit
     */
    public $droit;

    /**
     * @param array<mixed> $droit
     */
    public function __construct(\PDO $pdo, Router $router, ITrad $trad, $droit)
    {
        parent::__construct($pdo, $router, $trad);
        
        $this->droit = $droit;
    }

    /**
     * @param array<mixed> $obj
     * @return array<mixed>
     */
    public function generate($obj)
    {
        $menuContextuel = [];

        $menuContextuel['listeSecondaire'][] = [
            'libelle' => $this->trad->t('Visualiser'),
            'lien' => $this->router->generateUri('Commande.Commande.article', ['idCommande' => $obj['NO_CDE']]),
            'lienJs' => false,
        ];

        $menuContextuel['listeSecondaire'][] = [
            'libelle' => $this->trad->t('Suivi'),
            'lien' => $this->router->generateUri('Commande.Event.suivi', ['idCommande' => $obj['NO_CDE']]),
            'lienJs' => false,
        ];

        return $menuContextuel;
    }
}
