Email config alert
Added alert box to convey that email has not been setup
This commit is contained in:
@@ -316,9 +316,9 @@ class ApiController extends Controller
|
||||
->groupby('tickets.id')
|
||||
->distinct()
|
||||
->paginate(10)
|
||||
->toJson();
|
||||
->toArray();
|
||||
|
||||
return $result;
|
||||
return response($result);
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
@@ -370,9 +370,9 @@ class ApiController extends Controller
|
||||
->groupby('tickets.id')
|
||||
->distinct()
|
||||
->paginate(10)
|
||||
->toJson();
|
||||
->toArray();
|
||||
|
||||
return $unassigned;
|
||||
return response($unassigned);
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
@@ -423,9 +423,9 @@ class ApiController extends Controller
|
||||
->groupby('tickets.id')
|
||||
->distinct()
|
||||
->paginate(10)
|
||||
->toJson();
|
||||
->toArray();
|
||||
|
||||
return $result;
|
||||
return response($result);
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
@@ -988,9 +988,8 @@ class ApiController extends Controller
|
||||
->groupby('tickets.id')
|
||||
->distinct()
|
||||
->paginate(10)
|
||||
->toJson();
|
||||
|
||||
return $inbox;
|
||||
->toArray();
|
||||
return response($inbox);
|
||||
} catch (\Exception $ex) {
|
||||
$error = $ex->getMessage();
|
||||
$line = $ex->getLine();
|
||||
@@ -1072,9 +1071,9 @@ class ApiController extends Controller
|
||||
->groupby('tickets.id')
|
||||
->distinct()
|
||||
->paginate(10)
|
||||
->toJson();
|
||||
->toArray();
|
||||
|
||||
return $trash;
|
||||
return response($trash);
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
@@ -1129,9 +1128,9 @@ class ApiController extends Controller
|
||||
->groupby('tickets.id')
|
||||
->distinct()
|
||||
->paginate(10)
|
||||
->toJson();
|
||||
->toArray();
|
||||
|
||||
return $result;
|
||||
return response($result);
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
$line = $e->getLine();
|
||||
|
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\ViewComposers;
|
||||
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
use App\Model\helpdesk\Ticket\Tickets;
|
||||
use App\User;
|
||||
@@ -28,13 +29,14 @@ class AgentLayout
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Company $company, User $users, Tickets $tickets, Department $department)
|
||||
public function __construct(Company $company, User $users, Tickets $tickets, Department $department, Emails $emails)
|
||||
{
|
||||
$this->company = $company;
|
||||
$this->auth = Auth::user();
|
||||
$this->users = $users;
|
||||
$this->tickets = $tickets;
|
||||
$this->department = $department;
|
||||
$this->emails = $emails;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,6 +60,7 @@ class AgentLayout
|
||||
'department' => $this->departments(),
|
||||
'overdues' => $this->overdues(),
|
||||
'due_today' => $this->getDueToday(),
|
||||
'is_mail_conigured' => $this->getEmailConfig(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -194,4 +197,21 @@ class AgentLayout
|
||||
->whereRaw('date(duedate) = ?', [date('Y-m-d')]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @category function to check configured mails
|
||||
*
|
||||
* @var $emails
|
||||
*
|
||||
* @return bool true/false
|
||||
*/
|
||||
public function getEmailConfig()
|
||||
{
|
||||
$emails = $this->emails->where('sending_status', '=', 1)->where('fetching_status', '=', 1)->count();
|
||||
if ($emails >= 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user