|
- <?php
-
- use common\logic\Ticket\Ticket\Wrapper\TicketManager;
- use common\logic\User\User\Wrapper\UserManager;
- use yii\helpers\Html;
- use yii\widgets\ActiveForm;
-
- $ticketManager = TicketManager::getInstance();
- $userManager = UserManager::getInstance();
- $this->setTitle('Voir un ticket');
- $this->addBreadcrumb(['label' => 'Support', 'url' => ['index']]);
- $this->addBreadcrumb('Voir un ticket');
-
- ?>
- <div class="ticket-view">
- <div class="box box-solid">
- <div class="box-body">
- <table class="table">
- <tbody>
- <tr>
- <td><strong>Sujet</strong></td>
- <td><?= Html::encode($ticket->subject); ?></td>
- </tr>
- <tr>
- <td><strong>Ouverture</strong></td>
- <td><?= $ticketManager->getTicketDateCreatedAtFormat($ticket); ?></td>
- </tr>
- <tr>
- <td><strong>Statut</strong></td>
- <td><?= $ticketManager->getTicketStatusLabelAsHtml($ticket); ?></td>
- </tr>
- <?php if($userManager->isCurrentAdmin()): ?>
- <tr>
- <td><strong>Producteur</strong></td>
- <td><?= $ticketManager->isTicketUnread($ticket, $ticket->user) ?
- '<span class="label label-warning">Non lu</span>' :
- '<span class="label label-success">Lu</span>'; ?>
- </td>
- </tr>
- <?php endif; ?>
- </tbody>
- </table>
- </div>
- </div>
-
- <ul class="timeline">
- <?php foreach($ticket->ticketMessages as $key => $ticketMessage): ?>
- <li>
- <?php if ($key === array_key_last($ticket->ticketMessages)): ?>
- <a name="bottom"></a>
- <?php endif; ?>
- <a name="<?= $ticketMessage->id ?>"></a>
- <i class="fa fa-user <?= $userManager->isAdmin($ticketMessage->user) ? 'bg-orange' : 'bg-aqua'; ?>"></i>
- <div class="timeline-item">
- <span class="time"><i class="fa fa-clock-o"></i> <?= date('d/m/Y à H:i', strtotime($ticketMessage->created_at)) ?></span>
- <h3 class="timeline-header"><?= Html::encode($userManager->getUsername($ticketMessage->user)); ?></h3>
- <div class="timeline-body">
- <?= nl2br($ticketMessage->message); ?>
- </div>
- </div>
- </li>
- <?php endforeach; ?>
- </ul>
-
- <div class="box box-success">
- <div class="box-header">
- <h3 class="box-title"><i class="fa fa-comments"></i> Répondre</h3>
- </div>
- <div class="box-body">
- <?php $form = ActiveForm::begin(); ?>
- <?= $form->field($ticketMessageResponse, 'message')->textarea(['rows' => 6]); ?>
- <div class="form-group">
- <?= Html::submitButton('Répondre', ['class' => 'btn btn-success btn-sm']) ?>
- </div>
- <?php ActiveForm::end(); ?>
- </div>
- </div>
-
- <div class="box <?= $ticketManager->isTicketOpen($ticket) ? 'box-danger' : 'box-success'; ?>">
- <div class="box-header">
- <h3 class="box-title">
- <?php if($ticketManager->isTicketOpen($ticket)): ?>
- <i class="fa fa-folder"></i> Cliquez ici si vous souhaitez fermer le ticket
- <?php else: ?>
- <i class="fa fa-folder-open"></i> Cliquez ici si vous souhaitez rouvrir le ticket
- <?php endif; ?>
- </h3>
- </div>
- <div class="box-body">
- <?php if($ticketManager->isTicketOpen($ticket)): ?>
- <?= Html::a('Fermer le ticket', ['close', 'id' => $ticket->id], ['class' => 'btn btn-danger btn-sm']) ?>
- <?php else: ?>
- <?= Html::a('Rouvrir le ticket', ['open', 'id' => $ticket->id], ['class' => 'btn btn-success btn-sm']) ?>
- <?php endif; ?>
- </div>
- </div>
-
- </div>
|