getUserModule();
$orderModule = $this->getOrderModule();
$userModule = $this->getUserModule();
$username = Html::encode($userModule->getSolver()->getUsername($user));
$this->setTitle($username.' (#'.$user->id.')') ;
$this->addBreadcrumb(['label' => 'Utilisateurs', 'url' => ['index']]) ;
$this->addBreadcrumb(['label' => $username]) ;
$this->addBreadcrumb('Messages') ;
?>
= $this->render('_menu_navigation', [
'action' => 'messages',
'user' => $user
]); ?>
Les messages envoyés ici sont affichés à l'utilisateur directement sur la boutique.
false
]); ?>
= $form->field($userMessageModel, 'message')->textarea(['rows' => 4]) ?>
= Html::submitButton($userMessageModel->isNewRecord ? 'Envoyer' : 'Modifier', ['class' => 'btn btn-primary', 'name' => 'save']) ?>
= GridView::widget([
'dataProvider' => $userMessagesDataProvider,
'columns' => [
[
'label' => 'Message',
'format' => 'raw',
'value' => function ($userMessage) {
return nl2br(Html::encode($userMessage->getMessage())).'
'.$userMessage->getCreatedAt()->format('\L\e d/m/Y à H:i').'';
}
],
[
'label' => 'Lu',
'format' => 'raw',
'value' => function ($userMessage) {
if($userMessage->getReadAt()) {
//return '
Oui';
return '
Oui'.$userMessage->getReadAt()->format('\L\e d/m/Y à H:i');
}
else {
return '
Non';
}
}
],
[
'class' => 'yii\grid\ActionColumn',
'template' => '{update} {delete}',
'headerOptions' => ['class' => 'column-actions'],
'contentOptions' => ['class' => 'column-actions'],
'buttons' => [
'update' => function ($url, $userMessage) {
return Html::a('
',
Yii::$app->urlManager->createUrl(['user/messages', 'id' => $userMessage->getUser()->id, 'idUserMessage' => $userMessage->id]),
[
'title' => 'Modifier',
'class' => 'btn btn-default'
]);
},
'delete' => function ($url, $userMessage) {
return Html::a('
',
Yii::$app->urlManager->createUrl(['user/message-delete', 'idUser' => $userMessage->getUser()->getId(), 'idUserMessage' => $userMessage->getId()]),
[
'title' => 'Supprimer',
'class' => 'btn btn-default'
]);
},
],
],
],
]); ?>