| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace App;
- use App\Interfaces\CommentInterface;
- /**
- * @var CommentInterface $comment
- */
- $core = Core::getInstance();
- $user = $core->getUser();
- $comment_user = $comment->getUser();
- $is_internal = $comment->isInternal();
- $dt_created = $comment->getDateTimeCreated();
- $attachments = $comment->getAttachments();
- $html = $comment->getHtml();
- ?>
- <div id="ticket-comment-<?=$comment->id?>" class="card card-body mb-3">
- <div class="d-flex">
- <div class="flex-shrink-0">
- <img src="<?=htmlspecialchars($comment_user->getAvatarUrl())?>" alt="<?=htmlspecialchars($comment_user->getDisplayName())?>" />
- </div>
- <div class="flex-grow-1 ms-3">
- <div class="float-end">
- <?php
- if($is_internal) {
- ?>
- <span class="badge bg-primary">
- <?=htmlspecialchars(__("Internal Comment"))?>
- </span>
- <?php
- }
- if($comment_user->is($user)) {
- $comment->renderEditIcon();
- }
- ?>
- </div>
- <div>
- <i class="fa fa-fw fa-user-circle"></i>
- <?=htmlspecialchars($comment_user->getDisplayName())?> (<?=htmlspecialchars($comment_user->email)?>)
- </div>
- <div>
- <i class="fa fa-fw fa-clock"></i>
- <?=htmlspecialchars($user->formatDateTime($dt_created))?>
- </div>
- <hr />
- <?=$html?>
- <?php
- if($attachments) {
- ?>
- <hr />
- <h5><?=htmlspecialchars(__("Attachments"))?></h5>
- <?php
- foreach($attachments as $attachment) {
- $attachment->renderButton();
- }
- }
- ?>
- </div>
- </div>
- </div>
|