From e878835ae3d51985990b357385391bd7d9b43172 Mon Sep 17 00:00:00 2001 From: Manish Verma Date: Tue, 29 Nov 2016 18:05:23 +0530 Subject: [PATCH] bug-fix-patch # not sending diagnostic mail while configuring system mail # correct due today ticket count in agent panel # iframe height in client panel ticket pages # Removed place holder in client profile edit # reload page while after edit/assign/surrender tickets --- .../Admin/helpdesk/EmailsController.php | 27 ++++++++++++++++--- .../helpdesk/dashboard/dashboard.blade.php | 2 +- .../agent/helpdesk/ticket/timeline.blade.php | 18 +++++++------ .../client/helpdesk/ckeckticket.blade.php | 25 +++-------------- .../client/helpdesk/profile.blade.php | 10 +++---- 5 files changed, 44 insertions(+), 38 deletions(-) diff --git a/app/Http/Controllers/Admin/helpdesk/EmailsController.php b/app/Http/Controllers/Admin/helpdesk/EmailsController.php index 9aa4ef100..83e637da9 100644 --- a/app/Http/Controllers/Admin/helpdesk/EmailsController.php +++ b/app/Http/Controllers/Admin/helpdesk/EmailsController.php @@ -75,7 +75,7 @@ class EmailsController extends Controller // fetch all the departments from the department table $departments = $department->get(); // fetch all the helptopics from the helptopic table - $helps = $help->get(); + $helps = $help->where('status', '=', 1)->get(); // fetch all the types of active priority from the ticket_priority table $priority = $ticket_priority->where('status', '=', 1)->get(); // fetch all the types of mailbox protocols from the mailbox_protocols table @@ -114,7 +114,7 @@ class EmailsController extends Controller } if ($request->input('sending_status') === 'on') { $this->emailService($service, $service_request); - $send = $this->sendDiagnoEmail($request); + $send = $this->checkMail($request); } if ($send == 1 && $fetch == 1) { $this->store($request, $service_request, $id); @@ -318,7 +318,7 @@ class EmailsController extends Controller //get count of emails $count = $email->count(); // get all the helptopic - $helps = $help->get(); + $helps = $help->where('status', '=', 1)->get(); // get all active the priority $priority = $ticket_priority->where('status', '=', 1)->get(); // get all the mailbox protocols @@ -638,4 +638,25 @@ class EmailsController extends Controller $controller = new \App\Http\Controllers\Agent\helpdesk\MailController($TicketWorkflowController); $controller->fetch($email); } + + public function checkMail($request) { + $mailservice_id = $request->input('sending_protocol'); + $driver = $this->getDriver($mailservice_id); + $username = $request->input('email_address'); + $password = $request->input('password'); + $name = $request->input('email_name'); + $host = $request->input('sending_host'); + $port = $request->input('sending_port'); + $enc = $request->input('sending_encryption'); + $service_request = $request->except('sending_status', '_token', 'email_address', 'email_name', 'password', 'department', 'priority', 'help_topic', 'fetching_protocol', 'fetching_host', 'fetching_port', 'fetching_encryption', 'imap_authentication', 'sending_protocol', 'sending_host', 'sending_port', 'sending_encryption', 'smtp_authentication', 'internal_notes', '_wysihtml5_mode'); + + $this->emailService($driver, $service_request); + $this->setMailConfig($driver, $username, $name, $password, $enc, $host, $port); + $transport = \Swift_SmtpTransport::newInstance($host, $port, $enc); + $transport->setUsername($username); + $transport->setPassword($password); + $mailer = \Swift_Mailer::newInstance($transport); + $mailer->getTransport()->start(); + return 1; + } } diff --git a/resources/views/themes/default1/agent/helpdesk/dashboard/dashboard.blade.php b/resources/views/themes/default1/agent/helpdesk/dashboard/dashboard.blade.php index a70314d99..70adfa24e 100644 --- a/resources/views/themes/default1/agent/helpdesk/dashboard/dashboard.blade.php +++ b/resources/views/themes/default1/agent/helpdesk/dashboard/dashboard.blade.php @@ -83,7 +83,7 @@ class="active" } ?> role == 'admin' || Auth::user()->role == 'agent') { + if (Auth::user()->role == 'admin') { $todaytickets = count(App\Model\helpdesk\Ticket\Tickets::where('status', '=', 1)->whereRaw('date(duedate) = ?', [date('Y-m-d')])->get()); } else { $dept = App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first(); diff --git a/resources/views/themes/default1/agent/helpdesk/ticket/timeline.blade.php b/resources/views/themes/default1/agent/helpdesk/ticket/timeline.blade.php index a8788fd86..37a6a6049 100644 --- a/resources/views/themes/default1/agent/helpdesk/ticket/timeline.blade.php +++ b/resources/views/themes/default1/agent/helpdesk/ticket/timeline.blade.php @@ -1528,13 +1528,14 @@ if ($thread->title != "") { $("#show").hide(); $("#hide").show(); if (response == 0) { - message = "{!! Lang::get('lang.ticket_updated_successfully') !!}" - $("#dismis").trigger("click"); - $("#refresh1").load("../thread/{{$tickets->id}} #refresh1"); - $("#refresh2").load("../thread/{{$tickets->id}} #refresh2"); - $("#alert11").show(); - $('#message-success1').html(message); - setInterval(function(){$("#alert11").hide(); }, 4000); + location.reload(); + // message = "{!! Lang::get('lang.ticket_updated_successfully') !!}" + // $("#dismis").trigger("click"); + // $("#refresh1").load("../thread/{{$tickets->id}} #refresh1"); + // $("#refresh2").load("../thread/{{$tickets->id}} #refresh2"); + // $("#alert11").show(); + // $('#message-success1').html(message); + // setInterval(function(){$("#alert11").hide(); }, 4000); } else if (response == 1) { $("#error-subject").show(); @@ -1573,7 +1574,7 @@ if ($thread->title != "") { // var message = "Success"; // $('#message-success1').html(message); // setInterval(function(){$("#alert11").hide(); },4000); - + location.reload(); var message = "Success!"; $("#alert11").show(); $('#message-success1').html(message); @@ -1868,6 +1869,7 @@ if ($thread->title != "") { if (response == 1) { + location.reload(); // alert('ticket has been un assigned'); var message = "{!! Lang::get('lang.you_have_unassigned_your_ticket') !!}"; $("#alert11").show(); diff --git a/resources/views/themes/default1/client/helpdesk/ckeckticket.blade.php b/resources/views/themes/default1/client/helpdesk/ckeckticket.blade.php index 085d4e0de..ff2d95458 100644 --- a/resources/views/themes/default1/client/helpdesk/ckeckticket.blade.php +++ b/resources/views/themes/default1/client/helpdesk/ckeckticket.blade.php @@ -224,27 +224,10 @@ foreach ($conversations as $conversation) {
@if($conversation->firstContent()=='yes')
- - + +