clean dummy data
This commit is contained in:
@@ -6,6 +6,7 @@ use App\Model\helpdesk\Agent\Department;
|
|||||||
use App\Model\helpdesk\Email\Emails;
|
use App\Model\helpdesk\Email\Emails;
|
||||||
use App\Model\helpdesk\Settings\Company;
|
use App\Model\helpdesk\Settings\Company;
|
||||||
use App\Model\helpdesk\Ticket\Tickets;
|
use App\Model\helpdesk\Ticket\Tickets;
|
||||||
|
use App\Model\helpdesk\Settings\CommonSettings;
|
||||||
use App\User;
|
use App\User;
|
||||||
use Auth;
|
use Auth;
|
||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
@@ -29,7 +30,7 @@ class AgentLayout
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(Company $company, User $users, Tickets $tickets, Department $department, Emails $emails)
|
public function __construct(Company $company, User $users, Tickets $tickets, Department $department, Emails $emails, CommonSettings $common_settings)
|
||||||
{
|
{
|
||||||
$this->company = $company;
|
$this->company = $company;
|
||||||
$this->auth = Auth::user();
|
$this->auth = Auth::user();
|
||||||
@@ -37,6 +38,7 @@ class AgentLayout
|
|||||||
$this->tickets = $tickets;
|
$this->tickets = $tickets;
|
||||||
$this->department = $department;
|
$this->department = $department;
|
||||||
$this->emails = $emails;
|
$this->emails = $emails;
|
||||||
|
$this->common_settings = $common_settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -50,17 +52,18 @@ class AgentLayout
|
|||||||
{
|
{
|
||||||
$notifications = \App\Http\Controllers\Common\NotificationController::getNotifications();
|
$notifications = \App\Http\Controllers\Common\NotificationController::getNotifications();
|
||||||
$view->with([
|
$view->with([
|
||||||
'company' => $this->company,
|
'company' => $this->company,
|
||||||
'notifications' => $notifications,
|
'notifications' => $notifications,
|
||||||
'myticket' => $this->myTicket(),
|
'myticket' => $this->myTicket(),
|
||||||
'unassigned' => $this->unassigned(),
|
'unassigned' => $this->unassigned(),
|
||||||
'followup_ticket' => $this->followupTicket(),
|
'followup_ticket' => $this->followupTicket(),
|
||||||
'deleted' => $this->deleted(),
|
'deleted' => $this->deleted(),
|
||||||
'tickets' => $this->inbox(),
|
'tickets' => $this->inbox(),
|
||||||
'department' => $this->departments(),
|
'department' => $this->departments(),
|
||||||
'overdues' => $this->overdues(),
|
'overdues' => $this->overdues(),
|
||||||
'due_today' => $this->getDueToday(),
|
'due_today' => $this->getDueToday(),
|
||||||
'is_mail_conigured' => $this->getEmailConfig(),
|
'is_mail_conigured' => $this->getEmailConfig(),
|
||||||
|
'dummy_installation' => $this->getDummyDataInstallation(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,4 +217,19 @@ class AgentLayout
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @category function to check if dummy data is installed in the system or not
|
||||||
|
* @param null
|
||||||
|
* @return builder
|
||||||
|
*/
|
||||||
|
public function getDummyDataInstallation() {
|
||||||
|
$return_collection = $this->common_settings->select('status')->where('option_name', '=', 'dummy_data_installation')->first();
|
||||||
|
if (!$return_collection) {
|
||||||
|
$return_collection = collect(['status' => 0]);
|
||||||
|
return $return_collection['status'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $return_collection->status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -374,7 +374,12 @@
|
|||||||
|
|
||||||
<!-- Main content -->
|
<!-- Main content -->
|
||||||
<section class="content">
|
<section class="content">
|
||||||
@if (!$is_mail_conigured)
|
@if($dummy_installation == 1 || $dummy_installation == '1')
|
||||||
|
<div class="alert alert-info alert-dismissible">
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
|
<i class="icon fa fa-exclamation-triangle"></i> {{Lang::get('lang.dummy_data_installation_message')}} <a href="{{route('clean-database')}}">{{Lang::get('lang.click')}}</a> {{Lang::get('lang.clear-dummy-data')}}
|
||||||
|
</div>
|
||||||
|
@elseif (!$is_mail_conigured)
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="callout callout-warning lead">
|
<div class="callout callout-warning lead">
|
||||||
|
@@ -400,7 +400,16 @@ $group = App\Model\helpdesk\Agent\Groups::where('id', '=', $agent_group)->first(
|
|||||||
</section>
|
</section>
|
||||||
<!-- Main content -->
|
<!-- Main content -->
|
||||||
<section class="content">
|
<section class="content">
|
||||||
@if (!$is_mail_conigured)
|
@if($dummy_installation == 1 || $dummy_installation == '1')
|
||||||
|
<div class="alert alert-info alert-dismissible">
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||||
|
<i class="icon fa fa-exclamation-triangle"></i> @if (\Auth::user()->role == 'admin')
|
||||||
|
{{Lang::get('lang.dummy_data_installation_message')}} <a href="{{route('clean-database')}}">{{Lang::get('lang.click')}}</a> {{Lang::get('lang.clear-dummy-data')}}
|
||||||
|
@else
|
||||||
|
{{Lang::get('lang.clear-dummy-data-agent-message')}}
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
@elseif (!$is_mail_conigured)
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="callout callout-warning lead">
|
<div class="callout callout-warning lead">
|
||||||
@@ -415,7 +424,7 @@ $group = App\Model\helpdesk\Agent\Groups::where('id', '=', $agent_group)->first(
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
@yield('content')
|
@yield('content')
|
||||||
</section><!-- /.content -->
|
</section><!-- /.content -->
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user