update v1.0.7.9.1 R.C.

This commit is contained in:
Sujit Prasad
2016-08-19 15:08:43 +05:30
parent bda543a3a2
commit a54df4d919
15 changed files with 357 additions and 233 deletions

View File

@@ -9,9 +9,9 @@ class FileuploadController extends Controller
public function __construct()
{
// checking authentication
$this->middleware('auth');
// $this->middleware('auth');
// checking if role is agent
$this->middleware('role.agent');
// $this->middleware('role.agent');
}
// Returns a file size limit in bytes based on the PHP upload_max_filesize

View File

@@ -84,6 +84,13 @@ class PhpMailController extends Controller
$attachment = null;
}
// Inline Attachments
if (isset($message['add_embedded_image'])) {
$add_embedded_images = $message['add_embedded_image'];
} else {
$add_embedded_images = null;
}
// template variables
if (Auth::user()) {
$agent = Auth::user()->user_name;
@@ -265,6 +272,40 @@ class PhpMailController extends Controller
$mail->addAttachment($file_path, $file_name);
}
}
// inline images embedded as attachments
if ($add_embedded_images != null) {
// dd($add_embedded_images);
foreach ($add_embedded_images as $add_embedded_image) {
if(isset($add_embedded_image->id)) {
$cid = $add_embedded_image->id;
} else {
$cid = null;
}
if(isset($add_embedded_image->name)) {
$file_name = $add_embedded_image->name;
} else {
$file_name = null;
}
if(isset($add_embedded_image->filePath)) {
$file_path = $add_embedded_image->filePath;
} else {
$file_path = null;
}
if(isset($add_embedded_image->disposition)) {
if($add_embedded_image->disposition == 'INLINE') {
$mail->AddEmbeddedImage($file_path, $cid, $file_name);
} else {
$mail->addAttachment($file_path, $file_name);
}
} else {
$file_path = $add_embedded_image->getRealPath();
$file_name = $add_embedded_image->getClientOriginalName();
$mail->addAttachment($file_path, $file_name);
}
}
}
$mail->CharSet = 'utf8';
$mail->Subject = $subject;
if ($template == 'ticket-reply-agent') {