setTitle('Emails automatiques');
$this->addBreadcrumb($this->getTitle());
$this->addButton(['label' => 'Nouvel email automatique ', 'url' => 'automatic-email/create', 'class' => 'btn btn-primary']);
?>
= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
[
'attribute' => 'id_point_sale',
'format' => 'raw',
'value' => function(AutomaticEmail $automaticEmail) {
if(!$automaticEmail->getPointSale()) {
return 'Tous';
}
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('', $url, [
'title' => 'Modifier', 'class' => 'btn btn-default'
]);
},
'delete' => function ($url, $model) {
return Html::a('', $url, [
'title' => 'Supprimer', 'class' => 'btn btn-default'
]);
}
],
],
],
]); ?>