Apply fixes from StyleCI

This commit is contained in:
Manish Verma
2017-09-04 09:52:33 +00:00
committed by StyleCI Bot
parent 837c99db39
commit 7a78368037
39 changed files with 1023 additions and 1498 deletions

View File

@@ -284,24 +284,22 @@ class TicketController extends Controller
if ($result[1]) {
$status = $this->checkUserVerificationStatus();
if ($status == 1) {
if ($api != false)
{
if ($api != false) {
$ticket = Tickets::where('ticket_number', '=', $result[0])->select('id')->first();
return ['ticket_id' => $ticket->id, 'message' => Lang::get('lang.Ticket-created-successfully')];
}
return Redirect('newticket')->with('success', Lang::get('lang.Ticket-created-successfully'));
} else {
if ($api != false)
{
if ($api != false) {
return response()->json(['success' => Lang::get('lang.Ticket-created-successfully')]);
}
return Redirect('newticket')->with('success', Lang::get('lang.Ticket-created-successfully2'));
}
} else {
if ($api != false)
{
if ($api != false) {
return response()->json(['error' => Lang::get('lang.failed-to-create-user-tcket-as-mobile-has-been-taken')], 500);
}
@@ -309,8 +307,7 @@ class TicketController extends Controller
}
} catch (Exception $e) {
dd($e);
if ($api != false)
{
if ($api != false) {
return response()->json(['error' => $e->getMessage()], 500);
}
@@ -403,6 +400,7 @@ class TicketController extends Controller
public function reply(Ticket_Thread $thread, Request $request, Ticket_attachments $ta, $mail = true, $system_reply = true, $user_id = '')
{
\Event::fire('reply.request', [$request]);
try {
if (is_array($request->file('attachment'))) {
} else {
@@ -815,6 +813,7 @@ class TicketController extends Controller
}
// Event fire
\Event::fire(new \App\Events\ReadMailEvent($user_id, $password));
try {
if ($auto_response == 0) {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user->first_name, 'email' => $emailadd], $message = ['subject' => null, 'scenario' => 'registration-notification'], $template_variables = ['user' => $user->first_name, 'email_address' => $emailadd, 'user_password' => $password]);
@@ -867,6 +866,7 @@ class TicketController extends Controller
}
} else {
$body2 = null;
try {
if ($auto_response == 0) {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['name' => $username, 'email' => $emailadd], $message = ['subject' => $updated_subject, 'scenario' => 'create-ticket'],
@@ -1234,10 +1234,10 @@ class TicketController extends Controller
} else {
$ticket_status = $ticket->where('id', '=', $id)->first();
}
// checking for unautherised access attempt on other than owner ticket id
if ($ticket_status == null) {
return redirect()->route('unauth');
}
// checking for unautherised access attempt on other than owner ticket id
if ($ticket_status == null) {
return redirect()->route('unauth');
}
$ticket_status->status = 3;
$ticket_status->closed = 1;
$ticket_status->closed_at = date('Y-m-d H:i:s');
@@ -1265,6 +1265,7 @@ class TicketController extends Controller
} else {
$from_email = $sending_emails->id;
}
try {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticket_status->dept_id), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'close-ticket'], $template_variables = ['ticket_number' => $ticket_number]);
} catch (\Exception $e) {
@@ -1501,6 +1502,7 @@ class TicketController extends Controller
$agent_email = $user_detail->email;
$ticket_link = route('ticket.thread', $id);
$master = Auth::user()->first_name.' '.Auth::user()->last_name;
try {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticket->dept_id), $to = ['name' => $agent, 'email' => $agent_email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'assign-ticket'], $template_variables = ['ticket_agent_name' => $agent, 'ticket_number' => $ticket_number, 'ticket_assigner' => $master, 'ticket_link' => $ticket_link]);
} catch (\Exception $e) {
@@ -1634,6 +1636,7 @@ class TicketController extends Controller
$create_user->password = Hash::make($password);
$create_user->save();
$user_id = $create_user->id;
try {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]);
} catch (\Exception $e) {
@@ -2321,6 +2324,7 @@ class TicketController extends Controller
$user->role = 'user';
if ($user->save()) {
$user_id = $user->id;
try {
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'Password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]);
} catch (\Exception $e) {