|
- <?php
-
-
-
- use common\helpers\GlobalParam;
- use common\helpers\Price;
- use domain\Order\Order\Order;
- use domain\Producer\Producer\ProducerModule;
- use domain\User\User\User;
- use domain\User\User\UserModule;
- use domain\User\UserProducer\UserProducer;
- use domain\User\UserProducer\UserProducerModule;
- use yii\grid\GridView;
- use yii\helpers\Html;
- use domain\User\UserGroup\UserGroupModule;
-
- $userModule = UserModule::getInstance();
- $producerModule = ProducerModule::getInstance();
- $userCurrent = GlobalParam::getCurrentUser();
- $userGroupModule = UserGroupModule::getInstance();
- $userProducerModule = UserProducerModule::getInstance();
-
- $this->setTitle('Déliverabilité des emails');
- $this->addBreadcrumb($this->getTitle());
-
- ?>
-
- <?= GridView::widget([
- 'dataProvider' => $dataProvider,
- 'filterModel' => $searchModel,
- 'summary' =>
- 'Affichage de <b>{begin, number}-{end, number}</b> sur <b>{totalCount, number}</b> {totalCount, plural, one{élément} other{éléments}}.',
- 'columns' => [
- [
- 'attribute' => 'username',
- 'label' => 'Nom',
- 'value' => function ($user) use ($userModule) {
- return $userModule->getUsername($user);
- }
- ],
- [
- 'attribute' => 'type',
- 'label' => 'Type',
- 'headerOptions' => ['class' => 'column-hide-on-mobile'],
- 'filterOptions' => ['class' => 'column-hide-on-mobile'],
- 'contentOptions' => ['class' => 'column-hide-on-mobile'],
- 'filter' => $userModule->getTypeChoicesArray(),
- 'value' => function ($user) use ($userModule) {
- return $userModule->getTypeLabel($user['type']);
- }
- ],
- [
- 'attribute' => 'contacts',
- 'header' => 'Contacts',
- 'format' => 'raw',
- 'headerOptions' => ['class' => 'column-hide-on-mobile'],
- 'filterOptions' => ['class' => 'column-hide-on-mobile'],
- 'contentOptions' => ['class' => 'column-hide-on-mobile'],
- 'value' => function ($user) {
- $html = '';
- if (strlen($user['phone'])) {
- $html .= $user['phone'];
- }
- if (strlen($user['phone']) && strlen($user['email'])) {
- $html .= '<br />';
- }
- if (strlen($user['email'])) {
- $html .= $user['email'];
- }
- return $html;
- }
- ],
- [
- 'attribute' => 'producers',
- 'label' => 'Profils',
- 'format' => 'raw',
- 'contentOptions' => ['class' => 'column-hide-on-mobile align-center'],
- 'value' => function ($user) use ($userProducerModule) {
- $html = '';
- $userProducersArray = $userProducerModule->getRepository()->findUserProducersByUser($user);
-
- foreach($userProducersArray as $userProducer) {
- $html .= '<a href="'.Yii::$app->urlManager->createUrl(['user-admin/redirect-update', 'idUserProducer' => $userProducer->id]).'" class="btn btn-default"><span class="glyphicon glyphicon-user"></span> '.$userProducer->producer->name.'</a> ';
- }
-
- return $html;
- }
- ]
- ],
- ]); ?>
|