context->getProducerCurrent();
$this->setTitle($producerModule->getSolver()->getPointSaleWording($producer));
$this->setPageTitle($producerModule->getSolver()->getPointSaleWording($producer));
$this->setMeta('description', $producerModule->getSeoGenerator()->generateMetaDescriptionPointsSale());
?>
= GridView::widget([
'dataProvider' => $dataProviderPointsSale,
'summary' => '',
'columns' => [
[
'attribute' => 'name',
'format' => 'raw',
'contentOptions' => ['class' => 'name'],
'value' => function ($model) use ($pointSaleModule) {
$html = '
' . Html::encode($model->name) . '';
if (strlen($model->locality)) {
$html .= '
' . $pointSaleModule->getSolver()->getLocalityWithAddressTooltip($model);
}
return $html;
}
],
[
'label' => 'Informations',
'format' => 'raw',
'contentOptions' => ['class' => 'days'],
'value' => function ($model) use ($distributionModule) {
$producer = \Yii::$app->controller->getProducerCurrent();
if ($producer->behavior_home_point_sale_day_list == Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_WEEK) {
$arrayDays = [
'monday' => 'Lundi',
'tuesday' => 'Mardi',
'wednesday' => 'Mercredi',
'thursday' => 'Jeudi',
'friday' => 'Vendredi',
'saturday' => 'Samedi',
'sunday' => 'Dimanche'
];
$html = '';
foreach ($arrayDays as $dayEn => $dayFr) {
$fieldDelivery = 'delivery_' . $dayEn;
$fieldInfos = 'infos_' . $dayEn;
if ($model->$fieldDelivery) {
$html .= '
' . $dayFr . '';
if (strlen($model->$fieldInfos)) {
$html .= '
' . nl2br(str_replace(['[select_previous_day]', '[/select_previous_day]'], '', $model->$fieldInfos)) . '';
}
$html .= '
';
}
}
return $html;
} elseif ($producer->behavior_home_point_sale_day_list == Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_INCOMING_DISTRIBUTIONS) {
$html = '';
$incomingDistributions = $distributionModule->findDistributionsIncoming();
$cpt = 0;
foreach ($incomingDistributions as $distribution) {
$countPointSaleDistribution = PointSaleDistribution::searchCount([
'id_distribution' => $distribution->id,
'id_point_sale' => $model->id,
'delivery' => 1
]);
if ($countPointSaleDistribution) {
$html .= strftime('%A %d %B', strtotime($distribution->date)) . '
';
}
$cpt++;
}
return $html;
}
}
]
],
]); ?>