update v1.0.7.9.1 R.C.
This commit is contained in:
@@ -182,7 +182,7 @@ class MailController extends Controller
|
||||
$form_data = null;
|
||||
$team_assign = null;
|
||||
$ticket_status = null;
|
||||
$result = $this->TicketWorkflowController->workflow($fromaddress, $fromname, $subject, $body, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $collaborator, $dept, $assign, $team_assign, $ticket_status, $form_data, $auto_response);
|
||||
$result = $this->TicketWorkflowController->workflow($fromaddress, $fromname, $subject, $body, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $collaborator, $dept, $assign, $team_assign, $ticket_status, $form_data, $auto_response, $mail->getAttachments());
|
||||
|
||||
if ($result[1] == true) {
|
||||
$ticket_table = Tickets::where('ticket_number', '=', $result[0])->first();
|
||||
|
@@ -316,8 +316,10 @@ class TicketController extends Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
// this param is used for inline attachments via email
|
||||
$inline_attachment = null;
|
||||
//create user
|
||||
if ($this->create_user($email, $fullname, $subject, $body, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source->id, $headers, $help->department, $assignto, $form_data, $auto_response, $status)) {
|
||||
if ($this->create_user($email, $fullname, $subject, $body, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source->id, $headers, $help->department, $assignto, $form_data, $auto_response, $status, $inline_attachment)) {
|
||||
return Redirect('newticket')->with('success', Lang::get('lang.Ticket-created-successfully'));
|
||||
} else {
|
||||
return Redirect('newticket')->with('fails', 'fails');
|
||||
@@ -647,7 +649,7 @@ class TicketController extends Controller
|
||||
*
|
||||
* @return type bool
|
||||
*/
|
||||
public function create_user($emailadd, $username, $subject, $body, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $from_data, $auto_response, $status)
|
||||
public function create_user($emailadd, $username, $subject, $body, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $from_data, $auto_response, $status, $mail_data)
|
||||
{
|
||||
// define global variables
|
||||
$email;
|
||||
@@ -721,7 +723,7 @@ class TicketController extends Controller
|
||||
$body2 = null;
|
||||
try {
|
||||
if ($auto_response == 0) {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['name' => $username, 'email' => $emailadd], $message = ['subject' => $updated_subject, 'scenario' => 'create-ticket'], $template_variables = ['user' => $user->first_name, 'ticket_number' => $ticket_number2, 'department_sign' => '']);
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['name' => $username, 'email' => $emailadd], $message = ['subject' => $updated_subject, 'scenario' => 'create-ticket'], $template_variables = ['user' => $username, 'ticket_number' => $ticket_number2, 'department_sign' => '']);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
@@ -770,7 +772,7 @@ class TicketController extends Controller
|
||||
$emails_to_be_sent = array_unique($set_mails, SORT_REGULAR);
|
||||
foreach ($emails_to_be_sent as $email_data) {
|
||||
try {
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['user' => $email_data['to_user'], 'email' => $email_data['to_email']], $message = ['subject' => $updated_subject, 'body' => $body, 'scenario' => $mail], $template_variables = ['ticket_agent_name' => $email_data['to_user_name'], 'ticket_client_name' => $username, 'ticket_client_email' => $emailadd, 'user' => $email_data['to_user_name'], 'ticket_number' => $ticket_number2, 'email_address' => $emailadd, 'name' => $ticket_creator]);
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['user' => $email_data['to_user'], 'email' => $email_data['to_email']], $message = ['subject' => $updated_subject, 'body' => $body, 'scenario' => $mail, 'add_embedded_image' => $mail_data], $template_variables = ['ticket_agent_name' => $email_data['to_user_name'], 'ticket_client_name' => $username, 'ticket_client_email' => $emailadd, 'user' => $email_data['to_user_name'], 'ticket_number' => $ticket_number2, 'email_address' => $emailadd, 'name' => $ticket_creator]);
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ class TicketWorkflowController extends Controller
|
||||
*
|
||||
* @return type response
|
||||
*/
|
||||
public function workflow($fromaddress, $fromname, $subject, $body, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $collaborator, $dept, $assign, $team_assign, $ticket_status, $form_data, $auto_response)
|
||||
public function workflow($fromaddress, $fromname, $subject, $body, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $collaborator, $dept, $assign, $team_assign, $ticket_status, $form_data, $auto_response, $mail)
|
||||
{
|
||||
$contact_details = ['email' => $fromaddress, 'email_name' => $fromname, 'subject' => $subject, 'message' => $body];
|
||||
$ticket_settings_details = ['help_topic' => $helptopic, 'sla' => $sla, 'priority' => $priority, 'source' => $source, 'dept' => $dept, 'assign' => $assign, 'team' => $team_assign, 'status' => $ticket_status, 'reject' => false];
|
||||
@@ -169,7 +169,7 @@ class TicketWorkflowController extends Controller
|
||||
if ($ticket_settings_details['reject'] == true) {
|
||||
return ['0' => false, '1' => false];
|
||||
} else {
|
||||
$create_ticket = $this->TicketController->create_user($contact_details['email'], $contact_details['email_name'], $contact_details['subject'], $contact_details['message'], $phone, $phonecode, $mobile_number, $ticket_settings_details['help_topic'], $ticket_settings_details['sla'], $ticket_settings_details['priority'], $source, $collaborator, $ticket_settings_details['dept'], $ticket_settings_details['assign'], $form_data, $auto_response, $ticket_settings_details['status']);
|
||||
$create_ticket = $this->TicketController->create_user($contact_details['email'], $contact_details['email_name'], $contact_details['subject'], $contact_details['message'], $phone, $phonecode, $mobile_number, $ticket_settings_details['help_topic'], $ticket_settings_details['sla'], $ticket_settings_details['priority'], $source, $collaborator, $ticket_settings_details['dept'], $ticket_settings_details['assign'], $form_data, $auto_response, $ticket_settings_details['status'], $mail);
|
||||
|
||||
return $create_ticket;
|
||||
}
|
||||
|
@@ -83,9 +83,10 @@ class ClientTicketController extends Controller
|
||||
$team_assign = null;
|
||||
$ticket_status = null;
|
||||
$auto_response = 0;
|
||||
|
||||
$inline_attachment = null;
|
||||
|
||||
$this->TicketWorkflowController->workflow($fromaddress, $fromname, $subject, $body, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $collaborator, $dept, $assign, $team_assign, $ticket_status, $form_data, $auto_response);
|
||||
|
||||
$this->TicketWorkflowController->workflow($fromaddress, $fromname, $subject, $body, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $collaborator, $dept, $assign, $team_assign, $ticket_status, $form_data, $auto_response, $inline_attachment);
|
||||
return \Redirect::back()->with('success1', Lang::get('lang.successfully_replied'));
|
||||
}
|
||||
}
|
||||
|
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Client\helpdesk;
|
||||
// controllers
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketWorkflowController;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Controllers\Common\FileuploadController;
|
||||
// requests
|
||||
use App\Http\Requests\helpdesk\ClientRequest;
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
@@ -70,8 +71,11 @@ class FormController extends Controller
|
||||
} else {
|
||||
$phonecode = '';
|
||||
}
|
||||
|
||||
return view('themes.default1.client.helpdesk.form', compact('topics', 'codes'))->with('phonecode', $phonecode);
|
||||
$fileupload = new FileuploadController();
|
||||
$fileupload = $fileupload->file_upload_max_size();
|
||||
$max_size_in_bytes = $fileupload[0];
|
||||
$max_size_in_actual = $fileupload[1];
|
||||
return view('themes.default1.client.helpdesk.form', compact('topics', 'codes', 'max_size_in_bytes', 'max_size_in_actual'))->with('phonecode', $phonecode);
|
||||
} else {
|
||||
return \Redirect::route('home');
|
||||
}
|
||||
@@ -189,7 +193,13 @@ class FormController extends Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
$result = $this->TicketWorkflowController->workflow($email, $name, $subject, $details, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $collaborator, $department, $assignto, $team_assign, $status, $form_extras, $auto_response);
|
||||
// this param is used for inline attachments via email
|
||||
if(empty($attachments)) {
|
||||
$inline_attachment = $attachments;
|
||||
} else {
|
||||
$inline_attachment = null;
|
||||
}
|
||||
$result = $this->TicketWorkflowController->workflow($email, $name, $subject, $details, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $collaborator, $department, $assignto, $team_assign, $status, $form_extras, $auto_response, $inline_attachment);
|
||||
|
||||
if ($result[1] == 1) {
|
||||
$ticketId = Tickets::where('ticket_number', '=', $result[0])->first();
|
||||
|
@@ -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
|
||||
|
@@ -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') {
|
||||
|
@@ -2,9 +2,10 @@
|
||||
|
||||
namespace App\Model\helpdesk\Ticket;
|
||||
|
||||
use App\BaseModel;
|
||||
//use App\BaseModel;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Ticket_Thread extends BaseModel
|
||||
class Ticket_Thread extends Model
|
||||
{
|
||||
protected $table = 'ticket_thread';
|
||||
protected $fillable = [
|
||||
|
Reference in New Issue
Block a user