getUserCurrent(); $this->setTitle('Support'); $this->addBreadcrumb($this->getTitle()); ?>
Me contacter directement
parameterBag->get('adminPhoneNumber'); ?>

parameterBag->get('appointmentUrl'), ['class' => 'btn btn-sm btn-default', 'target' => '_blank']); ?>

'btn btn-sm btn-default']); ?>
'created_at', 'headerOptions' => ['class' => 'td-created-at column-hide-on-mobile'], 'value' => function ($ticket) { return date('d/m/Y', strtotime($ticket->created_at)); } ]; $columnSubject = [ 'attribute' => 'subject', 'headerOptions' => ['class' => 'td-subject'], 'format' => 'raw', 'value' => function ($ticket) use ($ticketManager, $userCurrent) { if($ticketManager->isTicketUnread($ticket, $userCurrent)) { $firstTicketMessageUnread = $ticketManager->getFirstTicketMessageUnread($ticket, $userCurrent); $link = ''.Html::a($ticket->subject, ['view', 'id' => $ticket->id, '#' => $firstTicketMessageUnread->id]).''; } else { $link = Html::a($ticket->subject, ['view', 'id' => $ticket->id]); } return $link; } ]; $columnLastMessage = [ 'label' => 'Dernier message', 'headerOptions' => ['class' => 'td-last-message column-hide-on-mobile'], 'value' => function ($ticket) { $ticketMessages = $ticket->ticketMessages; if ($ticketMessages && is_array($ticketMessages)) { $lastTicketMessage = end($ticketMessages); $origin = date_create(date('Y-m-d', strtotime($lastTicketMessage->created_at))); $target = date_create(); $interval = date_diff($origin, $target); $days = (int)$interval->format('%R%a'); if ($days == 0) { return "Aujourd'hui"; } elseif ($days == 1) { return "Hier"; } else { return $days . ' jours'; } } return ''; } ]; $columnMessages = [ 'label' => 'Messages', 'headerOptions' => ['class' => 'td-messages column-hide-on-mobile'], 'value' => function ($ticket) { return count($ticket->ticketMessages); } ]; $columnButtonActions = [ 'class' => 'yii\grid\ActionColumn', 'template' => '{view} {close-open}', 'headerOptions' => ['class' => 'column-actions'], 'contentOptions' => ['class' => 'column-actions'], 'buttons' => [ 'view' => function ($url, $ticket) { $url = ['view', 'id' => $ticket->id]; return Html::a('', $url, [ 'title' => 'Voir le ticket', 'class' => 'btn btn-default' ]); }, 'close-open' => function ($url, $ticket) use ($ticketManager) { if ($ticketManager->isTicketOpen($ticket)) { $title = 'Fermer'; $url = ['close', 'id' => $ticket->id]; $glyphicon = 'glyphicon-folder-close'; } else { $title = 'Ré-ouvrir'; $url = ['open', 'id' => $ticket->id]; $glyphicon = 'glyphicon-folder-open'; } return Html::a('', $url, [ 'title' => $title, 'class' => 'btn btn-default' ]); } ], ]; $columnProducer = [ 'attribute' => 'id_producer', 'headerOptions' => ['class' => 'td-producer'], 'value' => function ($ticket) { return $ticket->producer->name; } ]; if($context == 'producer') { $columns = [ $columnCreatedAt, $columnSubject, $columnLastMessage, $columnMessages, $columnButtonActions ]; } elseif($context == 'admin') { $columns = [ $columnCreatedAt, $columnProducer, $columnSubject, $columnLastMessage, $columnMessages, $columnButtonActions ]; } $optionsGridView = [ 'summary' => '', 'filterModel' => $searchTicket, 'dataProvider' => $dataProviderTicket, 'columns' => $columns, ]; return GridView::widget($optionsGridView); } ?>