update 1.0.8.0
Commits for version update
This commit is contained in:
67
app/Console/Commands/TicketFetch.php
Normal file
67
app/Console/Commands/TicketFetch.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Http\Controllers\Agent\helpdesk\MailController;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketWorkflowController;
|
||||
use Event;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class TicketFetch extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'ticket:fetch';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Fetching the tickets from service provider';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
if (env('DB_INSTALL') == 1) {
|
||||
$controller = $this->mailController();
|
||||
$emails = new \App\Model\helpdesk\Email\Emails();
|
||||
$settings_email = new \App\Model\helpdesk\Settings\Email();
|
||||
$system = new \App\Model\helpdesk\Settings\System();
|
||||
$ticket = new \App\Model\helpdesk\Settings\Ticket();
|
||||
$controller->readmails($emails, $settings_email, $system, $ticket);
|
||||
Event::fire('ticket.fetch', ['event' => '']);
|
||||
loging('fetching-ticket', 'Ticket has read', 'info');
|
||||
//\Log::info('Ticket has read');
|
||||
$this->info('Ticket has read');
|
||||
}
|
||||
}
|
||||
|
||||
public function mailController()
|
||||
{
|
||||
$PhpMailController = new \App\Http\Controllers\Common\PhpMailController();
|
||||
$NotificationController = new \App\Http\Controllers\Common\NotificationController();
|
||||
$ticket = new \App\Http\Controllers\Agent\helpdesk\TicketController($PhpMailController, $NotificationController);
|
||||
$work = new TicketWorkflowController($ticket);
|
||||
$controller = new MailController($work);
|
||||
|
||||
return $controller;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user