diff --git a/app/Api/v1/ApiController.php b/app/Api/v1/ApiController.php index 13b9bb61f..a07db822e 100644 --- a/app/Api/v1/ApiController.php +++ b/app/Api/v1/ApiController.php @@ -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(); diff --git a/app/Http/ViewComposers/AgentLayout.php b/app/Http/ViewComposers/AgentLayout.php index 1fdef6059..764c75439 100644 --- a/app/Http/ViewComposers/AgentLayout.php +++ b/app/Http/ViewComposers/AgentLayout.php @@ -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; + } } diff --git a/resources/views/themes/default1/admin/layout/admin.blade.php b/resources/views/themes/default1/admin/layout/admin.blade.php index 412c3e3ae..230fa29f6 100644 --- a/resources/views/themes/default1/admin/layout/admin.blade.php +++ b/resources/views/themes/default1/admin/layout/admin.blade.php @@ -374,7 +374,22 @@
- + @if (!$is_mail_conigured) +
+
+
+

 {{Lang::get('Alert')}}

+

+ @if (\Auth::user()->role == 'admin') + {{Lang::get('lang.system-outgoing-incoming-mail-not-configured')}} {{Lang::get('lang.confihure-the-mail-now')}} + @else + {{Lang::get('lang.system-mail-not-configured-agent-message')}} + @endif +

+
+
+
+ @endif @yield('content')
diff --git a/resources/views/themes/default1/agent/layout/agent.blade.php b/resources/views/themes/default1/agent/layout/agent.blade.php index 750cf67c6..0f694415c 100644 --- a/resources/views/themes/default1/agent/layout/agent.blade.php +++ b/resources/views/themes/default1/agent/layout/agent.blade.php @@ -400,6 +400,22 @@ $group = App\Model\helpdesk\Agent\Groups::where('id', '=', $agent_group)->first(
+ @if (!$is_mail_conigured) +
+
+
+

 {{Lang::get('Alert')}}

+

+ @if (\Auth::user()->role == 'admin') + {{Lang::get('lang.system-outgoing-incoming-mail-not-configured')}} {{Lang::get('lang.confihure-the-mail-now')}} + @else + {{Lang::get('lang.system-mail-not-configured-agent-message')}} + @endif +

+
+
+
+ @endif @yield('content')