Преглед на файлове

Simplifier la page utilisateurs dans le backend

Suppression des boutons d'action (create, update, delete) car le boulanger n'a pas à avoir de pouvoir d'action sur les données utilisateur + adaptation des droits dans le controller.

Suppression du bouton pointant vers la liste des emails car cette dernière ne fonctionne pas. A voir.
prodstable
keun преди 8 години
родител
ревизия
a9493725ef
променени са 2 файла, в които са добавени 10 реда и са изтрити 21 реда
  1. +8
    -2
      backend/controllers/UserController.php
  2. +2
    -19
      backend/views/user/index.php

+ 8
- 2
backend/controllers/UserController.php Целия файл

'allow' => true, 'allow' => true,
'roles' => ['@'], 'roles' => ['@'],
'matchCallback' => function ($rule, $action) { 'matchCallback' => function ($rule, $action) {
return Yii::$app->user->identity->status == USER::STATUS_ADMIN
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER;
if($action->actionMethod == 'actionIndex')
{
return Yii::$app->user->identity->status == USER::STATUS_ADMIN
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER ;
}
else {
return Yii::$app->user->identity->status == USER::STATUS_ADMIN ;
}
} }
] ]
], ],

+ 2
- 19
backend/views/user/index.php Целия файл

?> ?>
<div class="user-index"> <div class="user-index">


<h1><?= Html::encode($this->title) ?> <?= Html::a('Ajouter', ['create'], ['class' => 'btn btn-success']) ?> <?= Html::a('<span class="glyphicon glyphicon-envelope"></span> Liste des emails', ['mail'], ['class' => 'btn btn-default']) ?></h1>
<h1><?= Html::encode($this->title) ?></h1>


<?= GridView::widget([ <?= GridView::widget([
'dataProvider' => $dataProvider, 'dataProvider' => $dataProvider,
'nom', 'nom',
'prenom', 'prenom',
'telephone', 'telephone',
'email',
[
'class' => 'yii\grid\ActionColumn',
'template' => '{update} {delete}',
'headerOptions' => ['class' => 'actions'],
'buttons' => [
'update' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-pencil"></span> Modifier', $url, [
'title' => Yii::t('app', 'Modifier'), 'class' => 'btn btn-default'
]);
},
'delete' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-trash"></span> Suprimer', $url, [
'title' => Yii::t('app', 'Supprimer'), 'class' => 'btn btn-default'
]);
}
],
],
'email'
], ],
]); ?> ]); ?>



Loading…
Отказ
Запис