PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / trunk
Fluent Support – Helpdesk & Customer Support Ticket System vtrunk
2.4.0 2.3.2 2.3.1 2.3.0 2.2.1 2.2.0 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.4.0 1.4.1 1.4.2 1.4.5 1.4.6 1.4.7 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 All 68 releases
fluent-support / app / Services / FluentBoardsService.php

FluentBoardsService.php in Fluent Support – Helpdesk & Customer Support Ticket System trunk, at app/Services/FluentBoardsService.php

46 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentSupport\App\Services;
4
5 use Exception;
6 use FluentSupport\App\Models\Conversation;
7
8 class FluentBoardsService
9 {
10
11 public function addInternalNote($task)
12 {
13 $urlBase = admin_url('admin.php?page=fluent-boards#/');
14 $boardsProfileUrl = $urlBase . 'boards/' . $task->board_id . '/tasks/' . $task->id;
15
16 $internalNote = 'A new task has been created for this ticket in Fluent Boards. You can view and manage it at the following link:<br><a href="' . $boardsProfileUrl . '">here</a>';
17
18 $agent = Helper::getAgentByUserId(get_current_user_id());
19
20 Conversation::create([
21 'ticket_id' => $task->source_id,
22 'person_id' => $agent->id,
23 'conversation_type' => 'internal_info',
24 'content' => $internalNote
25 ]);
26 }
27
28 public function addComment($task)
29 {
30 $baseUrl = admin_url('admin.php?page=fluent-support#/tickets/');
31 $ticketUrl = $baseUrl . $task->source_id . '/view';
32
33 $description = 'This task was created from Fluent Support. Here you can find this ticket: <a href="' . $ticketUrl . '" target="_blank">View Ticket</a>';
34
35 $commentData = [
36 'description' => $description,
37 'created_by' => $task->created_by,
38 'task_id' => $task->id,
39 'board_id' => $task->board_id,
40 'type' => 'comment'
41 ];
42
43 \FluentBoards\App\Models\Comment::create( $commentData);
44 }
45 }
46