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:
		| @@ -73,7 +73,6 @@ class CannedController extends Controller | ||||
|      * | ||||
|      * @param type CannedRequest $request | ||||
|      * @param type Canned        $canned | ||||
|      * | ||||
|      * @return type Redirect | ||||
|      */ | ||||
|     public function store(CannedRequest $request, Canned $canned) | ||||
| @@ -95,9 +94,8 @@ class CannedController extends Controller | ||||
|     /** | ||||
|      * Show the form for editing the Canned Response. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * @param  type  $id | ||||
|      * @param type Canned $canned | ||||
|      * | ||||
|      * @return type View | ||||
|      */ | ||||
|     public function edit($id, Canned $canned) | ||||
| @@ -115,10 +113,9 @@ class CannedController extends Controller | ||||
|     /** | ||||
|      * Update the Canned Response in database. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * @param  type  $id | ||||
|      * @param type CannedUpdateRequest $request | ||||
|      * @param type Canned              $canned | ||||
|      * | ||||
|      * @return type Redirect | ||||
|      */ | ||||
|     public function update($id, CannedUpdateRequest $request, Canned $canned) | ||||
| @@ -142,9 +139,8 @@ class CannedController extends Controller | ||||
|     /** | ||||
|      * Delete the Canned Response from storage. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * @param  type  $id | ||||
|      * @param type Canned $canned | ||||
|      * | ||||
|      * @return type Redirect | ||||
|      */ | ||||
|     public function destroy($id, Canned $canned) | ||||
| @@ -166,8 +162,7 @@ class CannedController extends Controller | ||||
|     /** | ||||
|      * Fetch Canned Response in the ticket detail page. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * | ||||
|      * @param  type  $id | ||||
|      * @return type json | ||||
|      */ | ||||
|     public function get_canned($id) | ||||
|   | ||||
| @@ -39,7 +39,6 @@ class FilterController extends Controller | ||||
|      * @category constructor function | ||||
|      * | ||||
|      * @param Array/Object $request | ||||
|      * | ||||
|      * @return null | ||||
|      */ | ||||
|     public function __construct(Request $req) | ||||
| @@ -53,7 +52,6 @@ class FilterController extends Controller | ||||
|      * @category function to handle ticket table/filteration request and build tables | ||||
|      * | ||||
|      * @param Array/Object $request | ||||
|      * | ||||
|      * @return json response //build by getTable() function in TicketController | ||||
|      */ | ||||
|     public function getFilter(Request $request) | ||||
| @@ -142,8 +140,7 @@ class FilterController extends Controller | ||||
|     /** | ||||
|      * @category function to check of all the parameters passed to the URL are correct or not | ||||
|      * | ||||
|      * @param array $inputs | ||||
|      * | ||||
|      * @param  array  $inputs | ||||
|      * @return bool true/false | ||||
|      */ | ||||
|     public function checkRequestIsCorrect($table, $inputs) | ||||
| @@ -174,7 +171,7 @@ class FilterController extends Controller | ||||
|         } | ||||
|         ksort($inputs); | ||||
|         foreach ($inputs as $key => $input) { | ||||
|             if (!in_array($key, $available_options)) { | ||||
|             if (! in_array($key, $available_options)) { | ||||
|                 // dd('here '.$key); | ||||
|                 $table = $table->where('tickets.id', '=', null); | ||||
|             } else { | ||||
| @@ -188,8 +185,7 @@ class FilterController extends Controller | ||||
|     /** | ||||
|      * @category function to filter tickets based on user input requests | ||||
|      * | ||||
|      * @param string $input, $value, $table | ||||
|      * | ||||
|      * @param  string  $input, $value, $table | ||||
|      * @return builder $table | ||||
|      */ | ||||
|     public function filterByInputs($input, $value, $table, $is_mytickets) | ||||
| @@ -358,8 +354,7 @@ class FilterController extends Controller | ||||
|     /** | ||||
|      * @category function to filter the tickets based on show value in the request | ||||
|      * | ||||
|      * @param array $value(), builder object $table | ||||
|      * | ||||
|      * @param  array  $value(), builder object $table | ||||
|      * @return builder object $table | ||||
|      */ | ||||
|     public function showPage($value, $table) | ||||
| @@ -436,7 +431,7 @@ class FilterController extends Controller | ||||
|     /** | ||||
|      * @category function to filter tickets builder based on agent/admin departments | ||||
|      * | ||||
|      * @param array $value //requested department, $table | ||||
|      * @param  array  $value //requested department, $table | ||||
|      * | ||||
|      * @var array | ||||
|      * | ||||
| @@ -466,7 +461,7 @@ class FilterController extends Controller | ||||
|     /** | ||||
|      * @category function to return department ids and access right of departments for agents | ||||
|      * | ||||
|      * @param array $departments | ||||
|      * @param  array  $departments | ||||
|      * | ||||
|      * @var array | ||||
|      * | ||||
| @@ -490,7 +485,7 @@ class FilterController extends Controller | ||||
|     /** | ||||
|      * @category function to filter and return ticket query builder based on priority | ||||
|      * | ||||
|      * @param array $priority, builder $table | ||||
|      * @param  array  $priority, builder $table | ||||
|      * | ||||
|      * @var array | ||||
|      * | ||||
| @@ -583,7 +578,7 @@ class FilterController extends Controller | ||||
|     /** | ||||
|      * @category function to filter table for various date option like created, last modified, duo date and overdue | ||||
|      * | ||||
|      * @param string $type (to check type of filter to apply on date), string $value for filters, builder $table | ||||
|      * @param  string  $type (to check type of filter to apply on date), string $value for filters, builder $table | ||||
|      * | ||||
|      * @var array [start and end dates] | ||||
|      * | ||||
| @@ -625,7 +620,7 @@ class FilterController extends Controller | ||||
|     /** | ||||
|      * @category function to get start and end date to apply date filter | ||||
|      * | ||||
|      * @param string $value | ||||
|      * @param  string  $value | ||||
|      * | ||||
|      * @var date string, date string | ||||
|      * | ||||
| @@ -872,7 +867,7 @@ class FilterController extends Controller | ||||
|      * @category function to apply date filters in table builder after | ||||
|      * getting start and end date based on the type of date filter | ||||
|      * | ||||
|      * @param array $dates, builder $table, $column (type of filter based on which column is being chosen), $value | ||||
|      * @param  array  $dates, builder $table, $column (type of filter based on which column is being chosen), $value | ||||
|      * | ||||
|      * @var string (name of column), array | ||||
|      * | ||||
| @@ -906,7 +901,7 @@ class FilterController extends Controller | ||||
|     /** | ||||
|      * @category function to filter ticket by source of creation | ||||
|      * | ||||
|      * @param array $name of source, builder $table | ||||
|      * @param  array  $name of source, builder $table | ||||
|      * | ||||
|      * @var array | ||||
|      * | ||||
| @@ -927,8 +922,7 @@ class FilterController extends Controller | ||||
|      * | ||||
|      * @category function to get array of status to filter tickets | ||||
|      * | ||||
|      * @param string $status | ||||
|      * | ||||
|      * @param  string  $status | ||||
|      * @return array $status_array | ||||
|      */ | ||||
|     // public function getStatusArray($status) | ||||
| @@ -974,7 +968,6 @@ class FilterController extends Controller | ||||
|      * @category function to filter table builder based on requested status | ||||
|      * | ||||
|      * @param string array $status_array, builder $table | ||||
|      * | ||||
|      * @return builder $table | ||||
|      */ | ||||
|     public function filterByStatus($status_array, $table) | ||||
| @@ -990,8 +983,7 @@ class FilterController extends Controller | ||||
|     /** | ||||
|      * @category function to format and return user tickets | ||||
|      * | ||||
|      * @param string $segment | ||||
|      * | ||||
|      * @param  string  $segment | ||||
|      * @return builder | ||||
|      */ | ||||
|     public function formatUserTickets($segment) | ||||
| @@ -1037,7 +1029,6 @@ class FilterController extends Controller | ||||
|      * @category function to filter results on basis of last replier | ||||
|      * | ||||
|      * @param string array $value, builder $ticket | ||||
|      * | ||||
|      * @return builder | ||||
|      */ | ||||
|     public function filterByLastResponder($value, $tickets) | ||||
| @@ -1075,8 +1066,7 @@ class FilterController extends Controller | ||||
|     /** | ||||
|      * @category function to apply help topic filter | ||||
|      * | ||||
|      * @param array $value, object $table | ||||
|      * | ||||
|      * @param  array  $value, object $table | ||||
|      * @return builder | ||||
|      */ | ||||
|     public function filterByHelpTopic($value, $table) | ||||
| @@ -1090,9 +1080,8 @@ class FilterController extends Controller | ||||
|      * @category function to return builder for show filter after checking if input | ||||
|      * request has status or not | ||||
|      * | ||||
|      * @param bool $has_status(if request has status filter values or not), | ||||
|      * @param  bool  $has_status(if request has status filter values or not), | ||||
|      *                            Object $table, string $status(basic pupose if status) | ||||
|      * | ||||
|      * @return object $table; | ||||
|      */ | ||||
|     public function returnShowPageWithStatus($has_status, $table, $status) | ||||
|   | ||||
| @@ -316,7 +316,6 @@ class FilterControllerOld extends Controller | ||||
|      *@category function to format and return user tickets | ||||
|      * | ||||
|      *@param  string  $segment | ||||
|      * | ||||
|      *@return builder | ||||
|      */ | ||||
|     public function formatUserTickets($segment) | ||||
|   | ||||
| @@ -17,8 +17,7 @@ class ImapMail extends Mailbox | ||||
|      * This function uses imap_search() to perform a search on the mailbox currently opened in the given IMAP stream. | ||||
|      * For example, to match all unanswered mails sent by Mom, you'd use: "UNANSWERED FROM mom". | ||||
|      * | ||||
|      * @param string $criteria See http://php.net/imap_search for a complete list of available criteria | ||||
|      * | ||||
|      * @param  string  $criteria See http://php.net/imap_search for a complete list of available criteria | ||||
|      * @return array mailsIds (or empty array) | ||||
|      */ | ||||
|     public function searchMailbox($criteria = 'ALL') | ||||
|   | ||||
| @@ -59,8 +59,7 @@ class MailController extends Controller | ||||
|     /** | ||||
|      * separate reply. | ||||
|      * | ||||
|      * @param type $body | ||||
|      * | ||||
|      * @param  type  $body | ||||
|      * @return type string | ||||
|      */ | ||||
|     public function separate_reply($body) | ||||
| @@ -72,14 +71,13 @@ class MailController extends Controller | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param object $email | ||||
|      * | ||||
|      * @param  object  $email | ||||
|      * @return int | ||||
|      */ | ||||
|     public function priority($email) | ||||
|     { | ||||
|         $priority = $email->priority; | ||||
|         if (!$priority) { | ||||
|         if (! $priority) { | ||||
|             $priority = $this->ticketController()->getSystemDefaultPriority(); | ||||
|         } | ||||
|  | ||||
| @@ -89,14 +87,13 @@ class MailController extends Controller | ||||
|     /** | ||||
|      * get department. | ||||
|      * | ||||
|      * @param object $email | ||||
|      * | ||||
|      * @param  object  $email | ||||
|      * @return int | ||||
|      */ | ||||
|     public function department($email) | ||||
|     { | ||||
|         $department = $email->department; | ||||
|         if (!$department) { | ||||
|         if (! $department) { | ||||
|             $department = $this->ticketController()->getSystemDefaultDepartment(); | ||||
|         } | ||||
|  | ||||
| @@ -106,15 +103,14 @@ class MailController extends Controller | ||||
|     /** | ||||
|      * get help topic. | ||||
|      * | ||||
|      * @param object $email | ||||
|      * | ||||
|      * @param  object  $email | ||||
|      * @return int | ||||
|      */ | ||||
|     public function helptopic($email) | ||||
|     { | ||||
|         //dd($email); | ||||
|         $helptopic = $email->help_topic; | ||||
|         if (!$helptopic) { | ||||
|         if (! $helptopic) { | ||||
|             $helptopic = $this->ticketController()->getSystemDefaultHelpTopic(); | ||||
|         } | ||||
|  | ||||
| @@ -124,8 +120,7 @@ class MailController extends Controller | ||||
|     /** | ||||
|      * get sla. | ||||
|      * | ||||
|      * @param object $email | ||||
|      * | ||||
|      * @param  object  $email | ||||
|      * @return int | ||||
|      */ | ||||
|     public function sla($email) | ||||
| @@ -135,7 +130,7 @@ class MailController extends Controller | ||||
|         if ($help) { | ||||
|             $sla = $help->sla_plan; | ||||
|         } | ||||
|         if (!$sla) { | ||||
|         if (! $sla) { | ||||
|             $sla = $this->ticketController()->getSystemDefaultSla(); | ||||
|         } | ||||
|  | ||||
| @@ -191,17 +186,17 @@ class MailController extends Controller | ||||
|     public function getMessageContent($message, $email) | ||||
|     { | ||||
|         $body = $message->getMessageBody(true); | ||||
|         if (!$body) { | ||||
|         if (! $body) { | ||||
|             $body = $message->getMessageBody(); | ||||
|         } | ||||
|         $body = $this->separateReply($body); | ||||
|         $subject = $message->getSubject(); | ||||
|         $address = $message->getAddresses('reply-to'); | ||||
|         if (!$address) { | ||||
|         if (! $address) { | ||||
|             $address = $message->getAddresses('from'); | ||||
|         } | ||||
|         $collaborators = $this->collaburators($message, $email); | ||||
|         $attachments = (!$message->getAttachments()) ? [] : $message->getAttachments(); | ||||
|         $attachments = (! $message->getAttachments()) ? [] : $message->getAttachments(); | ||||
|         //dd(['body' => $body, 'subject' => $subject, 'address' => $address, 'cc' => $collaborator, 'attachments' => $attachments]); | ||||
|         $this->workflow($address, $subject, $body, $collaborators, $attachments, $email); | ||||
|     } | ||||
| @@ -347,8 +342,7 @@ class MailController extends Controller | ||||
|     /** | ||||
|      * function to load data. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * | ||||
|      * @param  type  $id | ||||
|      * @return type file | ||||
|      */ | ||||
|     public function get_data($id) | ||||
| @@ -372,8 +366,7 @@ class MailController extends Controller | ||||
|     /** | ||||
|      * separate reply. | ||||
|      * | ||||
|      * @param type $body | ||||
|      * | ||||
|      * @param  type  $body | ||||
|      * @return type string | ||||
|      */ | ||||
|     public function separateReply($body) | ||||
|   | ||||
| @@ -71,7 +71,6 @@ class NotificationController extends Controller | ||||
|      *  Admin Notification/Report. | ||||
|      * | ||||
|      *  @param company | ||||
|      * | ||||
|      *  @return mail | ||||
|      * */ | ||||
|     public function send_notification_to_admin($company) | ||||
| @@ -86,13 +85,13 @@ class NotificationController extends Controller | ||||
|             $contents = $view->render(); | ||||
|             $from = $this->PhpMailController->mailfrom('1', '0'); | ||||
|             $to = [ | ||||
|                 'name'  => $user_name, | ||||
|                 'name' => $user_name, | ||||
|                 'email' => $email, | ||||
|             ]; | ||||
|             $message = [ | ||||
|                 'subject'  => 'Daily Report', | ||||
|                 'subject' => 'Daily Report', | ||||
|                 'scenario' => null, | ||||
|                 'body'     => $contents, | ||||
|                 'body' => $contents, | ||||
|             ]; | ||||
|  | ||||
|             return $this->PhpMailController->sendEmail($from, $to, $message); | ||||
| @@ -120,13 +119,13 @@ class NotificationController extends Controller | ||||
|                     $contents = $view->render(); | ||||
|                     $from = $this->PhpMailController->mailfrom('1', '0'); | ||||
|                     $to = [ | ||||
|                         'name'  => $user_name, | ||||
|                         'name' => $user_name, | ||||
|                         'email' => $email, | ||||
|                     ]; | ||||
|                     $message = [ | ||||
|                         'subject'  => 'Daily Report', | ||||
|                         'subject' => 'Daily Report', | ||||
|                         'scenario' => null, | ||||
|                         'body'     => $contents, | ||||
|                         'body' => $contents, | ||||
|                     ]; | ||||
|  | ||||
|                     return $this->PhpMailController->sendEmail($from, $to, $message); | ||||
| @@ -156,13 +155,13 @@ class NotificationController extends Controller | ||||
|                     $contents = $view->render(); | ||||
|                     $from = $this->PhpMailController->mailfrom('1', '0'); | ||||
|                     $to = [ | ||||
|                         'name'  => $user_name, | ||||
|                         'name' => $user_name, | ||||
|                         'email' => $email, | ||||
|                     ]; | ||||
|                     $message = [ | ||||
|                         'subject'  => 'Daily Report', | ||||
|                         'subject' => 'Daily Report', | ||||
|                         'scenario' => null, | ||||
|                         'body'     => $contents, | ||||
|                         'body' => $contents, | ||||
|                     ]; | ||||
|  | ||||
|                     return $this->PhpMailController->sendEmail($from, $to, $message); | ||||
| @@ -188,13 +187,13 @@ class NotificationController extends Controller | ||||
|             $contents = $view->render(); | ||||
|             $from = $this->PhpMailController->mailfrom('1', '0'); | ||||
|             $to = [ | ||||
|                 'name'  => $user_name, | ||||
|                 'name' => $user_name, | ||||
|                 'email' => $email, | ||||
|             ]; | ||||
|             $message = [ | ||||
|                 'subject'  => 'Daily Report', | ||||
|                 'subject' => 'Daily Report', | ||||
|                 'scenario' => null, | ||||
|                 'body'     => $contents, | ||||
|                 'body' => $contents, | ||||
|             ]; | ||||
|  | ||||
|             return $this->PhpMailController->sendEmail($from, $to, $message); | ||||
|   | ||||
| @@ -48,7 +48,6 @@ class OrganizationController extends Controller | ||||
|      * Display a listing of the resource. | ||||
|      * | ||||
|      * @param type Organization $org | ||||
|      * | ||||
|      * @return type Response | ||||
|      */ | ||||
|     public function index() | ||||
| @@ -143,7 +142,6 @@ class OrganizationController extends Controller | ||||
|      * | ||||
|      * @param type Organization        $org | ||||
|      * @param type OrganizationRequest $request | ||||
|      * | ||||
|      * @return type Redirect | ||||
|      */ | ||||
|     public function store(Organization $org, OrganizationRequest $request) | ||||
| @@ -167,9 +165,8 @@ class OrganizationController extends Controller | ||||
|     /** | ||||
|      * Display the specified organization. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * @param  type  $id | ||||
|      * @param type Organization $org | ||||
|      * | ||||
|      * @return type view | ||||
|      */ | ||||
|     public function show($id, Organization $org) | ||||
| @@ -187,9 +184,8 @@ class OrganizationController extends Controller | ||||
|     /** | ||||
|      * Show the form for editing the specified organization. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * @param  type  $id | ||||
|      * @param type Organization $org | ||||
|      * | ||||
|      * @return type view | ||||
|      */ | ||||
|     public function edit($id, Organization $org) | ||||
| @@ -207,10 +203,9 @@ class OrganizationController extends Controller | ||||
|     /** | ||||
|      * Update the specified organization in storage. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * @param  type  $id | ||||
|      * @param type Organization       $org | ||||
|      * @param type OrganizationUpdate $request | ||||
|      * | ||||
|      * @return type Redirect | ||||
|      */ | ||||
|     public function update($id, Organization $org, OrganizationUpdate $request) | ||||
| @@ -238,7 +233,6 @@ class OrganizationController extends Controller | ||||
|      * Delete a specified organization from storage. | ||||
|      * | ||||
|      * @param type int $id | ||||
|      * | ||||
|      * @return type Redirect | ||||
|      */ | ||||
|     public function destroy($id, Organization $org, User_org $user_org) | ||||
| @@ -264,8 +258,7 @@ class OrganizationController extends Controller | ||||
|     /** | ||||
|      * Soring an organization head. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * | ||||
|      * @param  type  $id | ||||
|      * @return type boolean | ||||
|      */ | ||||
|     public function Head_Org($id) | ||||
| @@ -284,10 +277,9 @@ class OrganizationController extends Controller | ||||
|     /** | ||||
|      * get the report of organizations. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * @param type $date111 | ||||
|      * @param type $date122 | ||||
|      * | ||||
|      * @param  type  $id | ||||
|      * @param  type  $date111 | ||||
|      * @param  type  $date122 | ||||
|      * @return type array | ||||
|      */ | ||||
|     public function orgChartData($id, $date111 = '', $date122 = '') | ||||
|   | ||||
| @@ -53,9 +53,9 @@ class ReportController extends Controller | ||||
|     /** | ||||
|      * function to get help_topic graph. | ||||
|      * | ||||
|      * @param type $date111 | ||||
|      * @param type $date122 | ||||
|      * @param type $helptopic | ||||
|      * @param  type  $date111 | ||||
|      * @param  type  $date122 | ||||
|      * @param  type  $helptopic | ||||
|      */ | ||||
|     public function chartdataHelptopic(Request $request, $date111 = '', $date122 = '', $helptopic = '') | ||||
|     { | ||||
|   | ||||
| @@ -93,7 +93,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) | ||||
| @@ -134,8 +133,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) { | ||||
| @@ -145,10 +144,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) { | ||||
| @@ -197,8 +196,7 @@ class TicketController extends Controller | ||||
|     /** | ||||
|      * Shows the ticket thread details. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * | ||||
|      * @param  type  $id | ||||
|      * @return type response | ||||
|      */ | ||||
|     public function thread($id) | ||||
| @@ -243,7 +241,7 @@ class TicketController extends Controller | ||||
|     { | ||||
|         $size = 0; | ||||
|         $files = Input::file('attachment'); | ||||
|         if (!$files) { | ||||
|         if (! $files) { | ||||
|             return $size; | ||||
|         } | ||||
|         if (count($files) > 0) { | ||||
| @@ -273,7 +271,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 = '') | ||||
| @@ -377,7 +374,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; | ||||
| @@ -392,10 +389,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('Reply-Ticket', [$data]); | ||||
|             } | ||||
|             // sending attachments via php mail function | ||||
| @@ -404,7 +401,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; | ||||
|             } | ||||
|  | ||||
| @@ -416,16 +413,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, | ||||
|                     ] | ||||
|                 ); | ||||
|             } | ||||
| @@ -442,9 +439,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) | ||||
| @@ -480,8 +476,7 @@ class TicketController extends Controller | ||||
|     /** | ||||
|      * Print Ticket Details. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * | ||||
|      * @param  type  $id | ||||
|      * @return type respponse | ||||
|      */ | ||||
|     public function ticket_print($id) | ||||
| @@ -510,8 +505,7 @@ class TicketController extends Controller | ||||
|     /** | ||||
|      * Generates Ticket Number. | ||||
|      * | ||||
|      * @param type $ticket_number | ||||
|      * | ||||
|      * @param  type  $ticket_number | ||||
|      * @return type integer | ||||
|      */ | ||||
|     public function ticketNumberold($ticket_number) | ||||
| @@ -583,8 +577,7 @@ class TicketController extends Controller | ||||
|     /** | ||||
|      * check email for dublicate entry. | ||||
|      * | ||||
|      * @param type $email | ||||
|      * | ||||
|      * @param  type  $email | ||||
|      * @return type bool | ||||
|      */ | ||||
|     public function checkEmail($email) | ||||
| @@ -600,8 +593,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) | ||||
| @@ -617,15 +609,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) | ||||
| @@ -633,7 +624,7 @@ class TicketController extends Controller | ||||
|         // define global variables | ||||
|  | ||||
|         $unique = $emailadd; | ||||
|         if (!$emailadd) { | ||||
|         if (! $emailadd) { | ||||
|             $unique = $mobile_number; | ||||
|         } | ||||
|         // check emails | ||||
| @@ -685,11 +676,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(new \App\Events\LoginEvent($value)); | ||||
|                 } | ||||
| @@ -742,9 +733,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, | ||||
|                                 ] | ||||
|                             ); | ||||
|                         } | ||||
| @@ -761,9 +752,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, | ||||
|                                 ] | ||||
|                             ); | ||||
|                         } | ||||
| @@ -824,32 +815,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('Create-Ticket', [$data]); | ||||
|             $data = [ | ||||
| @@ -901,13 +892,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) | ||||
| @@ -949,10 +939,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('change-status', [$data]); | ||||
|                 } | ||||
| @@ -977,13 +967,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) | ||||
| @@ -1053,7 +1042,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; | ||||
| @@ -1074,11 +1063,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) | ||||
| @@ -1099,8 +1087,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) | ||||
| @@ -1118,9 +1105,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) | ||||
| @@ -1169,10 +1155,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('change-status', [$data]); | ||||
|  | ||||
| @@ -1182,9 +1168,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) | ||||
| @@ -1215,10 +1200,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('change-status', [$data]); | ||||
|  | ||||
| @@ -1228,9 +1213,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) | ||||
| @@ -1255,10 +1239,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('change-status', [$data]); | ||||
|  | ||||
| @@ -1268,9 +1252,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) | ||||
| @@ -1287,10 +1270,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('change-status', [$data]); | ||||
|  | ||||
| @@ -1307,10 +1290,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('change-status', [$data]); | ||||
|  | ||||
| @@ -1321,9 +1304,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) | ||||
| @@ -1341,8 +1323,7 @@ class TicketController extends Controller | ||||
|     /** | ||||
|      * function to assign ticket. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * | ||||
|      * @param  type  $id | ||||
|      * @return type bool | ||||
|      */ | ||||
|     public function assign($id) | ||||
| @@ -1414,8 +1395,7 @@ class TicketController extends Controller | ||||
|     /** | ||||
|      * Function to post internal note. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * | ||||
|      * @param  type  $id | ||||
|      * @return type bool | ||||
|      */ | ||||
|     public function InternalNote($id) | ||||
| @@ -1432,8 +1412,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('Reply-Ticket', [$data]); | ||||
|  | ||||
| @@ -1443,8 +1423,7 @@ class TicketController extends Controller | ||||
|     /** | ||||
|      * Function to surrender a ticket. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * | ||||
|      * @param  type  $id | ||||
|      * @return type bool | ||||
|      */ | ||||
|     public function surrender($id) | ||||
| @@ -1470,8 +1449,7 @@ class TicketController extends Controller | ||||
|     /** | ||||
|      * Search. | ||||
|      * | ||||
|      * @param type $keyword | ||||
|      * | ||||
|      * @param  type  $keyword | ||||
|      * @return type array | ||||
|      */ | ||||
|     public function search($keyword) | ||||
| @@ -1488,8 +1466,7 @@ class TicketController extends Controller | ||||
|     /** | ||||
|      * Search. | ||||
|      * | ||||
|      * @param type $keyword | ||||
|      * | ||||
|      * @param  type  $keyword | ||||
|      * @return type array | ||||
|      */ | ||||
|     public function stores($ticket_number) | ||||
| @@ -1508,8 +1485,7 @@ class TicketController extends Controller | ||||
|     /** | ||||
|      * store_collaborators. | ||||
|      * | ||||
|      * @param type $headers | ||||
|      * | ||||
|      * @param  type  $headers | ||||
|      * @return type | ||||
|      */ | ||||
|     public function storeCollaborators($headers, $id) | ||||
| @@ -1591,8 +1567,7 @@ class TicketController extends Controller | ||||
|     /** | ||||
|      * cleanMe. | ||||
|      * | ||||
|      * @param type $input | ||||
|      * | ||||
|      * @param  type  $input | ||||
|      * @return type | ||||
|      */ | ||||
|     public function cleanMe($input) | ||||
| @@ -1609,7 +1584,6 @@ class TicketController extends Controller | ||||
|      * autosearch. | ||||
|      * | ||||
|      * @param type Image $image | ||||
|      * | ||||
|      * @return type json | ||||
|      */ | ||||
|     public function autosearch($id) | ||||
| @@ -1623,7 +1597,6 @@ class TicketController extends Controller | ||||
|      * autosearch2. | ||||
|      * | ||||
|      * @param type Image $image | ||||
|      * | ||||
|      * @return type json | ||||
|      */ | ||||
|     public function autosearch2(User $user) | ||||
| @@ -1636,7 +1609,6 @@ class TicketController extends Controller | ||||
|      * autosearch. | ||||
|      * | ||||
|      * @param type Image $image | ||||
|      * | ||||
|      * @return type json | ||||
|      */ | ||||
|     public function usersearch() | ||||
| @@ -1653,7 +1625,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; | ||||
| @@ -1671,7 +1643,6 @@ class TicketController extends Controller | ||||
|      * useradd. | ||||
|      * | ||||
|      * @param type Image $image | ||||
|      * | ||||
|      * @return type json | ||||
|      */ | ||||
|     public function useradd() | ||||
| @@ -1807,8 +1778,7 @@ class TicketController extends Controller | ||||
|     /** | ||||
|      * user time zone. | ||||
|      * | ||||
|      * @param type $utc | ||||
|      * | ||||
|      * @param  type  $utc | ||||
|      * @return type date | ||||
|      */ | ||||
|     public static function usertimezone($utc) | ||||
| @@ -1856,8 +1826,7 @@ class TicketController extends Controller | ||||
|     /** | ||||
|      * lock. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * | ||||
|      * @param  type  $id | ||||
|      * @return type null | ||||
|      */ | ||||
|     public function lock($id) | ||||
| @@ -1999,8 +1968,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) | ||||
| @@ -2051,8 +2019,7 @@ class TicketController extends Controller | ||||
|     /** | ||||
|      * function to Change owner. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * | ||||
|      * @param  type  $id | ||||
|      * @return type bool | ||||
|      */ | ||||
|     public function changeOwner($id) | ||||
| @@ -2117,7 +2084,6 @@ class TicketController extends Controller | ||||
|      * useradd. | ||||
|      * | ||||
|      * @param type Image $image | ||||
|      * | ||||
|      * @return type json | ||||
|      */ | ||||
|     public function changeOwnerAdd($email, $name, $ticket_id) | ||||
| @@ -2126,9 +2092,9 @@ class TicketController extends Controller | ||||
|         $email = $email; | ||||
|         $ticket_id = $ticket_id; | ||||
|         $validator = \Validator::make( | ||||
|             ['email'   => $email, | ||||
|             ['email' => $email, | ||||
|                 'name' => $name, ], | ||||
|             ['email'   => 'required|email', | ||||
|             ['email' => 'required|email', | ||||
|             ] | ||||
|         ); | ||||
|         $user = User::where('email', '=', $email)->first(); | ||||
| @@ -2250,12 +2216,12 @@ class TicketController extends Controller | ||||
|                     ->update(['status' => 3]); | ||||
|             //event has $p_id and $value | ||||
|             event('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')]); | ||||
|             } | ||||
| @@ -2305,7 +2271,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) | ||||
| @@ -2393,7 +2358,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() | ||||
| @@ -2427,7 +2391,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(); | ||||
| @@ -2649,7 +2613,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) | ||||
| @@ -2710,8 +2673,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) | ||||
|   | ||||
| @@ -180,10 +180,9 @@ class TicketWorkflowController extends Controller | ||||
|     /** | ||||
|      * function to check the rules applied to the ticket workflow. | ||||
|      * | ||||
|      * @param type $to_check | ||||
|      * @param type $condition | ||||
|      * @param type $statement | ||||
|      * | ||||
|      * @param  type  $to_check | ||||
|      * @param  type  $condition | ||||
|      * @param  type  $statement | ||||
|      * @return type boolean | ||||
|      */ | ||||
|     public function checkRuleCondition($to_check, $condition, $statement) | ||||
| @@ -212,9 +211,8 @@ class TicketWorkflowController extends Controller | ||||
|     /** | ||||
|      * function to check if the equal functions are applied. | ||||
|      * | ||||
|      * @param type $statement | ||||
|      * @param type $to_check | ||||
|      * | ||||
|      * @param  type  $statement | ||||
|      * @param  type  $to_check | ||||
|      * @return bool | ||||
|      */ | ||||
|     public function checkEqual($statement, $to_check) | ||||
| @@ -229,9 +227,8 @@ class TicketWorkflowController extends Controller | ||||
|     /** | ||||
|      * function to check if the not-equal functions are applied. | ||||
|      * | ||||
|      * @param type $statement | ||||
|      * @param type $to_check | ||||
|      * | ||||
|      * @param  type  $statement | ||||
|      * @param  type  $to_check | ||||
|      * @return bool | ||||
|      */ | ||||
|     public function checkNotEqual($statement, $to_check) | ||||
| @@ -246,9 +243,8 @@ class TicketWorkflowController extends Controller | ||||
|     /** | ||||
|      * function to check if the contains functions are applied. | ||||
|      * | ||||
|      * @param type $statement | ||||
|      * @param type $to_check | ||||
|      * | ||||
|      * @param  type  $statement | ||||
|      * @param  type  $to_check | ||||
|      * @return bool | ||||
|      */ | ||||
|     public function checkContains($statement, $to_check) | ||||
| @@ -263,9 +259,8 @@ class TicketWorkflowController extends Controller | ||||
|     /** | ||||
|      * function to check if the do not contain functions are applied. | ||||
|      * | ||||
|      * @param type $statement | ||||
|      * @param type $to_check | ||||
|      * | ||||
|      * @param  type  $statement | ||||
|      * @param  type  $to_check | ||||
|      * @return bool | ||||
|      */ | ||||
|     public function checkDoNotContain($statement, $to_check) | ||||
| @@ -280,9 +275,8 @@ class TicketWorkflowController extends Controller | ||||
|     /** | ||||
|      * function to check if the start functions are applied. | ||||
|      * | ||||
|      * @param type $statement | ||||
|      * @param type $to_check | ||||
|      * | ||||
|      * @param  type  $statement | ||||
|      * @param  type  $to_check | ||||
|      * @return bool | ||||
|      */ | ||||
|     public function checkStarts($statement, $to_check) | ||||
| @@ -297,9 +291,8 @@ class TicketWorkflowController extends Controller | ||||
|     /** | ||||
|      * function to check if the ends functions are applied. | ||||
|      * | ||||
|      * @param type $statement | ||||
|      * @param type $to_check | ||||
|      * | ||||
|      * @param  type  $statement | ||||
|      * @param  type  $to_check | ||||
|      * @return bool | ||||
|      */ | ||||
|     public function checkEnds($statement, $to_check) | ||||
| @@ -325,9 +318,8 @@ class TicketWorkflowController extends Controller | ||||
|     /** | ||||
|      * function to apply the action to a ticket. | ||||
|      * | ||||
|      * @param type $workflow_id | ||||
|      * @param type $ticket_settings_details | ||||
|      * | ||||
|      * @param  type  $workflow_id | ||||
|      * @param  type  $ticket_settings_details | ||||
|      * @return type array | ||||
|      */ | ||||
|     public function applyActionCondition($workflow_id, $ticket_settings_details) | ||||
| @@ -359,8 +351,7 @@ class TicketWorkflowController extends Controller | ||||
|     /** | ||||
|      * function to reject ticket. | ||||
|      * | ||||
|      * @param array $ticket_settings_details | ||||
|      * | ||||
|      * @param  array  $ticket_settings_details | ||||
|      * @return type array | ||||
|      */ | ||||
|     public function rejectTicket($ticket_settings_details) | ||||
| @@ -373,9 +364,8 @@ class TicketWorkflowController extends Controller | ||||
|     /** | ||||
|      * function to change the department of a ticket. | ||||
|      * | ||||
|      * @param type $workflow_action | ||||
|      * @param type $ticket_settings_details | ||||
|      * | ||||
|      * @param  type  $workflow_action | ||||
|      * @param  type  $ticket_settings_details | ||||
|      * @return type array | ||||
|      */ | ||||
|     public function changeDepartment($workflow_action, $ticket_settings_details) | ||||
| @@ -393,9 +383,8 @@ class TicketWorkflowController extends Controller | ||||
|     /** | ||||
|      * function to change the priority of a ticket. | ||||
|      * | ||||
|      * @param type $workflow_action | ||||
|      * @param type $ticket_settings_details | ||||
|      * | ||||
|      * @param  type  $workflow_action | ||||
|      * @param  type  $ticket_settings_details | ||||
|      * @return type array | ||||
|      */ | ||||
|     public function changePriority($workflow_action, $ticket_settings_details) | ||||
| @@ -413,9 +402,8 @@ class TicketWorkflowController extends Controller | ||||
|     /** | ||||
|      * function to change the SLA of a ticket. | ||||
|      * | ||||
|      * @param type $workflow_action | ||||
|      * @param type $ticket_settings_details | ||||
|      * | ||||
|      * @param  type  $workflow_action | ||||
|      * @param  type  $ticket_settings_details | ||||
|      * @return type array | ||||
|      */ | ||||
|     public function changeSla($workflow_action, $ticket_settings_details) | ||||
| @@ -433,9 +421,8 @@ class TicketWorkflowController extends Controller | ||||
|     /** | ||||
|      * function to assign tean to a ticket. | ||||
|      * | ||||
|      * @param type $workflow_action | ||||
|      * @param type $ticket_settings_details | ||||
|      * | ||||
|      * @param  type  $workflow_action | ||||
|      * @param  type  $ticket_settings_details | ||||
|      * @return type array | ||||
|      */ | ||||
|     public function changeTeam($workflow_action, $ticket_settings_details) | ||||
| @@ -453,9 +440,8 @@ class TicketWorkflowController extends Controller | ||||
|     /** | ||||
|      * function to assing a ticket to an agent. | ||||
|      * | ||||
|      * @param type $workflow_action | ||||
|      * @param type $ticket_settings_details | ||||
|      * | ||||
|      * @param  type  $workflow_action | ||||
|      * @param  type  $ticket_settings_details | ||||
|      * @return type array | ||||
|      */ | ||||
|     public function changeAgent($workflow_action, $ticket_settings_details) | ||||
| @@ -473,9 +459,8 @@ class TicketWorkflowController extends Controller | ||||
|     /** | ||||
|      * function to change the helptopic of a ticket. | ||||
|      * | ||||
|      * @param type $workflow_action | ||||
|      * @param type $ticket_settings_details | ||||
|      * | ||||
|      * @param  type  $workflow_action | ||||
|      * @param  type  $ticket_settings_details | ||||
|      * @return type array | ||||
|      */ | ||||
|     public function changeHelptopic($workflow_action, $ticket_settings_details) | ||||
| @@ -493,9 +478,8 @@ class TicketWorkflowController extends Controller | ||||
|     /** | ||||
|      * function to change the status of a ticket. | ||||
|      * | ||||
|      * @param type $workflow_action | ||||
|      * @param type $ticket_settings_details | ||||
|      * | ||||
|      * @param  type  $workflow_action | ||||
|      * @param  type  $ticket_settings_details | ||||
|      * @return type array | ||||
|      */ | ||||
|     public function changeStatus($workflow_action, $ticket_settings_details) | ||||
|   | ||||
| @@ -73,7 +73,6 @@ class UserController extends Controller | ||||
|      * Display all list of the users. | ||||
|      * | ||||
|      * @param type User $user | ||||
|      * | ||||
|      * @return type view | ||||
|      */ | ||||
|     public function index() | ||||
| @@ -272,7 +271,6 @@ class UserController extends Controller | ||||
|      * | ||||
|      * @param type User            $user | ||||
|      * @param type Sys_userRequest $request | ||||
|      * | ||||
|      * @return type redirect | ||||
|      */ | ||||
|     public function store(User $user, Sys_userRequest $request) | ||||
| @@ -306,7 +304,7 @@ class UserController extends Controller | ||||
|                 return redirect()->back()->with(['fails' => Lang::get('lang.country-code-required-error'), 'country_code_error' => 1])->withInput(); | ||||
|             } else { | ||||
|                 $code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get(); | ||||
|                 if (!count($code)) { | ||||
|                 if (! count($code)) { | ||||
|                     return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput(); | ||||
|                 } | ||||
|             } | ||||
| @@ -351,7 +349,6 @@ class UserController extends Controller | ||||
|      * | ||||
|      * @param type int  $id | ||||
|      * @param type User $user | ||||
|      * | ||||
|      * @return type view | ||||
|      */ | ||||
|     public function randomPassword() | ||||
| @@ -377,7 +374,6 @@ class UserController extends Controller | ||||
|      * | ||||
|      * @param type int  $id | ||||
|      * @param type User $user | ||||
|      * | ||||
|      * @return type view | ||||
|      */ | ||||
|     public function randomPostPassword($id, ChangepasswordRequest $request) | ||||
| @@ -401,9 +397,8 @@ class UserController extends Controller | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param type    $id | ||||
|      * @param Request $request | ||||
|      * | ||||
|      * @param  type  $id | ||||
|      * @param  Request  $request | ||||
|      * @return type | ||||
|      */ | ||||
|     public function changeRoleAdmin($id, Request $request) | ||||
| @@ -423,9 +418,8 @@ class UserController extends Controller | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param type    $id | ||||
|      * @param Request $request | ||||
|      * | ||||
|      * @param  type  $id | ||||
|      * @param  Request  $request | ||||
|      * @return type | ||||
|      */ | ||||
|     public function changeRoleAgent($id, Request $request) | ||||
| @@ -445,8 +439,7 @@ class UserController extends Controller | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param type $id | ||||
|      * | ||||
|      * @param  type  $id | ||||
|      * @return type | ||||
|      */ | ||||
|     public function changeRoleUser($id) | ||||
| @@ -472,8 +465,7 @@ class UserController extends Controller | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * @param type $id | ||||
|      * | ||||
|      * @param  type  $id | ||||
|      * @return type | ||||
|      */ | ||||
|     public function deleteAgent($id) | ||||
| @@ -609,7 +601,6 @@ class UserController extends Controller | ||||
|      * | ||||
|      * @param type int  $id | ||||
|      * @param type User $user | ||||
|      * | ||||
|      * @return type view | ||||
|      */ | ||||
|     public function show($id) | ||||
| @@ -633,7 +624,6 @@ class UserController extends Controller | ||||
|      * | ||||
|      * @param type int  $id | ||||
|      * @param type User $user | ||||
|      * | ||||
|      * @return type Response | ||||
|      */ | ||||
|     public function edit($id, CountryCode $code) | ||||
| @@ -668,7 +658,6 @@ class UserController extends Controller | ||||
|      * @param type int            $id | ||||
|      * @param type User           $user | ||||
|      * @param type Sys_userUpdate $request | ||||
|      * | ||||
|      * @return type Response | ||||
|      */ | ||||
|     public function update($id, Sys_userUpdate $request) | ||||
| @@ -683,7 +672,7 @@ class UserController extends Controller | ||||
|                 return redirect()->back()->with(['fails' => Lang::get('lang.country-code-required-error'), 'country_code_error' => 1])->withInput(); | ||||
|             } else { | ||||
|                 $code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get(); | ||||
|                 if (!count($code)) { | ||||
|                 if (! count($code)) { | ||||
|                     return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput(); | ||||
|                 } else { | ||||
|                     $users->country_code = $request->country_code; | ||||
| @@ -737,7 +726,7 @@ class UserController extends Controller | ||||
|         try { | ||||
|             return view('themes.default1.agent.helpdesk.user.profile-edit', compact('user')) | ||||
|                             ->with(['phonecode' => $phonecode->phonecode, | ||||
|                                 'verify'        => $status, ]); | ||||
|                                 'verify' => $status, ]); | ||||
|         } catch (Exception $e) { | ||||
|             return redirect()->back()->with('fails', $e->getMessage()); | ||||
|         } | ||||
| @@ -748,7 +737,6 @@ class UserController extends Controller | ||||
|      * | ||||
|      * @param type int            $id | ||||
|      * @param type ProfileRequest $request | ||||
|      * | ||||
|      * @return type Redirect | ||||
|      */ | ||||
|     public function postProfileedit(ProfileRequest $request) | ||||
| @@ -760,7 +748,7 @@ class UserController extends Controller | ||||
|                 return redirect()->back()->with(['fails' => Lang::get('lang.country-code-required-error'), 'country_code_error' => 1])->withInput(); | ||||
|             } else { | ||||
|                 $code = CountryCode::select('phonecode')->where('phonecode', '=', $request->get('country_code'))->get(); | ||||
|                 if (!count($code)) { | ||||
|                 if (! count($code)) { | ||||
|                     return redirect()->back()->with(['fails' => Lang::get('lang.incorrect-country-code-error'), 'country_code_error' => 1])->withInput(); | ||||
|                 } | ||||
|                 $user->country_code = $request->country_code; | ||||
| @@ -802,7 +790,6 @@ class UserController extends Controller | ||||
|      * | ||||
|      * @param type int             $id | ||||
|      * @param type ProfilePassword $request | ||||
|      * | ||||
|      * @return type Redirect | ||||
|      */ | ||||
|     public function postProfilePassword($id, ProfilePassword $request) | ||||
| @@ -828,8 +815,7 @@ class UserController extends Controller | ||||
|     /** | ||||
|      * Assigning an user to an organization. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * | ||||
|      * @param  type  $id | ||||
|      * @return type boolean | ||||
|      */ | ||||
|     public function UserAssignOrg($id) | ||||
| @@ -896,8 +882,7 @@ class UserController extends Controller | ||||
|     /** | ||||
|      * creating an organization in user profile page via modal popup. | ||||
|      * | ||||
|      * @param type $id | ||||
|      * | ||||
|      * @param  type  $id | ||||
|      * @return type | ||||
|      */ | ||||
|     public function User_Create_Org($id) | ||||
| @@ -940,8 +925,7 @@ class UserController extends Controller | ||||
|     /** | ||||
|      * Generate a random string for password. | ||||
|      * | ||||
|      * @param type $length | ||||
|      * | ||||
|      * @param  type  $length | ||||
|      * @return string | ||||
|      */ | ||||
|     public function generateRandomString($length = 10) | ||||
| @@ -969,7 +953,7 @@ class UserController extends Controller | ||||
|         } | ||||
|         $org_relations->create([ | ||||
|             'user_id' => $userid, | ||||
|             'org_id'  => $orgid, | ||||
|             'org_id' => $orgid, | ||||
|         ]); | ||||
|     } | ||||
|  | ||||
| @@ -1045,7 +1029,7 @@ class UserController extends Controller | ||||
|                 ->first(); | ||||
|         if ($otp != null) { | ||||
|             $otp_length = strlen(Input::get('otp')); | ||||
|             if (($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp')))) { | ||||
|             if (($otp_length == 6 && ! preg_match('/[a-z]/i', Input::get('otp')))) { | ||||
|                 $otp2 = Hash::make(Input::get('otp')); | ||||
|                 $date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa'); | ||||
|                 $date2 = date('Y-m-d h:i:sa'); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Shift
					Shift