|
|
@@ -38,6 +38,7 @@ AppAsset::register($this); |
|
|
|
|
|
|
|
], |
|
|
|
]); |
|
|
|
|
|
|
|
$menuItems = [ |
|
|
|
[ |
|
|
|
'label' => '<span class="glyphicon glyphicon-calendar"></span> Commandes', |
|
|
@@ -45,7 +46,7 @@ AppAsset::register($this); |
|
|
|
'visible'=> !Yii::$app->user->isGuest, |
|
|
|
'items' => [ |
|
|
|
[ |
|
|
|
'label' => '<span class="glyphicon glyphicon-calendar"></span> Commandes par production', |
|
|
|
'label' => '<span class="glyphicon glyphicon-calendar"></span> Toutes les commandes', |
|
|
|
'url' => ['/commande/index'], |
|
|
|
'visible' => !Yii::$app->user->isGuest |
|
|
|
], |
|
|
@@ -56,19 +57,74 @@ AppAsset::register($this); |
|
|
|
], |
|
|
|
] |
|
|
|
], |
|
|
|
['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) { |
|
|
|
$menuItems[] = ['label' => 'Connexion', 'url' => ['/site/login']]; |
|
|
|
} 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[] = [ |
|
|
|
'label' => '<span class="glyphicon glyphicon-off"></span> Déconnexion', |
|
|
|
'label' => '<span class="glyphicon glyphicon-off"></span>', |
|
|
|
'url' => ['/site/logout'], |
|
|
|
'linkOptions' => ['data-method' => 'post'] |
|
|
|
'linkOptions' => ['data-method' => 'post','title' => 'Déconnexion'] |
|
|
|
]; |
|
|
|
|
|
|
|
if(Yii::$app->getRequest()->serverName == 'localhost') |