|
- <?php
-
-
- use common\components\View;
- use domain\Communication\AutomaticEmail\AutomaticEmail;
- use yii\helpers\Html;
- use yii\grid\GridView;
-
-
-
- $this->setTitle('Emails automatiques');
- $this->addBreadcrumb($this->getTitle());
- $this->addButton(['label' => 'Nouvel email automatique <span class="glyphicon glyphicon-plus"></span>', 'url' => 'automatic-email/create', 'class' => 'btn btn-primary']);
-
- ?>
-
- <div class="automatic-email-index">
- <?= GridView::widget([
- 'dataProvider' => $dataProvider,
- 'columns' => [
- [
- 'attribute' => 'id_point_sale',
- 'format' => 'raw',
- 'value' => function(AutomaticEmail $automaticEmail) {
- if(!$automaticEmail->getPointSale()) {
- return '<span class="label label-default">Tous</span>';
- }
-
- return $automaticEmail->getPointSale()->getName();
- }
- ],
- [
- 'attribute' => 'day',
- 'value' => function(AutomaticEmail $automaticEmail) {
- return $automaticEmail->getDayAsString();
- }
- ],
- [
- 'attribute' => 'delay_before_distribution',
- 'value' => function(AutomaticEmail $automaticEmail) {
- return $automaticEmail->getDelayBeforeDistributionAsString();
- }
- ],
- [
- 'attribute' => 'sending_day',
- 'value' => function(AutomaticEmail $automaticEmail) {
- return $automaticEmail->getSendingDayAsString();
- }
- ],
- [
- 'attribute' => 'sending_hour',
- 'value' => function(AutomaticEmail $automaticEmail) {
- return $automaticEmail->getSendingHour().'h';
- }
- ],
- 'subject',
- [
- 'attribute' => 'message',
- 'format' => 'raw',
- ],
- [
- 'attribute' => 'status',
- 'format' => 'raw',
- 'value' => function(AutomaticEmail $automaticEmail) {
- return $automaticEmail->getStatusAsHtml();
- }
- ],
- [
- 'class' => 'yii\grid\ActionColumn',
- 'template' => '{update} {delete}',
- 'headerOptions' => ['class' => 'column-actions'],
- 'contentOptions' => ['class' => 'column-actions'],
- 'buttons' => [
- 'update' => function ($url, $model) {
- return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, [
- 'title' => 'Modifier', 'class' => 'btn btn-default'
- ]);
- },
- 'delete' => function ($url, $model) {
- return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [
- 'title' => 'Supprimer', 'class' => 'btn btn-default'
- ]);
- }
- ],
- ],
- ],
- ]); ?>
- </div>
|