PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 1.10.2
Fluent Support – Helpdesk & Customer Support Ticket System v1.10.2
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 / Hooks / Handlers / FileUploadHandler.php

FileUploadHandler.php in Fluent Support – Helpdesk & Customer Support Ticket System 1.10.2, at app/Hooks/Handlers/FileUploadHandler.php

50 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\Hooks\Handlers;
4
5 use FluentSupport\App\Models\Conversation;
6 use FluentSupport\App\Services\Includes\UploadService;
7
8 class FileUploadHandler
9 {
10 public function init()
11 {
12
13 }
14
15 private function updateFileInfo($file, $uploadInfo)
16 {
17 $file->file_path = $uploadInfo['file_path'] ?? $uploadInfo['path'] ?? null;
18 $file->full_url = $uploadInfo['url'] ?? $uploadInfo['full_url'] ?? null;
19 $file->title = $uploadInfo['name'] ?? $file->title;
20 $file->driver = $uploadInfo['driver'] ?? 'local';
21 $file->status = 'active';
22 $file->save();
23
24 return true;
25 }
26
27 public static function getFileUploadErrorNoteMessage($driver = 'local', $type = 'response')
28 {
29 $errorMessages = [
30 'google_drive_settings' => 'Google Drive',
31 'dropbox_settings' => 'Dropbox',
32 'local' => 'Local Server',
33 ];
34
35 if ('response' == $type) {
36 $noteMessage = 'Attached file in this conversation is failed to upload to ' . $errorMessages[$driver] . ', Please check your';
37 } else {
38 $noteMessage = 'Attached file during creation this ticket is failed to upload to ' . $errorMessages[$driver] . ', Please check your';
39 }
40
41 if ('local' == $driver) {
42 $noteMessage .= ' upload folder permission is writeable or not';
43 } else {
44 $noteMessage .= ' ' . $errorMessages[$driver] . ' settings';
45 }
46
47 return $noteMessage;
48 }
49 }
50