Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

98 lines
4.1KB

  1. <?php
  2. use common\logic\Ticket\Ticket\Wrapper\TicketManager;
  3. use common\logic\User\User\Wrapper\UserManager;
  4. use yii\helpers\Html;
  5. use yii\widgets\ActiveForm;
  6. $ticketManager = TicketManager::getInstance();
  7. $userManager = UserManager::getInstance();
  8. $this->setTitle('Voir un ticket');
  9. $this->addBreadcrumb(['label' => 'Support', 'url' => ['index']]);
  10. $this->addBreadcrumb('Voir un ticket');
  11. ?>
  12. <div class="ticket-view">
  13. <div class="box box-solid">
  14. <div class="box-body">
  15. <table class="table">
  16. <tbody>
  17. <tr>
  18. <td><strong>Sujet</strong></td>
  19. <td><?= Html::encode($ticket->subject); ?></td>
  20. </tr>
  21. <tr>
  22. <td><strong>Ouverture</strong></td>
  23. <td><?= $ticketManager->getTicketDateCreatedAtFormat($ticket); ?></td>
  24. </tr>
  25. <tr>
  26. <td><strong>Statut</strong></td>
  27. <td><?= $ticketManager->getTicketStatusLabelAsHtml($ticket); ?></td>
  28. </tr>
  29. <?php if($userManager->isCurrentAdmin()): ?>
  30. <tr>
  31. <td><strong>Producteur</strong></td>
  32. <td><?= $ticketManager->isTicketUnread($ticket, $ticket->user) ?
  33. '<span class="label label-warning">Non lu</span>' :
  34. '<span class="label label-success">Lu</span>'; ?>
  35. </td>
  36. </tr>
  37. <?php endif; ?>
  38. </tbody>
  39. </table>
  40. </div>
  41. </div>
  42. <ul class="timeline">
  43. <?php foreach($ticket->ticketMessages as $key => $ticketMessage): ?>
  44. <li>
  45. <?php if ($key === array_key_last($ticket->ticketMessages)): ?>
  46. <a name="bottom"></a>
  47. <?php endif; ?>
  48. <a name="<?= $ticketMessage->id ?>"></a>
  49. <i class="fa fa-user <?= $userManager->isAdmin($ticketMessage->user) ? 'bg-orange' : 'bg-aqua'; ?>"></i>
  50. <div class="timeline-item">
  51. <span class="time"><i class="fa fa-clock-o"></i> <?= date('d/m/Y à H:i', strtotime($ticketMessage->created_at)) ?></span>
  52. <h3 class="timeline-header"><?= Html::encode($userManager->getUsername($ticketMessage->user)); ?></h3>
  53. <div class="timeline-body">
  54. <?= nl2br($ticketMessage->message); ?>
  55. </div>
  56. </div>
  57. </li>
  58. <?php endforeach; ?>
  59. </ul>
  60. <div class="box box-success">
  61. <div class="box-header">
  62. <h3 class="box-title"><i class="fa fa-comments"></i> Répondre</h3>
  63. </div>
  64. <div class="box-body">
  65. <?php $form = ActiveForm::begin(); ?>
  66. <?= $form->field($ticketMessageResponse, 'message')->textarea(['rows' => 6]); ?>
  67. <div class="form-group">
  68. <?= Html::submitButton('Répondre', ['class' => 'btn btn-success btn-sm']) ?>
  69. </div>
  70. <?php ActiveForm::end(); ?>
  71. </div>
  72. </div>
  73. <div class="box <?= $ticketManager->isTicketOpen($ticket) ? 'box-danger' : 'box-success'; ?>">
  74. <div class="box-header">
  75. <h3 class="box-title">
  76. <?php if($ticketManager->isTicketOpen($ticket)): ?>
  77. <i class="fa fa-folder"></i> Cliquez ici si vous souhaitez fermer le ticket
  78. <?php else: ?>
  79. <i class="fa fa-folder-open"></i> Cliquez ici si vous souhaitez rouvrir le ticket
  80. <?php endif; ?>
  81. </h3>
  82. </div>
  83. <div class="box-body">
  84. <?php if($ticketManager->isTicketOpen($ticket)): ?>
  85. <?= Html::a('Fermer le ticket', ['close', 'id' => $ticket->id], ['class' => 'btn btn-danger btn-sm']) ?>
  86. <?php else: ?>
  87. <?= Html::a('Rouvrir le ticket', ['open', 'id' => $ticket->id], ['class' => 'btn btn-success btn-sm']) ?>
  88. <?php endif; ?>
  89. </div>
  90. </div>
  91. </div>