Apply Laravel coding style
Shift automatically applies the Laravel coding style - which uses the PSR-12 coding style as a base with some minor additions. You may customize the code style applied by configuring [Pint](https://laravel.com/docs/pint), [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer), or [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) for your project root. For more information on customizing the code style applied by Shift, [watch this short video](https://laravelshift.com/videos/shift-code-style).
This commit is contained in:
@@ -92,7 +92,6 @@ class TicketController extends Controller
|
||||
* Save the data of new ticket and show the New ticket page with result.
|
||||
*
|
||||
* @param type CreateTicketRequest $request
|
||||
*
|
||||
* @return type response
|
||||
*/
|
||||
public function post_newticket(CreateTicketRequest $request, CountryCode $code, $api = false)
|
||||
@@ -133,8 +132,8 @@ class TicketController extends Controller
|
||||
$geoipcode = $code->where('iso', '=', $location->iso_code)->first();
|
||||
if ($phonecode == null) {
|
||||
$data = [
|
||||
'fails' => Lang::get('lang.country-code-required-error'),
|
||||
'phonecode' => $geoipcode->phonecode,
|
||||
'fails' => Lang::get('lang.country-code-required-error'),
|
||||
'phonecode' => $geoipcode->phonecode,
|
||||
'country_code_error' => 1,
|
||||
];
|
||||
if ($api != false) {
|
||||
@@ -144,10 +143,10 @@ class TicketController extends Controller
|
||||
return Redirect()->back()->with($data)->withInput($request->except('password'));
|
||||
} else {
|
||||
$code = CountryCode::select('phonecode')->where('phonecode', '=', $phonecode)->get();
|
||||
if (!count($code)) {
|
||||
if (! count($code)) {
|
||||
$data = [
|
||||
'fails' => Lang::get('lang.incorrect-country-code-error'),
|
||||
'phonecode' => $geoipcode->phonecode,
|
||||
'fails' => Lang::get('lang.incorrect-country-code-error'),
|
||||
'phonecode' => $geoipcode->phonecode,
|
||||
'country_code_error' => 1,
|
||||
];
|
||||
if ($api != false) {
|
||||
@@ -196,8 +195,7 @@ class TicketController extends Controller
|
||||
/**
|
||||
* Shows the ticket thread details.
|
||||
*
|
||||
* @param type $id
|
||||
*
|
||||
* @param type $id
|
||||
* @return type response
|
||||
*/
|
||||
public function thread($id)
|
||||
@@ -242,7 +240,7 @@ class TicketController extends Controller
|
||||
{
|
||||
$size = 0;
|
||||
$files = Input::file('attachment');
|
||||
if (!$files) {
|
||||
if (! $files) {
|
||||
return $size;
|
||||
}
|
||||
if (count($files) > 0) {
|
||||
@@ -272,7 +270,6 @@ class TicketController extends Controller
|
||||
*
|
||||
* @param type Ticket_Thread $thread
|
||||
* @param type TicketRequest $request
|
||||
*
|
||||
* @return type bool
|
||||
*/
|
||||
public function reply(Ticket_Thread $thread, Request $request, Ticket_attachments $ta, $mail = true, $system_reply = true, $user_id = '')
|
||||
@@ -376,7 +373,7 @@ class TicketController extends Controller
|
||||
$ticket_number = $tickets->ticket_number;
|
||||
$company = $this->company();
|
||||
$username = $ticket_user->first_name;
|
||||
if (!empty(Auth::user()->agent_sign)) {
|
||||
if (! empty(Auth::user()->agent_sign)) {
|
||||
$agentsign = Auth::user()->agent_sign;
|
||||
} else {
|
||||
$agentsign = null;
|
||||
@@ -391,10 +388,10 @@ class TicketController extends Controller
|
||||
}
|
||||
$data = [
|
||||
'ticket_id' => $request->input('ticket_ID'),
|
||||
'u_id' => $u_id,
|
||||
'body' => $request->input('reply_content'),
|
||||
'u_id' => $u_id,
|
||||
'body' => $request->input('reply_content'),
|
||||
];
|
||||
if (!$request->has('do-not-send')) {
|
||||
if (! $request->has('do-not-send')) {
|
||||
\Event::fire('Reply-Ticket', [$data]);
|
||||
}
|
||||
// sending attachments via php mail function
|
||||
@@ -403,7 +400,7 @@ class TicketController extends Controller
|
||||
$line = '---Reply above this line---<br><br>';
|
||||
$collaborators = Ticket_Collaborator::where('ticket_id', '=', $ticket_id)->get();
|
||||
$emails = Emails::where('department', '=', $tickets->dept_id)->first();
|
||||
if (!$email) {
|
||||
if (! $email) {
|
||||
$mail = false;
|
||||
}
|
||||
|
||||
@@ -415,16 +412,16 @@ class TicketController extends Controller
|
||||
$from = $this->PhpMailController->mailfrom('0', $tickets->dept_id),
|
||||
$to = ['name' => $user_name, 'email' => $email, 'cc' => $collaborators],
|
||||
$message = [
|
||||
'subject' => $ticket_subject.'[#'.$ticket_number.']',
|
||||
'body' => $line.$request->input('reply_content'),
|
||||
'scenario' => 'ticket-reply',
|
||||
'subject' => $ticket_subject.'[#'.$ticket_number.']',
|
||||
'body' => $line.$request->input('reply_content'),
|
||||
'scenario' => 'ticket-reply',
|
||||
'attachments' => $attachment_files,
|
||||
],
|
||||
$template_variables = [
|
||||
'ticket_number' => $ticket_number,
|
||||
'user' => $username,
|
||||
'agent_sign' => $agentsign,
|
||||
'system_link' => $link,
|
||||
'user' => $username,
|
||||
'agent_sign' => $agentsign,
|
||||
'system_link' => $link,
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -441,9 +438,8 @@ class TicketController extends Controller
|
||||
/**
|
||||
* Ticket edit and save ticket data.
|
||||
*
|
||||
* @param type $ticket_id
|
||||
* @param type $ticket_id
|
||||
* @param type Ticket_Thread $thread
|
||||
*
|
||||
* @return type bool
|
||||
*/
|
||||
public function ticketEditPost($ticket_id, Ticket_Thread $thread, Tickets $ticket)
|
||||
@@ -479,8 +475,7 @@ class TicketController extends Controller
|
||||
/**
|
||||
* Print Ticket Details.
|
||||
*
|
||||
* @param type $id
|
||||
*
|
||||
* @param type $id
|
||||
* @return type respponse
|
||||
*/
|
||||
public function ticket_print($id)
|
||||
@@ -509,8 +504,7 @@ class TicketController extends Controller
|
||||
/**
|
||||
* Generates Ticket Number.
|
||||
*
|
||||
* @param type $ticket_number
|
||||
*
|
||||
* @param type $ticket_number
|
||||
* @return type integer
|
||||
*/
|
||||
public function ticketNumberold($ticket_number)
|
||||
@@ -582,8 +576,7 @@ class TicketController extends Controller
|
||||
/**
|
||||
* check email for dublicate entry.
|
||||
*
|
||||
* @param type $email
|
||||
*
|
||||
* @param type $email
|
||||
* @return type bool
|
||||
*/
|
||||
public function checkEmail($email)
|
||||
@@ -599,8 +592,7 @@ class TicketController extends Controller
|
||||
/**
|
||||
* @category fucntion to check if mobile number is unqique or not
|
||||
*
|
||||
* @param string $mobile
|
||||
*
|
||||
* @param string $mobile
|
||||
* @return bool true(if mobile exists in users table)/false (if mobile does not exist in user table)
|
||||
*/
|
||||
public function checkMobile($mobile)
|
||||
@@ -616,15 +608,14 @@ class TicketController extends Controller
|
||||
/**
|
||||
* Create User while creating ticket.
|
||||
*
|
||||
* @param type $emailadd
|
||||
* @param type $username
|
||||
* @param type $subject
|
||||
* @param type $phone
|
||||
* @param type $helptopic
|
||||
* @param type $sla
|
||||
* @param type $priority
|
||||
* @param type $system
|
||||
*
|
||||
* @param type $emailadd
|
||||
* @param type $username
|
||||
* @param type $subject
|
||||
* @param type $phone
|
||||
* @param type $helptopic
|
||||
* @param type $sla
|
||||
* @param type $priority
|
||||
* @param type $system
|
||||
* @return type bool
|
||||
*/
|
||||
public function create_user($emailadd, $username, $subject, $body, $phone, $phonecode, $mobile_number, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $from_data, $auto_response, $status)
|
||||
@@ -632,7 +623,7 @@ class TicketController extends Controller
|
||||
// define global variables
|
||||
|
||||
$unique = $emailadd;
|
||||
if (!$emailadd) {
|
||||
if (! $emailadd) {
|
||||
$unique = $mobile_number;
|
||||
}
|
||||
// check emails
|
||||
@@ -684,11 +675,11 @@ class TicketController extends Controller
|
||||
if ($user_status == 0 || ($email_mandatory->status == 0 || $email_mandatory->status == '0')) {
|
||||
$value = [
|
||||
'full_name' => $username,
|
||||
'email' => $emailadd,
|
||||
'code' => $phonecode,
|
||||
'mobile' => $mobile_number,
|
||||
'email' => $emailadd,
|
||||
'code' => $phonecode,
|
||||
'mobile' => $mobile_number,
|
||||
'user_name' => $unique,
|
||||
'password' => $password,
|
||||
'password' => $password,
|
||||
];
|
||||
\Event::fire(new \App\Events\LoginEvent($value));
|
||||
}
|
||||
@@ -741,9 +732,9 @@ class TicketController extends Controller
|
||||
$to = ['name' => $username, 'email' => $emailadd],
|
||||
$message = ['subject' => $updated_subject, 'scenario' => 'create-ticket-by-agent', 'body' => $body],
|
||||
$template_variables = [
|
||||
'agent_sign' => Auth::user()->agent_sign,
|
||||
'agent_sign' => Auth::user()->agent_sign,
|
||||
'ticket_number' => $ticket_number2,
|
||||
'system_link' => $link,
|
||||
'system_link' => $link,
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -760,9 +751,9 @@ class TicketController extends Controller
|
||||
$to = ['name' => $username, 'email' => $emailadd],
|
||||
$message = ['subject' => $updated_subject, 'scenario' => 'create-ticket'],
|
||||
$template_variables = ['user' => $username,
|
||||
'ticket_number' => $ticket_number2,
|
||||
'department_sign' => '',
|
||||
'system_link' => $link,
|
||||
'ticket_number' => $ticket_number2,
|
||||
'department_sign' => '',
|
||||
'system_link' => $link,
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -823,32 +814,32 @@ class TicketController extends Controller
|
||||
$this->PhpMailController->sendmail(
|
||||
$from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id),
|
||||
$to = [
|
||||
'user' => $email_data['to_user'],
|
||||
'user' => $email_data['to_user'],
|
||||
'email' => $email_data['to_email'],
|
||||
],
|
||||
$message = [
|
||||
'subject' => $updated_subject,
|
||||
'body' => $body, 'scenario' => $mail,
|
||||
'body' => $body, 'scenario' => $mail,
|
||||
],
|
||||
$template_variables = [
|
||||
'ticket_agent_name' => $email_data['to_user_name'],
|
||||
'ticket_client_name' => $username,
|
||||
'ticket_agent_name' => $email_data['to_user_name'],
|
||||
'ticket_client_name' => $username,
|
||||
'ticket_client_email' => $emailadd,
|
||||
'user' => $email_data['to_user_name'],
|
||||
'ticket_number' => $ticket_number2,
|
||||
'email_address' => $emailadd,
|
||||
'name' => $ticket_creator, ]
|
||||
'user' => $email_data['to_user_name'],
|
||||
'ticket_number' => $ticket_number2,
|
||||
'email_address' => $emailadd,
|
||||
'name' => $ticket_creator, ]
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
$data = [
|
||||
'ticket_number' => $ticket_number2,
|
||||
'user_id' => $user_id,
|
||||
'subject' => $subject,
|
||||
'body' => $body,
|
||||
'status' => $status,
|
||||
'Priority' => $priority,
|
||||
'user_id' => $user_id,
|
||||
'subject' => $subject,
|
||||
'body' => $body,
|
||||
'status' => $status,
|
||||
'Priority' => $priority,
|
||||
];
|
||||
\Event::fire('Create-Ticket', [$data]);
|
||||
$data = [
|
||||
@@ -900,13 +891,12 @@ class TicketController extends Controller
|
||||
/**
|
||||
* Check the response of the ticket.
|
||||
*
|
||||
* @param type $user_id
|
||||
* @param type $subject
|
||||
* @param type $body
|
||||
* @param type $helptopic
|
||||
* @param type $sla
|
||||
* @param type $priority
|
||||
*
|
||||
* @param type $user_id
|
||||
* @param type $subject
|
||||
* @param type $body
|
||||
* @param type $helptopic
|
||||
* @param type $sla
|
||||
* @param type $priority
|
||||
* @return type string
|
||||
*/
|
||||
public function check_ticket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data, $status)
|
||||
@@ -948,10 +938,10 @@ class TicketController extends Controller
|
||||
// event fire for internal notes
|
||||
//event to change status
|
||||
$data = [
|
||||
'id' => $ticket_number,
|
||||
'status' => 'Open',
|
||||
'id' => $ticket_number,
|
||||
'status' => 'Open',
|
||||
'first_name' => $username,
|
||||
'last_name' => '',
|
||||
'last_name' => '',
|
||||
];
|
||||
\Event::fire('change-status', [$data]);
|
||||
}
|
||||
@@ -976,13 +966,12 @@ class TicketController extends Controller
|
||||
/**
|
||||
* Create Ticket.
|
||||
*
|
||||
* @param type $user_id
|
||||
* @param type $subject
|
||||
* @param type $body
|
||||
* @param type $helptopic
|
||||
* @param type $sla
|
||||
* @param type $priority
|
||||
*
|
||||
* @param type $user_id
|
||||
* @param type $subject
|
||||
* @param type $body
|
||||
* @param type $helptopic
|
||||
* @param type $sla
|
||||
* @param type $priority
|
||||
* @return type string
|
||||
*/
|
||||
public function createTicket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data, $status)
|
||||
@@ -1052,7 +1041,7 @@ class TicketController extends Controller
|
||||
$form_name = $form->formname;
|
||||
}
|
||||
foreach ($form_data as $key => $form_details) {
|
||||
if (!is_array($form_details)) {
|
||||
if (! is_array($form_details)) {
|
||||
$form_value = new Ticket_Form_Data();
|
||||
$form_value->ticket_id = $id;
|
||||
$form_value->title = $key;
|
||||
@@ -1073,11 +1062,10 @@ class TicketController extends Controller
|
||||
/**
|
||||
* Generate Ticket Thread.
|
||||
*
|
||||
* @param type $subject
|
||||
* @param type $body
|
||||
* @param type $id
|
||||
* @param type $user_id
|
||||
*
|
||||
* @param type $subject
|
||||
* @param type $body
|
||||
* @param type $id
|
||||
* @param type $user_id
|
||||
* @return type
|
||||
*/
|
||||
public function ticketThread($subject, $body, $id, $user_id)
|
||||
@@ -1098,8 +1086,7 @@ class TicketController extends Controller
|
||||
/**
|
||||
* Generate a random string for password.
|
||||
*
|
||||
* @param type $length
|
||||
*
|
||||
* @param type $length
|
||||
* @return type string
|
||||
*/
|
||||
public function generateRandomString($length = 10)
|
||||
@@ -1117,9 +1104,8 @@ class TicketController extends Controller
|
||||
/**
|
||||
* function to Ticket Close.
|
||||
*
|
||||
* @param type $id
|
||||
* @param type $id
|
||||
* @param type Tickets $ticket
|
||||
*
|
||||
* @return type string
|
||||
*/
|
||||
public function close($id, Tickets $ticket)
|
||||
@@ -1168,10 +1154,10 @@ class TicketController extends Controller
|
||||
return 0;
|
||||
}
|
||||
$data = [
|
||||
'id' => $ticket_status->ticket_number,
|
||||
'status' => 'Closed',
|
||||
'id' => $ticket_status->ticket_number,
|
||||
'status' => 'Closed',
|
||||
'first_name' => Auth::user()->first_name,
|
||||
'last_name' => Auth::user()->last_name,
|
||||
'last_name' => Auth::user()->last_name,
|
||||
];
|
||||
\Event::fire('change-status', [$data]);
|
||||
|
||||
@@ -1181,9 +1167,8 @@ class TicketController extends Controller
|
||||
/**
|
||||
* function to Ticket resolved.
|
||||
*
|
||||
* @param type $id
|
||||
* @param type $id
|
||||
* @param type Tickets $ticket
|
||||
*
|
||||
* @return type string
|
||||
*/
|
||||
public function resolve($id, Tickets $ticket)
|
||||
@@ -1214,10 +1199,10 @@ class TicketController extends Controller
|
||||
}
|
||||
$thread->save();
|
||||
$data = [
|
||||
'id' => $ticket_status->ticket_number,
|
||||
'status' => 'Resolved',
|
||||
'id' => $ticket_status->ticket_number,
|
||||
'status' => 'Resolved',
|
||||
'first_name' => Auth::user()->first_name,
|
||||
'last_name' => Auth::user()->last_name,
|
||||
'last_name' => Auth::user()->last_name,
|
||||
];
|
||||
\Event::fire('change-status', [$data]);
|
||||
|
||||
@@ -1227,9 +1212,8 @@ class TicketController extends Controller
|
||||
/**
|
||||
* function to Open Ticket.
|
||||
*
|
||||
* @param type $id
|
||||
* @param type $id
|
||||
* @param type Tickets $ticket
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function open($id, Tickets $ticket)
|
||||
@@ -1254,10 +1238,10 @@ class TicketController extends Controller
|
||||
$thread->body = $ticket_status_message->message.' '.Auth::user()->first_name.' '.Auth::user()->last_name;
|
||||
$thread->save();
|
||||
$data = [
|
||||
'id' => $ticket_status->ticket_number,
|
||||
'status' => 'Open',
|
||||
'id' => $ticket_status->ticket_number,
|
||||
'status' => 'Open',
|
||||
'first_name' => Auth::user()->first_name,
|
||||
'last_name' => Auth::user()->last_name,
|
||||
'last_name' => Auth::user()->last_name,
|
||||
];
|
||||
\Event::fire('change-status', [$data]);
|
||||
|
||||
@@ -1267,9 +1251,8 @@ class TicketController extends Controller
|
||||
/**
|
||||
* Function to delete ticket.
|
||||
*
|
||||
* @param type $id
|
||||
* @param type $id
|
||||
* @param type Tickets $ticket
|
||||
*
|
||||
* @return type string
|
||||
*/
|
||||
public function delete($id, Tickets $ticket)
|
||||
@@ -1286,10 +1269,10 @@ class TicketController extends Controller
|
||||
$ticket_attachment->delete();
|
||||
}
|
||||
$data = [
|
||||
'id' => $ticket_delete->ticket_number,
|
||||
'status' => 'Deleted',
|
||||
'id' => $ticket_delete->ticket_number,
|
||||
'status' => 'Deleted',
|
||||
'first_name' => Auth::user()->first_name,
|
||||
'last_name' => Auth::user()->last_name,
|
||||
'last_name' => Auth::user()->last_name,
|
||||
];
|
||||
\Event::fire('change-status', [$data]);
|
||||
|
||||
@@ -1306,10 +1289,10 @@ class TicketController extends Controller
|
||||
$thread->body = $ticket_status_message->message.' '.Auth::user()->first_name.' '.Auth::user()->last_name;
|
||||
$thread->save();
|
||||
$data = [
|
||||
'id' => $ticket_delete->ticket_number,
|
||||
'status' => 'Deleted',
|
||||
'id' => $ticket_delete->ticket_number,
|
||||
'status' => 'Deleted',
|
||||
'first_name' => Auth::user()->first_name,
|
||||
'last_name' => Auth::user()->last_name,
|
||||
'last_name' => Auth::user()->last_name,
|
||||
];
|
||||
\Event::fire('change-status', [$data]);
|
||||
|
||||
@@ -1320,9 +1303,8 @@ class TicketController extends Controller
|
||||
/**
|
||||
* Function to ban an email.
|
||||
*
|
||||
* @param type $id
|
||||
* @param type $id
|
||||
* @param type Tickets $ticket
|
||||
*
|
||||
* @return type string
|
||||
*/
|
||||
public function ban($id, Tickets $ticket)
|
||||
@@ -1340,8 +1322,7 @@ class TicketController extends Controller
|
||||
/**
|
||||
* function to assign ticket.
|
||||
*
|
||||
* @param type $id
|
||||
*
|
||||
* @param type $id
|
||||
* @return type bool
|
||||
*/
|
||||
public function assign($id)
|
||||
@@ -1413,8 +1394,7 @@ class TicketController extends Controller
|
||||
/**
|
||||
* Function to post internal note.
|
||||
*
|
||||
* @param type $id
|
||||
*
|
||||
* @param type $id
|
||||
* @return type bool
|
||||
*/
|
||||
public function InternalNote($id)
|
||||
@@ -1431,8 +1411,8 @@ class TicketController extends Controller
|
||||
$NewThread->save();
|
||||
$data = [
|
||||
'ticket_id' => $id,
|
||||
'u_id' => Auth::user()->first_name.' '.Auth::user()->last_name,
|
||||
'body' => $InternalContent,
|
||||
'u_id' => Auth::user()->first_name.' '.Auth::user()->last_name,
|
||||
'body' => $InternalContent,
|
||||
];
|
||||
\Event::fire('Reply-Ticket', [$data]);
|
||||
|
||||
@@ -1442,8 +1422,7 @@ class TicketController extends Controller
|
||||
/**
|
||||
* Function to surrender a ticket.
|
||||
*
|
||||
* @param type $id
|
||||
*
|
||||
* @param type $id
|
||||
* @return type bool
|
||||
*/
|
||||
public function surrender($id)
|
||||
@@ -1469,8 +1448,7 @@ class TicketController extends Controller
|
||||
/**
|
||||
* Search.
|
||||
*
|
||||
* @param type $keyword
|
||||
*
|
||||
* @param type $keyword
|
||||
* @return type array
|
||||
*/
|
||||
public function search($keyword)
|
||||
@@ -1487,8 +1465,7 @@ class TicketController extends Controller
|
||||
/**
|
||||
* Search.
|
||||
*
|
||||
* @param type $keyword
|
||||
*
|
||||
* @param type $keyword
|
||||
* @return type array
|
||||
*/
|
||||
public function stores($ticket_number)
|
||||
@@ -1507,8 +1484,7 @@ class TicketController extends Controller
|
||||
/**
|
||||
* store_collaborators.
|
||||
*
|
||||
* @param type $headers
|
||||
*
|
||||
* @param type $headers
|
||||
* @return type
|
||||
*/
|
||||
public function storeCollaborators($headers, $id)
|
||||
@@ -1590,8 +1566,7 @@ class TicketController extends Controller
|
||||
/**
|
||||
* cleanMe.
|
||||
*
|
||||
* @param type $input
|
||||
*
|
||||
* @param type $input
|
||||
* @return type
|
||||
*/
|
||||
public function cleanMe($input)
|
||||
@@ -1608,7 +1583,6 @@ class TicketController extends Controller
|
||||
* autosearch.
|
||||
*
|
||||
* @param type Image $image
|
||||
*
|
||||
* @return type json
|
||||
*/
|
||||
public function autosearch($id)
|
||||
@@ -1622,7 +1596,6 @@ class TicketController extends Controller
|
||||
* autosearch2.
|
||||
*
|
||||
* @param type Image $image
|
||||
*
|
||||
* @return type json
|
||||
*/
|
||||
public function autosearch2(User $user)
|
||||
@@ -1635,7 +1608,6 @@ class TicketController extends Controller
|
||||
* autosearch.
|
||||
*
|
||||
* @param type Image $image
|
||||
*
|
||||
* @return type json
|
||||
*/
|
||||
public function usersearch()
|
||||
@@ -1652,7 +1624,7 @@ class TicketController extends Controller
|
||||
.'</div>';
|
||||
}
|
||||
$ticket_collaborator = Ticket_Collaborator::where('ticket_id', '=', $ticket_id)->where('user_id', '=', $data->id)->first();
|
||||
if (!isset($ticket_collaborator)) {
|
||||
if (! isset($ticket_collaborator)) {
|
||||
$ticket_collaborator = new Ticket_Collaborator();
|
||||
$ticket_collaborator->isactive = 1;
|
||||
$ticket_collaborator->ticket_id = $ticket_id;
|
||||
@@ -1670,7 +1642,6 @@ class TicketController extends Controller
|
||||
* useradd.
|
||||
*
|
||||
* @param type Image $image
|
||||
*
|
||||
* @return type json
|
||||
*/
|
||||
public function useradd()
|
||||
@@ -1806,8 +1777,7 @@ class TicketController extends Controller
|
||||
/**
|
||||
* user time zone.
|
||||
*
|
||||
* @param type $utc
|
||||
*
|
||||
* @param type $utc
|
||||
* @return type date
|
||||
*/
|
||||
public static function usertimezone($utc)
|
||||
@@ -1855,8 +1825,7 @@ class TicketController extends Controller
|
||||
/**
|
||||
* lock.
|
||||
*
|
||||
* @param type $id
|
||||
*
|
||||
* @param type $id
|
||||
* @return type null
|
||||
*/
|
||||
public function lock($id)
|
||||
@@ -1998,8 +1967,7 @@ class TicketController extends Controller
|
||||
* checkLock($id)
|
||||
* function to check and lock ticket.
|
||||
*
|
||||
* @param int $id
|
||||
*
|
||||
* @param int $id
|
||||
* @return int
|
||||
*/
|
||||
public function checkLock($id)
|
||||
@@ -2050,8 +2018,7 @@ class TicketController extends Controller
|
||||
/**
|
||||
* function to Change owner.
|
||||
*
|
||||
* @param type $id
|
||||
*
|
||||
* @param type $id
|
||||
* @return type bool
|
||||
*/
|
||||
public function changeOwner($id)
|
||||
@@ -2116,7 +2083,6 @@ class TicketController extends Controller
|
||||
* useradd.
|
||||
*
|
||||
* @param type Image $image
|
||||
*
|
||||
* @return type json
|
||||
*/
|
||||
public function changeOwnerAdd($email, $name, $ticket_id)
|
||||
@@ -2125,9 +2091,9 @@ class TicketController extends Controller
|
||||
$email = $email;
|
||||
$ticket_id = $ticket_id;
|
||||
$validator = \Validator::make(
|
||||
['email' => $email,
|
||||
'name' => $name, ],
|
||||
['email' => 'required|email',
|
||||
['email' => $email,
|
||||
'name' => $name, ],
|
||||
['email' => 'required|email',
|
||||
]
|
||||
);
|
||||
$user = User::where('email', '=', $email)->first();
|
||||
@@ -2249,12 +2215,12 @@ class TicketController extends Controller
|
||||
->update(['status' => 3]);
|
||||
//event has $p_id and $value
|
||||
\Event::fire('ticket.merge', [['parent' => $p_id, 'child' => $value]]);
|
||||
if (!empty(Input::get('reason'))) {
|
||||
if (! empty(Input::get('reason'))) {
|
||||
$reason = Input::get('reason');
|
||||
} else {
|
||||
$reason = Lang::get('lang.no-reason');
|
||||
}
|
||||
if (!empty(Input::get('title'))) {
|
||||
if (! empty(Input::get('title'))) {
|
||||
Ticket_Thread::where('ticket_id', '=', $p_id)->first()
|
||||
->update(['title' => Input::get('title')]);
|
||||
}
|
||||
@@ -2304,7 +2270,6 @@ class TicketController extends Controller
|
||||
*@category function to call and show ticket details in tool tip via ajax
|
||||
*
|
||||
*@param null
|
||||
*
|
||||
*@return string //script to load tooltip data
|
||||
*/
|
||||
public static function tooltip($ticketid)
|
||||
@@ -2392,7 +2357,6 @@ class TicketController extends Controller
|
||||
* @category function to chech if user verifcaition required for creating tickets or not
|
||||
*
|
||||
* @param null
|
||||
*
|
||||
* @return int 0/1
|
||||
*/
|
||||
public function checkUserVerificationStatus()
|
||||
@@ -2426,7 +2390,7 @@ class TicketController extends Controller
|
||||
->where('ticket_thread.id', $threadid)
|
||||
->first();
|
||||
//dd($thread);
|
||||
if (!$thread) {
|
||||
if (! $thread) {
|
||||
throw new Exception('Sorry we can not find your request');
|
||||
}
|
||||
$company = \App\Model\helpdesk\Settings\Company::where('id', '=', '1')->first();
|
||||
@@ -2608,7 +2572,7 @@ class TicketController extends Controller
|
||||
$url = [];
|
||||
$encode = [];
|
||||
$img = [];
|
||||
foreach ($result as $key=>$img_tag) {
|
||||
foreach ($result as $key => $img_tag) {
|
||||
//dd($img_tag);
|
||||
preg_match_all('/(src)=("[^"]*")/i', $img_tag[$key], $img[$key]);
|
||||
}
|
||||
@@ -2648,7 +2612,6 @@ class TicketController extends Controller
|
||||
*@category function to send notification of ticket merging to the owners
|
||||
*
|
||||
*@param srting array $t_id, $p_id
|
||||
*
|
||||
*@return null
|
||||
*/
|
||||
public function sendMergeNotification($p_id, $t_id)
|
||||
@@ -2664,7 +2627,7 @@ class TicketController extends Controller
|
||||
array_push($child_ticket_numbers, $value->ticket_number);
|
||||
}
|
||||
// dd(implode(", ",$child_ticket_numbers), $ticket_details->ticket_number);
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticket_details->dept_id), $to = ['user' => $user_detail->full_name, 'email' => $user_detail->email], $message = ['subject' => '', 'body' => '', 'scenario' => 'merge-ticket-notification'], $template_variables = ['user' => $user_detail->full_name, 'ticket_number' => $ticket_details->ticket_number, 'ticket_link' => route('ticket.thread', $p_id), 'merged_ticket_numbers' => implode(', ', $child_ticket_numbers)]);
|
||||
$this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticket_details->dept_id), $to = ['user' => $user_detail->full_name, 'email' => $user_detail->email], $message = ['subject' => '', 'body' => '', 'scenario' => 'merge-ticket-notification'], $template_variables = ['user' => $user_detail->full_name, 'ticket_number' => $ticket_details->ticket_number, 'ticket_link' => route('ticket.thread', $p_id), 'merged_ticket_numbers' => implode(', ', $child_ticket_numbers)]);
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
@@ -2709,8 +2672,7 @@ class TicketController extends Controller
|
||||
/**
|
||||
* chumper's function to return data to chumper datatable.
|
||||
*
|
||||
* @param array-object $tickets
|
||||
*
|
||||
* @param array-object $tickets
|
||||
* @return array-object
|
||||
*/
|
||||
public static function genreateTableJson($tickets)
|
||||
|
Reference in New Issue
Block a user