|
|
|
|
|
|
|
|
|
|
|
|
|
|
], |
|
|
], |
|
|
]); |
|
|
]); |
|
|
|
|
|
|
|
|
$menuItems = [ |
|
|
$menuItems = [ |
|
|
[ |
|
|
[ |
|
|
'label' => '<span class="glyphicon glyphicon-calendar"></span> Commandes', |
|
|
'label' => '<span class="glyphicon glyphicon-calendar"></span> Commandes', |
|
|
|
|
|
|
|
|
'visible'=> !Yii::$app->user->isGuest, |
|
|
'visible'=> !Yii::$app->user->isGuest, |
|
|
'items' => [ |
|
|
'items' => [ |
|
|
[ |
|
|
[ |
|
|
'label' => '<span class="glyphicon glyphicon-calendar"></span> Commandes par production', |
|
|
|
|
|
|
|
|
'label' => '<span class="glyphicon glyphicon-calendar"></span> Toutes les commandes', |
|
|
'url' => ['/commande/index'], |
|
|
'url' => ['/commande/index'], |
|
|
'visible' => !Yii::$app->user->isGuest |
|
|
'visible' => !Yii::$app->user->isGuest |
|
|
], |
|
|
], |
|
|
|
|
|
|
|
|
], |
|
|
], |
|
|
] |
|
|
] |
|
|
], |
|
|
], |
|
|
['label' => '<span class="glyphicon glyphicon-grain"></span> Produits', 'url' => ['/produit/index'], 'visible'=> !Yii::$app->user->isGuest], |
|
|
|
|
|
['label' => '<span class="glyphicon glyphicon-map-marker"></span> Points de vente', 'url' => ['/point-vente/index'], 'visible'=> !Yii::$app->user->isGuest], |
|
|
|
|
|
['label' => '<span class="glyphicon glyphicon-user"></span> Utilisateurs', 'url' => ['/user/index'], 'visible'=> !Yii::$app->user->isGuest], |
|
|
|
|
|
['label' => '<span class="glyphicon glyphicon-cog"></span> Paramètres', 'url' => ['/etablissement/update'], 'visible'=> !Yii::$app->user->isGuest], |
|
|
|
|
|
['label' => '<span class="glyphicon glyphicon-bullhorn"></span> Communiquer', 'url' => ['/communiquer/index'], 'visible'=> !Yii::$app->user->isGuest], |
|
|
|
|
|
|
|
|
[ |
|
|
|
|
|
'label' => '<span class="glyphicon glyphicon-grain"></span> Produits', |
|
|
|
|
|
'url' => ['/produit/index'], |
|
|
|
|
|
'visible'=> !Yii::$app->user->isGuest |
|
|
|
|
|
], |
|
|
|
|
|
[ |
|
|
|
|
|
'label' => '<span class="glyphicon glyphicon-map-marker"></span> Points de vente', |
|
|
|
|
|
'url' => ['/point-vente/index'], |
|
|
|
|
|
'visible'=> !Yii::$app->user->isGuest |
|
|
|
|
|
], |
|
|
|
|
|
[ |
|
|
|
|
|
'label' => '<span class="glyphicon glyphicon-user"></span> Utilisateurs', |
|
|
|
|
|
'url' => ['/user/index'], |
|
|
|
|
|
'visible'=> !Yii::$app->user->isGuest |
|
|
|
|
|
], |
|
|
|
|
|
[ |
|
|
|
|
|
'label' => '<span class="glyphicon glyphicon-plus"></span>', |
|
|
|
|
|
'url' => ['/etablissement/update'], |
|
|
|
|
|
'visible'=> !Yii::$app->user->isGuest, |
|
|
|
|
|
'items' => [ |
|
|
|
|
|
[ |
|
|
|
|
|
'label' => '<span class="glyphicon glyphicon-cog"></span> Paramètres', |
|
|
|
|
|
'url' => ['/etablissement/update'], |
|
|
|
|
|
'visible'=> !Yii::$app->user->isGuest |
|
|
|
|
|
], |
|
|
|
|
|
[ |
|
|
|
|
|
'label' => '<span class="glyphicon glyphicon-bullhorn"></span> Communiquer', |
|
|
|
|
|
'url' => ['/communiquer/index'], |
|
|
|
|
|
'visible'=> !Yii::$app->user->isGuest |
|
|
|
|
|
], |
|
|
|
|
|
[ |
|
|
|
|
|
'label' => '<span class="glyphicon glyphicon-euro"></span> Facturation', |
|
|
|
|
|
'url' => ['/etablissement/facturation'], |
|
|
|
|
|
'visible'=> !Yii::$app->user->isGuest, |
|
|
|
|
|
] |
|
|
|
|
|
], |
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
if (Yii::$app->user->isGuest) { |
|
|
if (Yii::$app->user->isGuest) { |
|
|
$menuItems[] = ['label' => 'Connexion', 'url' => ['/site/login']]; |
|
|
$menuItems[] = ['label' => 'Connexion', 'url' => ['/site/login']]; |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
|
|
|
|
|
|
if(Yii::$app->user->identity->status == USER::STATUS_ADMIN) |
|
|
|
|
|
{ |
|
|
|
|
|
$menuItems[] = [ |
|
|
|
|
|
'label' => '<span class="glyphicon glyphicon-asterisk"></span>', |
|
|
|
|
|
'url' => '#', |
|
|
|
|
|
'items' => [ |
|
|
|
|
|
[ |
|
|
|
|
|
'label' => '<span class="glyphicon glyphicon-th-list"></span> Boulangeries', |
|
|
|
|
|
'url' => ['/etablissement/index'], |
|
|
|
|
|
'visible'=> !Yii::$app->user->isGuest, |
|
|
|
|
|
], |
|
|
|
|
|
[ |
|
|
|
|
|
'label' => '<span class="glyphicon glyphicon-euro"></span> Facturation', |
|
|
|
|
|
'url' => ['/etablissement/facturation-admin'], |
|
|
|
|
|
'visible'=> !Yii::$app->user->isGuest, |
|
|
|
|
|
], |
|
|
|
|
|
] |
|
|
|
|
|
] ; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
$menuItems[] = [ |
|
|
$menuItems[] = [ |
|
|
'label' => '<span class="glyphicon glyphicon-off"></span> Déconnexion', |
|
|
|
|
|
|
|
|
'label' => '<span class="glyphicon glyphicon-off"></span>', |
|
|
'url' => ['/site/logout'], |
|
|
'url' => ['/site/logout'], |
|
|
'linkOptions' => ['data-method' => 'post'] |
|
|
|
|
|
|
|
|
'linkOptions' => ['data-method' => 'post','title' => 'Déconnexion'] |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
if(Yii::$app->getRequest()->serverName == 'localhost') |
|
|
if(Yii::$app->getRequest()->serverName == 'localhost') |