|
3 | 3 | <?php |
4 | 4 | $comment_title = trans('panichd::lang.comment-'.$comment->type.'-title'); |
5 | 5 |
|
6 | | - if (in_array($comment->type, ['reply', 'note'])){ |
7 | | - if (count($comment->notifications) > 0){ |
8 | | - $a_recipients = []; |
9 | | - foreach ($comment->notifications as $recipient){ |
10 | | - $a_recipients[] = $recipient->name; |
11 | | - } |
12 | | - $recipients = implode(', ', $a_recipients); |
13 | | - } |
14 | | - } |
15 | | -
|
16 | 6 | switch ($comment->type){ |
17 | 7 | case 'note': |
18 | 8 | $icon_class = "fa fa-pencil-alt text-info"; |
19 | | - if (count($comment->notifications) == 0){ |
| 9 | + if (!$u->canManageTicket($ticket->id) || count($comment->notifications) == 0){ |
20 | 10 | $comment_header = trans('panichd::lang.comment-note-from-agent', ['agent' => $comment->owner->name]); |
21 | 11 | }else{ |
22 | 12 | $comment_header = trans('panichd::lang.comment-note-from-agent-to', [ |
23 | 13 | 'agent' => $comment->owner->name, |
24 | | - 'recipients' => $recipients |
| 14 | + 'recipients' => implode(', ', $comment->notifications->pluck('name')->toArray()) |
25 | 15 | ]); |
26 | 16 | } |
27 | 17 | break; |
|
50 | 40 | }else{ |
51 | 41 | $icon_class .= "text-warning"; |
52 | 42 | } |
53 | | - if (count($comment->notifications) == 0){ |
| 43 | + if (!$u->canManageTicket($ticket->id) || count($comment->notifications) == 0){ |
54 | 44 | $comment_header = trans('panichd::lang.comment-reply-from-owner', ['owner' => $comment->owner->name]); |
55 | 45 | }else{ |
56 | | - $comment_header = trans('panichd::lang.reply-from-owner-to', [ |
| 46 | + $comment_header = trans('panichd::lang.reply-from-owner-to', [ |
57 | 47 | 'owner' => $comment->owner->name, |
58 | | - 'recipients' => $recipients |
| 48 | + 'recipients' => implode(', ', $comment->notifications->pluck('name')->toArray()) |
59 | 49 | ]); |
60 | 50 | } |
61 | 51 | break; |
|
0 commit comments