clean dummy data

This commit is contained in:
Manish Verma
2018-08-16 11:59:28 +05:30
parent f0a47d10ac
commit 26b3557b6b
3 changed files with 47 additions and 15 deletions

View File

@@ -6,6 +6,7 @@ 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\Model\helpdesk\Settings\CommonSettings;
use App\User;
use Auth;
use Illuminate\View\View;
@@ -29,7 +30,7 @@ class AgentLayout
*
* @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->auth = Auth::user();
@@ -37,6 +38,7 @@ class AgentLayout
$this->tickets = $tickets;
$this->department = $department;
$this->emails = $emails;
$this->common_settings = $common_settings;
}
/**
@@ -50,17 +52,18 @@ class AgentLayout
{
$notifications = \App\Http\Controllers\Common\NotificationController::getNotifications();
$view->with([
'company' => $this->company,
'notifications' => $notifications,
'myticket' => $this->myTicket(),
'unassigned' => $this->unassigned(),
'followup_ticket' => $this->followupTicket(),
'deleted' => $this->deleted(),
'tickets' => $this->inbox(),
'department' => $this->departments(),
'overdues' => $this->overdues(),
'due_today' => $this->getDueToday(),
'is_mail_conigured' => $this->getEmailConfig(),
'company' => $this->company,
'notifications' => $notifications,
'myticket' => $this->myTicket(),
'unassigned' => $this->unassigned(),
'followup_ticket' => $this->followupTicket(),
'deleted' => $this->deleted(),
'tickets' => $this->inbox(),
'department' => $this->departments(),
'overdues' => $this->overdues(),
'due_today' => $this->getDueToday(),
'is_mail_conigured' => $this->getEmailConfig(),
'dummy_installation' => $this->getDummyDataInstallation(),
]);
}
@@ -214,4 +217,19 @@ class AgentLayout
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;
}
}

View File

@@ -374,7 +374,12 @@
<!-- Main 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="col-md-12">
<div class="callout callout-warning lead">

View File

@@ -400,7 +400,16 @@ $group = App\Model\helpdesk\Agent\Groups::where('id', '=', $agent_group)->first(
</section>
<!-- Main 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="col-md-12">
<div class="callout callout-warning lead">
@@ -415,7 +424,7 @@ $group = App\Model\helpdesk\Agent\Groups::where('id', '=', $agent_group)->first(
</div>
</div>
</div>
@endif
@endif
@yield('content')
</section><!-- /.content -->
</div>