update v 1.0.7.5
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
namespace App\Http\Controllers\Client\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Common\SettingsController;
|
||||
use App\Http\Controllers\Agent\helpdesk\TicketWorkflowController;
|
||||
use App\Http\Controllers\Controller;
|
||||
// requests
|
||||
use App\Model\helpdesk\Ticket\Ticket_Thread;
|
||||
@@ -12,14 +12,14 @@ use App\Model\helpdesk\Ticket\Tickets;
|
||||
use App\User;
|
||||
use Auth;
|
||||
// classes
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Input;
|
||||
use Lang;
|
||||
|
||||
/**
|
||||
* TicketController2.
|
||||
*
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class ClientTicketController extends Controller
|
||||
{
|
||||
@@ -28,11 +28,12 @@ class ClientTicketController extends Controller
|
||||
*
|
||||
* @return type response
|
||||
*/
|
||||
public function __construct()
|
||||
public function __construct(TicketWorkflowController $TicketWorkflowController)
|
||||
{
|
||||
SettingsController::smtp();
|
||||
$this->TicketWorkflowController = $TicketWorkflowController;
|
||||
// $this->middleware('auth');
|
||||
// $this->middleware('role.user');
|
||||
$this->middleware('board');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,30 +57,35 @@ class ClientTicketController extends Controller
|
||||
* @return type view
|
||||
*/
|
||||
public function reply($id, Request $request)
|
||||
{
|
||||
$comment = $request->input('comment');
|
||||
if ($comment != null) {
|
||||
$tickets = Tickets::where('id', '=', $id)->first();
|
||||
$tickets->closed_at = null;
|
||||
$tickets->closed = 0;
|
||||
$tickets->reopened_at = date('Y-m-d H:i:s');
|
||||
$tickets->reopened = 1;
|
||||
$tickets->isanswered = 0;
|
||||
$threads = new Ticket_Thread();
|
||||
$threads->user_id = Auth::user()->id;
|
||||
$threads->ticket_id = $tickets->id;
|
||||
$threads->poster = 'client';
|
||||
$threads->body = $comment;
|
||||
try {
|
||||
$threads->save();
|
||||
$tickets->save();
|
||||
{
|
||||
$tickets = Tickets::where('id', '=', $id)->first();
|
||||
$thread = Ticket_Thread::where('ticket_id', '=', $tickets->id)->first();
|
||||
|
||||
return \Redirect::back()->with('success1', 'Successfully replied');
|
||||
} catch (Exception $e) {
|
||||
return \Redirect::back()->with('fails1', $e->errorInfo[2]);
|
||||
}
|
||||
} else {
|
||||
return \Redirect::back()->with('fails1', 'Please fill some data!');
|
||||
}
|
||||
$subject = $thread->title.'[#'.$tickets->ticket_number.']';
|
||||
$body = $request->input('comment');
|
||||
|
||||
$user_cred = User::where('id', '=', $tickets->user_id)->first();
|
||||
|
||||
$fromaddress = $user_cred->email;
|
||||
$fromname = $user_cred->user_name;
|
||||
$phone = '';
|
||||
$phonecode = '';
|
||||
$mobile_number = '';
|
||||
|
||||
$helptopic = $tickets->help_topic_id;
|
||||
$sla = $tickets->sla;
|
||||
$priority = $tickets->priority_id;
|
||||
$source = $tickets->source;
|
||||
$collaborator = '';
|
||||
$dept = $tickets->dept_id;
|
||||
$assign = $tickets->assigned_to;
|
||||
$form_data = null;
|
||||
$team_assign = null;
|
||||
$ticket_status = null;
|
||||
$auto_response = 0;
|
||||
|
||||
$this->TicketWorkflowController->workflow($fromaddress, $fromname, $subject, $body, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $collaborator, $dept, $assign, $team_assign, $ticket_status, $form_data, $auto_response);
|
||||
|
||||
return \Redirect::back()->with('success1', Lang::get('lang.successfully_replied'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user