From 7b8ee415befa570801a0513bdcea2d542d1d61f4 Mon Sep 17 00:00:00 2001 From: Manish Verma Date: Tue, 23 May 2017 10:18:08 +0000 Subject: [PATCH 01/46] Apply fixes from StyleCI --- .../Controllers/StorageController.php | 111 +++++++++++------- .../Agent/helpdesk/TicketController.php | 26 ++-- .../Agent/helpdesk/UserController.php | 2 +- .../Client/helpdesk/FormController.php | 1 + .../Client/helpdesk/GuestController.php | 2 +- app/Http/Middleware/VerifyCsrfToken.php | 8 +- .../helpdesk/Ticket/Ticket_attachments.php | 2 +- app/User.php | 7 +- 8 files changed, 91 insertions(+), 68 deletions(-) diff --git a/app/FaveoStorage/Controllers/StorageController.php b/app/FaveoStorage/Controllers/StorageController.php index 7cd9d064e..8a9e46e31 100644 --- a/app/FaveoStorage/Controllers/StorageController.php +++ b/app/FaveoStorage/Controllers/StorageController.php @@ -9,8 +9,8 @@ use App\Model\helpdesk\Ticket\Ticket_Thread; use Config; use Storage; -class StorageController extends Controller { - +class StorageController extends Controller +{ protected $default; protected $driver; protected $root; @@ -25,7 +25,8 @@ class StorageController extends Controller { protected $rackspace_endpoint; protected $rackspace_url_type; - public function __construct() { + public function __construct() + { $this->default = $this->defaults(); $this->driver = $this->driver(); $this->root = $this->root(); @@ -40,7 +41,8 @@ class StorageController extends Controller { $this->rackspace_username = $this->rackspaceUsername(); } - protected function settings($option) { + protected function settings($option) + { $settings = new CommonSettings(); $setting = $settings->getOptionValue('storage', $option); $value = ''; @@ -51,7 +53,8 @@ class StorageController extends Controller { return $value; } - public function defaults() { + public function defaults() + { $default = 'local'; if ($this->settings('default')) { $default = $this->settings('default'); @@ -60,11 +63,13 @@ class StorageController extends Controller { return $default; } - public function driver() { + public function driver() + { return $this->settings('default'); } - public function root() { + public function root() + { $root = storage_path('app'); if ($this->settings('root')) { $root = $this->settings('root'); @@ -73,47 +78,58 @@ class StorageController extends Controller { return $root; } - public function s3Key() { + public function s3Key() + { return $this->settings('s3_key'); } - public function s3Region() { + public function s3Region() + { return $this->settings('s3_region'); } - public function s3Secret() { + public function s3Secret() + { return $this->settings('s3_secret'); } - public function s3Bucket() { + public function s3Bucket() + { return $this->settings('s3_bucket'); } - public function rackspaceKey() { + public function rackspaceKey() + { return $this->settings('root'); } - public function rackspaceRegion() { + public function rackspaceRegion() + { return $this->settings('rackspace_region'); } - public function rackspaceUsername() { + public function rackspaceUsername() + { return $this->settings('rackspace_username'); } - public function rackspaceContainer() { + public function rackspaceContainer() + { return $this->settings('rackspace_container'); } - public function rackspaceEndpoint() { + public function rackspaceEndpoint() + { return $this->settings('rackspace_endpoint'); } - public function rackspaceUrlType() { + public function rackspaceUrlType() + { return $this->settings('rackspace_url_type'); } - protected function setFileSystem() { + protected function setFileSystem() + { $config = $this->config(); //dd($config); foreach ($config as $key => $con) { @@ -128,40 +144,43 @@ class StorageController extends Controller { return Config::get('filesystem'); } - protected function config() { + protected function config() + { return [ 'default' => $this->default, - 'cloud' => 's3', - 'disks' => $this->disks(), + 'cloud' => 's3', + 'disks' => $this->disks(), ]; } - protected function disks() { + protected function disks() + { return [ 'local' => [ 'driver' => 'local', - 'root' => $this->root . '/attachments', + 'root' => $this->root.'/attachments', ], 's3' => [ 'driver' => 's3', - 'key' => $this->s3_key, + 'key' => $this->s3_key, 'secret' => $this->s3_secret, 'region' => $this->s3_region, 'bucket' => $this->s3_bucket, ], 'rackspace' => [ - 'driver' => 'rackspace', - 'username' => $this->rackspace_username, - 'key' => $this->rackspace_key, + 'driver' => 'rackspace', + 'username' => $this->rackspace_username, + 'key' => $this->rackspace_key, 'container' => $this->rackspace_container, - 'endpoint' => $this->rackspace_endpoint, - 'region' => $this->rackspace_region, - 'url_type' => $this->rackspace_url_type, + 'endpoint' => $this->rackspace_endpoint, + 'region' => $this->rackspace_region, + 'url_type' => $this->rackspace_url_type, ], ]; } - public function upload($data, $filename, $type, $size, $disposition, $thread_id) { + public function upload($data, $filename, $type, $size, $disposition, $thread_id) + { $upload = new Ticket_attachments(); $upload->thread_id = $thread_id; $upload->name = $filename; @@ -169,11 +188,11 @@ class StorageController extends Controller { $upload->size = $size; $upload->poster = $disposition; $upload->driver = $this->default; - $upload->path = $this->root. DIRECTORY_SEPARATOR.'attachments'; + $upload->path = $this->root.DIRECTORY_SEPARATOR.'attachments'; if ($this->default !== 'database') { $this->setFileSystem(); Storage::disk($this->default)->put($filename, $data); - $storagePath = Storage::disk($this->default)->getDriver()->getAdapter()->getPathPrefix() . $filename; + $storagePath = Storage::disk($this->default)->getDriver()->getAdapter()->getPathPrefix().$filename; if (mime(\File::mimeType($storagePath)) != 'image' || mime(\File::extension($storagePath)) != 'image') { chmod($storagePath, 1204); } @@ -185,23 +204,23 @@ class StorageController extends Controller { } } - public function saveAttachments($thread_id, $attachments = []) { + public function saveAttachments($thread_id, $attachments = []) + { $disposition = 'ATTACHMENT'; $thread = ''; foreach ($attachments as $attachment) { if (is_object($attachment)) { if (method_exists($attachment, 'getStructure')) { - $structure = $attachment->getStructure(); if (isset($structure->disposition)) { $disposition = $structure->disposition; } - $filename = rand(1111, 9999) . "_" . $attachment->getFileName(); + $filename = rand(1111, 9999).'_'.$attachment->getFileName(); $type = $attachment->getMimeType(); $size = $attachment->getSize(); $data = $attachment->getData(); } else { - $filename = rand(1111, 9999) . "_" . $attachment->getClientOriginalName(); + $filename = rand(1111, 9999).'_'.$attachment->getClientOriginalName(); $type = $attachment->getMimeType(); $size = $attachment->getSize(); $data = file_get_contents($attachment->getRealPath()); @@ -210,10 +229,12 @@ class StorageController extends Controller { $thread = $this->updateBody($attachment, $thread_id, $filename); } } + return $thread; } - public function updateBody($attachment, $thread_id, $filename) { + public function updateBody($attachment, $thread_id, $filename) + { $threads = new Ticket_Thread(); $thread = $threads->find($thread_id); $disposition = 'ATTACHMENT'; @@ -225,27 +246,29 @@ class StorageController extends Controller { } } } - + if ($disposition == 'INLINE' || $disposition == 'inline') { $id = str_replace('>', '', str_replace('<', '', $structure->id)); $body = $thread->body; // dd($id,$filename,$body); - $body = str_replace('cid:' . $id, $filename, $body); + $body = str_replace('cid:'.$id, $filename, $body); // dd($body); $thread->body = $body; $thread->save(); } + return $thread; } - public function getFile($drive, $name, $root) { - if ($drive != "database") { - $root = $root . DIRECTORY_SEPARATOR . $name; + public function getFile($drive, $name, $root) + { + if ($drive != 'database') { + $root = $root.DIRECTORY_SEPARATOR.$name; if (\File::exists($root)) { chmod($root, 0755); + return \File::get($root); } } } - } diff --git a/app/Http/Controllers/Agent/helpdesk/TicketController.php b/app/Http/Controllers/Agent/helpdesk/TicketController.php index 752f63a1c..82245c848 100644 --- a/app/Http/Controllers/Agent/helpdesk/TicketController.php +++ b/app/Http/Controllers/Agent/helpdesk/TicketController.php @@ -37,10 +37,11 @@ use App\Model\helpdesk\Utility\Date_time_format; use App\Model\helpdesk\Utility\Timezones; use App\User; use Auth; +use Crypt; use DB; use Exception; -use GeoIP; // classes +use GeoIP; use Hash; use Illuminate\Http\Request; use Illuminate\support\Collection; @@ -49,7 +50,6 @@ use Lang; use Mail; use PDF; use UTC; -use Crypt; /** * TicketController. @@ -541,9 +541,9 @@ class TicketController extends Controller ], $template_variables = [ 'ticket_number' => $ticket_number, - 'user' => $username, - 'agent_sign' => $agentsign, - 'system_link'=>$link + 'user' => $username, + 'agent_sign' => $agentsign, + 'system_link' => $link, ] ); } @@ -850,11 +850,11 @@ class TicketController extends Controller if ($auto_response == 0) { $encoded_ticketid = Crypt::encrypt($ticketdata->id); $link = url('check_ticket/'.$encoded_ticketid); - $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['name' => $username, 'email' => $emailadd], $message = ['subject' => $updated_subject, 'scenario' => 'create-ticket-by-agent', 'body' => $body], + $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $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, ]); } } catch (\Exception $e) { @@ -864,11 +864,11 @@ class TicketController extends Controller $body2 = null; try { if ($auto_response == 0) { - $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['name' => $username, 'email' => $emailadd], $message = ['subject' => $updated_subject, 'scenario' => 'create-ticket'], - $template_variables = ['user' => $username, - 'ticket_number' => $ticket_number2, - 'department_sign' => '', - 'system_link'=>$link, + $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $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, ]); } } catch (\Exception $e) { diff --git a/app/Http/Controllers/Agent/helpdesk/UserController.php b/app/Http/Controllers/Agent/helpdesk/UserController.php index b6fb024c6..aeefbd717 100644 --- a/app/Http/Controllers/Agent/helpdesk/UserController.php +++ b/app/Http/Controllers/Agent/helpdesk/UserController.php @@ -769,7 +769,7 @@ class UserController extends Controller // fetching upload destination path $destinationPath = 'uploads/profilepic'; // adding a random value to profile picture filename - $fileName = rand(0000, 9999).'.'.str_replace(" ", "_", $name); + $fileName = rand(0000, 9999).'.'.str_replace(' ', '_', $name); // moving the picture to a destination folder Input::file('profile_pic')->move($destinationPath, $fileName); // saving filename to database diff --git a/app/Http/Controllers/Client/helpdesk/FormController.php b/app/Http/Controllers/Client/helpdesk/FormController.php index 15afebc94..fa15bf34e 100644 --- a/app/Http/Controllers/Client/helpdesk/FormController.php +++ b/app/Http/Controllers/Client/helpdesk/FormController.php @@ -249,6 +249,7 @@ class FormController extends Controller } } catch (\Exception $ex) { dd($ex); + return redirect()->back()->with('fails', $ex->getMessage()); } // dd($result); diff --git a/app/Http/Controllers/Client/helpdesk/GuestController.php b/app/Http/Controllers/Client/helpdesk/GuestController.php index d1a0afd74..ae50f1c92 100644 --- a/app/Http/Controllers/Client/helpdesk/GuestController.php +++ b/app/Http/Controllers/Client/helpdesk/GuestController.php @@ -101,7 +101,7 @@ class GuestController extends Controller // fetching upload destination path $destinationPath = 'uploads/profilepic'; // adding a random value to profile picture filename - $fileName = rand(0000, 9999).'.'.str_replace(" ", "_", $name); + $fileName = rand(0000, 9999).'.'.str_replace(' ', '_', $name); // moving the picture to a destination folder Input::file('profile_pic')->move($destinationPath, $fileName); // saving filename to database diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index e4bcc1e65..a67e252cf 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -4,21 +4,19 @@ namespace App\Http\Middleware; use Closure; use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier; -use Lang; class VerifyCsrfToken extends BaseVerifier { - - /** + /** * The URIs that should be excluded from CSRF verification. * * @var array */ protected $except = [ 'CheckSerial', - 'api/v1/*' + 'api/v1/*', ]; - + /** * Handle an incoming request. * diff --git a/app/Model/helpdesk/Ticket/Ticket_attachments.php b/app/Model/helpdesk/Ticket/Ticket_attachments.php index 163e864c7..0f6146270 100644 --- a/app/Model/helpdesk/Ticket/Ticket_attachments.php +++ b/app/Model/helpdesk/Ticket/Ticket_attachments.php @@ -35,7 +35,7 @@ class Ticket_attachments extends Model if ($content) { $value = base64_encode($content); if (mime($this->type) != 'image') { - $root = $root . "/" . $name; + $root = $root.'/'.$name; chmod($root, 1204); } } diff --git a/app/User.php b/app/User.php index 1ce1abfa8..afcecb28b 100644 --- a/app/User.php +++ b/app/User.php @@ -45,17 +45,18 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon $pic = $this->checkArray('avatar', $info); } if (!$pic && $value) { - $pic = ""; - $file = asset('uploads/profilepic/' . $value); + $pic = ''; + $file = asset('uploads/profilepic/'.$value); if ($file) { $type = pathinfo($file, PATHINFO_EXTENSION); $data = file_get_contents($file); - $pic = 'data:image/' . $type . ';base64,' . base64_encode($data); + $pic = 'data:image/'.$type.';base64,'.base64_encode($data); } } if (!$value) { $pic = \Gravatar::src($this->attributes['email']); } + return $pic; } From bfb466dd5c8d48c719c7b222ad30e58d3a31f7a2 Mon Sep 17 00:00:00 2001 From: Manish Verma Date: Fri, 26 May 2017 10:51:35 +0530 Subject: [PATCH 02/46] updates Added imap extension check in installer --- .../views/themes/default1/installer/helpdesk/view2.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/themes/default1/installer/helpdesk/view2.blade.php b/resources/views/themes/default1/installer/helpdesk/view2.blade.php index 4d4ec1f51..ea0a4b09f 100644 --- a/resources/views/themes/default1/installer/helpdesk/view2.blade.php +++ b/resources/views/themes/default1/installer/helpdesk/view2.blade.php @@ -178,7 +178,7 @@ function validate_zend_compatibility_mode(&$results) { function validate_extensions(&$results) { $ok = true; - $required_extensions = array('mcrypt', 'openssl', 'pdo', 'fileinfo', 'curl', 'zip', 'mbstring'); + $required_extensions = array('mcrypt', 'openssl', 'pdo', 'fileinfo', 'curl', 'zip', 'mbstring', 'imap'); foreach ($required_extensions as $required_extension) { if (extension_loaded($required_extension)) { From 3f1a0eb475d776490985c63772ca1862dbbd9a2c Mon Sep 17 00:00:00 2001 From: Manish Verma Date: Fri, 26 May 2017 10:56:47 +0530 Subject: [PATCH 03/46] updates --- .../views/themes/default1/installer/helpdesk/view2.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/themes/default1/installer/helpdesk/view2.blade.php b/resources/views/themes/default1/installer/helpdesk/view2.blade.php index ea0a4b09f..7f5f87a26 100644 --- a/resources/views/themes/default1/installer/helpdesk/view2.blade.php +++ b/resources/views/themes/default1/installer/helpdesk/view2.blade.php @@ -178,7 +178,7 @@ function validate_zend_compatibility_mode(&$results) { function validate_extensions(&$results) { $ok = true; - $required_extensions = array('mcrypt', 'openssl', 'pdo', 'fileinfo', 'curl', 'zip', 'mbstring', 'imap'); + $required_extensions = array('mcrypt', 'openssl', 'pdo', 'fileinfo', 'curl', 'zip', 'mbstring'); foreach ($required_extensions as $required_extension) { if (extension_loaded($required_extension)) { @@ -202,7 +202,7 @@ function validate_extensions(&$results) { } // if $recommended_extensions = array( - + 'imap' => 'IMAP extension is used for connecting to mail server using IMAP settings to fetch emails in the system.' // 'gd' => 'GD is used for image manipulation. Without it, system is not able to create thumbnails for files or manage avatars, logos and project icons. Please refer to this page for installation instructions', // 'mbstring' => 'MultiByte String is used for work with Unicode. Without it, system may not split words and string properly and you can have weird question mark characters in Recent Activities for example. Please refer to this page for installation instructions', // 'curl' => 'cURL is used to support various network tasks. Please refer to this page for installation instructions', From 3968c55ad941fe47667ed191028b735a873594ba Mon Sep 17 00:00:00 2001 From: Manish Verma Date: Mon, 29 May 2017 16:34:54 +0530 Subject: [PATCH 04/46] Update Readme Updated API Document's link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3e8507a55..366ce887b 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Flavors of Faveo Faveo Documentation -------------------------- * Faveo user Manual - * Faveo API Documentation + * Faveo API Documentation * Faveo Event List * Faveo Plugin creation guide From ee200fc18bab568ce364b21468802111785d9f28 Mon Sep 17 00:00:00 2001 From: Vijay Sebastian Date: Wed, 5 Jul 2017 17:25:34 +0530 Subject: [PATCH 05/46] plugin updates --- app/Http/Controllers/Auth/AuthController.php | 322 +++++++++--------- .../Controllers/Common/SettingsController.php | 6 +- config/app.php | 2 + .../default1/agent/layout/agent.blade.php | 2 +- .../default1/client/layout/client.blade.php | 1 + 5 files changed, 161 insertions(+), 172 deletions(-) diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index bbb8acb5b..f6f00dba7 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -36,8 +36,8 @@ use Socialite; * * @author Ladybird */ -class AuthController extends Controller -{ +class AuthController extends Controller { + use AuthenticatesAndRegistersUsers; /* to redirect after login */ @@ -58,15 +58,13 @@ class AuthController extends Controller * * @return void */ - public function __construct(PhpMailController $PhpMailController, SocialMediaController $social) - { + public function __construct(PhpMailController $PhpMailController, SocialMediaController $social) { $this->PhpMailController = $PhpMailController; $social->configService(); $this->middleware('guest', ['except' => ['getLogout', 'verifyOTP', 'redirectToProvider']]); } - public function redirectToProvider($provider, $redirect = '') - { + public function redirectToProvider($provider, $redirect = '') { if ($redirect !== '') { $this->setSession($provider, $redirect); } @@ -76,8 +74,7 @@ class AuthController extends Controller return $s; } - public function handleProviderCallback($provider) - { + public function handleProviderCallback($provider) { try { //notice we are not doing any validation, you should do it $this->changeRedirect(); @@ -95,10 +92,10 @@ class AuthController extends Controller } $data = [ 'first_name' => $first_name, - 'email' => $user->getEmail(), - 'user_name' => $username, - 'role' => 'user', - 'active' => 1, + 'email' => $user->getEmail(), + 'user_name' => $username, + 'role' => 'user', + 'active' => 1, ]; $user = User::where('email', $data['email'])->first(); if (!$user) { @@ -121,8 +118,7 @@ class AuthController extends Controller * * @return type Response */ - public function getRegister(CommonSettings $settings) - { + public function getRegister(CommonSettings $settings) { // Event for login $settings = $settings->select('status')->where('option_name', '=', 'send_otp')->first(); $email_mandatory = $settings->select('status')->where('option_name', '=', 'email_mandatory')->first(); @@ -147,8 +143,7 @@ class AuthController extends Controller * * @return type Response */ - public function postRegister(User $user, RegisterRequest $request) - { + public function postRegister(User $user, RegisterRequest $request) { try { $request_array = $request->input(); $password = Hash::make($request->input('password')); @@ -185,7 +180,7 @@ class AuthController extends Controller // Event for login \Event::fire(new \App\Events\LoginEvent($request)); if ($request->input('email') !== '') { - $var = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $request->input('email')], $message = ['subject' => null, 'scenario' => 'registration'], $template_variables = ['user' => $name, 'email_address' => $request->input('email'), 'password_reset_link' => url('account/activate/'.$code)]); + $var = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $request->input('email')], $message = ['subject' => null, 'scenario' => 'registration'], $template_variables = ['user' => $name, 'email_address' => $request->input('email'), 'password_reset_link' => url('account/activate/' . $code)]); } if ($settings->status == 1 || $settings->status == '1') { if (count($sms) > 0) { @@ -218,8 +213,7 @@ class AuthController extends Controller * * @return type redirect */ - public function accountActivate($token) - { + public function accountActivate($token) { $user = User::where('remember_token', '=', $token)->first(); if ($user) { $user->active = 1; @@ -241,8 +235,7 @@ class AuthController extends Controller * * @return type Response */ - public function getMail($token, User $user) - { + public function getMail($token, User $user) { $user = $user->where('remember_token', $token)->where('active', 0)->first(); if ($user) { $user->active = 1; @@ -259,10 +252,9 @@ class AuthController extends Controller * * @return type Response */ - public function getLogin() - { + public function getLogin() { $directory = base_path(); - if (file_exists($directory.DIRECTORY_SEPARATOR.'.env')) { + if (file_exists($directory . DIRECTORY_SEPARATOR . '.env')) { if (Auth::user()) { if (Auth::user()->role == 'admin' || Auth::user()->role == 'agent') { return \Redirect::route('dashboard'); @@ -284,61 +276,64 @@ class AuthController extends Controller * * @return type Response */ - public function postLogin(LoginRequest $request) - { - // dd($request->input()); - \Event::fire('auth.login.event', []); //added 5/5/2016 - // Set login attempts and login time - $value = $_SERVER['REMOTE_ADDR']; - $usernameinput = $request->input('email'); - $password = $request->input('password'); - if ($request->input('referer')) { - $referer = 'form'; - } else { - $referer = '/'; - } - $field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name'; - $result = $this->confirmIPAddress($value, $usernameinput); + public function postLogin(LoginRequest $request) { + try { + // dd($request->input()); + \Event::fire('auth.login.event', []); //added 5/5/2016 + // Set login attempts and login time + $value = $_SERVER['REMOTE_ADDR']; + $usernameinput = $request->input('email'); + $password = $request->input('password'); + if ($request->input('referer')) { + $referer = 'form'; + } else { + $referer = '/'; + } + $field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name'; + $result = $this->confirmIPAddress($value, $usernameinput); - // If attempts > 3 and time < 30 minutes - $security = Security::whereId('1')->first(); - if ($result == 1) { - return redirect()->back()->withErrors('email', 'Incorrect details')->with(['error' => $security->lockout_message, 'referer' => $referer]); - } + // If attempts > 3 and time < 30 minutes + $security = Security::whereId('1')->first(); + if ($result == 1) { + return redirect()->back()->withErrors('email', 'Incorrect details')->with(['error' => $security->lockout_message, 'referer' => $referer]); + } - $check_active = User::where('email', '=', $request->input('email'))->orwhere('user_name', '=', $request->input('email'))->first(); - if (!$check_active) { //check if user exists or not - //if user deos not exist then return back with error that user is not registered - return redirect()->back() - ->withInput($request->only('email', 'remember')) - ->withErrors([ - 'email' => $this->getFailedLoginMessage(), - 'password' => $this->getFailedLoginMessage(), - ])->with(['error' => Lang::get('lang.not-registered'), - 'referer' => $referer, ]); - } + $check_active = User::where('email', '=', $request->input('email'))->orwhere('user_name', '=', $request->input('email'))->first(); + if (!$check_active) { //check if user exists or not + //if user deos not exist then return back with error that user is not registered + return redirect()->back() + ->withInput($request->only('email', 'remember')) + ->withErrors([ + 'email' => $this->getFailedLoginMessage(), + 'password' => $this->getFailedLoginMessage(), + ])->with(['error' => Lang::get('lang.not-registered'), + 'referer' => $referer,]); + } - //if user exists - $settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first(); + //if user exists + $settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first(); - if ($settings->status == '1' || $settings->status == 1) { // check for otp verification setting - // setting is enabled - $sms = Plugin::select('status')->where('name', '=', 'SMS')->first(); - if ($sms) { //check sms plugin installed or not - // plugin is installed - if ($sms->status == 1 || $sms->status === '1') { //check plugin is active or not - // plugin is active - if (!$check_active->active) { //check account is active or not - // account is not active show verify otp window - if ($check_active->mobile) { //check user has mobile or not - // user has mobile number return verify OTP screen - return \Redirect::route('otp-verification') - ->withInput($request->input()) - ->with(['values' => $request->input(), - 'referer' => $referer, - 'name' => $check_active->first_name, - 'number' => $check_active->mobile, - 'code' => $check_active->country_code, ]); + if ($settings->status == '1' || $settings->status == 1) { // check for otp verification setting + // setting is enabled + $sms = Plugin::select('status')->where('name', '=', 'SMS')->first(); + if ($sms) { //check sms plugin installed or not + // plugin is installed + if ($sms->status == 1 || $sms->status === '1') { //check plugin is active or not + // plugin is active + if (!$check_active->active) { //check account is active or not + // account is not active show verify otp window + if ($check_active->mobile) { //check user has mobile or not + // user has mobile number return verify OTP screen + return \Redirect::route('otp-verification') + ->withInput($request->input()) + ->with(['values' => $request->input(), + 'referer' => $referer, + 'name' => $check_active->first_name, + 'number' => $check_active->mobile, + 'code' => $check_active->country_code,]); + } else { + goto a; //attenmpt login (be careful while using goto statements) + } } else { goto a; //attenmpt login (be careful while using goto statements) } @@ -349,69 +344,69 @@ class AuthController extends Controller goto a; //attenmpt login (be careful while using goto statements) } } else { - goto a; //attenmpt login (be careful while using goto statements) - } - } else { - // setting is disabled - a: if (!$check_active->active) { //check account is active or not - // if accoutn is not active return back with error message that account is inactive - return redirect()->back() - ->withInput($request->only('email', 'remember')) - ->withErrors([ - 'email' => $this->getFailedLoginMessage(), - 'password' => $this->getFailedLoginMessage(), - ])->with(['error' => Lang::get('lang.this_account_is_currently_inactive'), - 'referer' => $referer, ]); - } else { - // try login - $loginAttempts = 1; - // If session has login attempts, retrieve attempts counter and attempts time - if (\Session::has('loginAttempts')) { - $loginAttempts = \Session::get('loginAttempts'); - $loginAttemptTime = \Session::get('loginAttemptTime'); - $this->addLoginAttempt($value, $usernameinput); - // $credentials = $request->only('email', 'password'); - $usernameinput = $request->input('email'); - $password = $request->input('password'); - $field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name'; - // If attempts > 3 and time < 10 minutes - if ($loginAttempts > $security->backlist_threshold && (time() - $loginAttemptTime <= ($security->lockout_period * 60))) { - return redirect()->back()->withErrors('email', 'incorrect email')->with('error', $security->lockout_message); - } - // If time > 10 minutes, reset attempts counter and time in session - if (time() - $loginAttemptTime > ($security->lockout_period * 60)) { - \Session::put('loginAttempts', 1); - \Session::put('loginAttemptTime', time()); - } - } else { // If no login attempts stored, init login attempts and time - \Session::put('loginAttempts', $loginAttempts); - \Session::put('loginAttemptTime', time()); - $this->clearLoginAttempts($value, $usernameinput); - } - // If auth ok, redirect to restricted area - \Session::put('loginAttempts', $loginAttempts + 1); - if (Auth::Attempt([$field => $usernameinput, 'password' => $password], $request->has('remember'))) { - if (Auth::user()->role == 'user') { - if ($request->input('referer')) { - return \Redirect::route($request->input('referer')); + // setting is disabled + a: if (!$check_active->active) { //check account is active or not + // if accoutn is not active return back with error message that account is inactive + return redirect()->back() + ->withInput($request->only('email', 'remember')) + ->withErrors([ + 'email' => $this->getFailedLoginMessage(), + 'password' => $this->getFailedLoginMessage(), + ])->with(['error' => Lang::get('lang.this_account_is_currently_inactive'), + 'referer' => $referer,]); + } else { + // try login + $loginAttempts = 1; + // If session has login attempts, retrieve attempts counter and attempts time + if (\Session::has('loginAttempts')) { + $loginAttempts = \Session::get('loginAttempts'); + $loginAttemptTime = \Session::get('loginAttemptTime'); + $this->addLoginAttempt($value, $usernameinput); + // $credentials = $request->only('email', 'password'); + $usernameinput = $request->input('email'); + $password = $request->input('password'); + $field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name'; + // If attempts > 3 and time < 10 minutes + if ($loginAttempts > $security->backlist_threshold && (time() - $loginAttemptTime <= ($security->lockout_period * 60))) { + return redirect()->back()->withErrors('email', 'incorrect email')->with('error', $security->lockout_message); } + // If time > 10 minutes, reset attempts counter and time in session + if (time() - $loginAttemptTime > ($security->lockout_period * 60)) { + \Session::put('loginAttempts', 1); + \Session::put('loginAttemptTime', time()); + } + } else { // If no login attempts stored, init login attempts and time + \Session::put('loginAttempts', $loginAttempts); + \Session::put('loginAttemptTime', time()); + $this->clearLoginAttempts($value, $usernameinput); + } + // If auth ok, redirect to restricted area + \Session::put('loginAttempts', $loginAttempts + 1); + if (Auth::Attempt([$field => $usernameinput, 'password' => $password], $request->has('remember'))) { + if (Auth::user()->role == 'user') { + if ($request->input('referer')) { + return \Redirect::route($request->input('referer')); + } - return \Redirect::route('/'); - } else { - return redirect()->intended($this->redirectPath()); + return \Redirect::route('/'); + } else { + return redirect()->intended($this->redirectPath()); + } } } } - } - return redirect()->back() - ->withInput($request->only('email', 'remember')) - ->withErrors([ - 'email' => $this->getFailedLoginMessage(), - 'password' => $this->getFailedLoginMessage(), - ])->with(['error' => Lang::get('lang.invalid'), - 'referer' => $referer, ]); - // Increment login attempts + return redirect()->back() + ->withInput($request->only('email', 'remember')) + ->withErrors([ + 'email' => $this->getFailedLoginMessage(), + 'password' => $this->getFailedLoginMessage(), + ])->with(['error' => Lang::get('lang.invalid'), + 'referer' => $referer,]); + // Increment login attempts + } catch (\Exception $e) { + return redirect()->back()->with('fails', $e->getMessage()); + } } /** @@ -421,8 +416,7 @@ class AuthController extends Controller * * @return type Response */ - public function addLoginAttempt($value, $field) - { + public function addLoginAttempt($value, $field) { $result = DB::table('login_attempts')->where('IP', '=', $value)->first(); $data = $result; $security = Security::whereId('1')->first(); @@ -449,8 +443,7 @@ class AuthController extends Controller * * @return type Response */ - public function clearLoginAttempts($value, $field) - { + public function clearLoginAttempts($value, $field) { $data = DB::table('login_attempts')->where('IP', '=', $value)->orWhere('User', '=', $field)->update(['attempts' => '0']); return $data; @@ -463,14 +456,13 @@ class AuthController extends Controller * * @return type Response */ - public function confirmIPAddress($value, $field) - { + public function confirmIPAddress($value, $field) { $security = Security::whereId('1')->first(); $time = $security->lockout_period; $max_attempts = $security->backlist_threshold; $table = 'login_attempts'; - $result = DB::select('SELECT Attempts, (CASE when LastLogin is not NULL and DATE_ADD(LastLogin, INTERVAL '.$time.' MINUTE)>NOW() then 1 else 0 end) as Denied '. - ' FROM '.$table." WHERE IP = '$value' OR User = '$field'"); + $result = DB::select('SELECT Attempts, (CASE when LastLogin is not NULL and DATE_ADD(LastLogin, INTERVAL ' . $time . ' MINUTE)>NOW() then 1 else 0 end) as Denied ' . + ' FROM ' . $table . " WHERE IP = '$value' OR User = '$field'"); $data = $result; //Verify that at least one login attempt is in database if (!$data) { @@ -494,20 +486,18 @@ class AuthController extends Controller * * @return type string */ - protected function getFailedLoginMessage() - { + protected function getFailedLoginMessage() { return Lang::get('lang.this_field_do_not_match_our_records'); } /** - *@category function to show verify OTP page + * @category function to show verify OTP page * - *@param null + * @param null * - *@return response|view + * @return response|view */ - public function getVerifyOTP() - { + public function getVerifyOTP() { if (\Session::has('values')) { return view('auth.otp-verify'); } else { @@ -516,22 +506,21 @@ class AuthController extends Controller } /** - *@category function to verify OTP + * @category function to verify OTP * - *@param $request + * @param $request * - *@return int|string + * @return int|string */ - public function verifyOTP(LoginRequest $request) - { + public function verifyOTP(LoginRequest $request) { $user = User::select('id', 'mobile', 'user_name')->where('email', '=', $request->input('email')) - ->orWhere('user_name', '=', $request->input('email'))->first(); + ->orWhere('user_name', '=', $request->input('email'))->first(); $otp_length = strlen($request->input('otp')); if (!\Schema::hasTable('user_verification')) { $message = Lang::get('lang.opt-can-not-be-verified'); } else { $otp = Otp::select('otp', 'updated_at')->where('user_id', '=', $user->id) - ->first(); + ->first(); if ($otp != null) { if (($otp_length == 6 && !preg_match('/[a-z]/i', $request->input('otp')))) { $otp2 = Hash::make($request->input('otp')); @@ -566,13 +555,12 @@ class AuthController extends Controller return \Redirect::route('otp-verification') ->withInput($request->input()) ->with(['values' => $request->input(), - 'number' => $user->mobile, - 'name' => $user->user_name, - 'fails' => $message, ]); + 'number' => $user->mobile, + 'name' => $user->user_name, + 'fails' => $message,]); } - public function resendOTP(OtpVerifyRequest $request) - { + public function resendOTP(OtpVerifyRequest $request) { if (!\Schema::hasTable('user_verification') || !\Schema::hasTable('sms')) { $message = Lang::get('lang.opt-can-not-be-verified'); @@ -600,8 +588,7 @@ class AuthController extends Controller * * @author manish.verma@ladybirdweb.com */ - public function openTicketAfterVerification($id) - { + public function openTicketAfterVerification($id) { // dd($id); $ticket = Tickets::select('id') ->where(['user_id' => $id, 'status' => 6]) @@ -612,23 +599,22 @@ class AuthController extends Controller foreach ($ticket as $value) { $ticket_id = $value->id; Ticket_Thread::where('ticket_id', '=', $ticket_id) - ->update(['updated_at' => date('Y-m-d H:i:s')]); + ->update(['updated_at' => date('Y-m-d H:i:s')]); } } } - public function changeRedirect() - { + public function changeRedirect() { $provider = \Session::get('provider'); - $url = \Session::get($provider.'redirect'); + $url = \Session::get($provider . 'redirect'); \Config::set("services.$provider.redirect", $url); } - public function setSession($provider, $redirect) - { + public function setSession($provider, $redirect) { $url = url($redirect); \Session::set('provider', $provider); - \Session::set($provider.'redirect', $url); + \Session::set($provider . 'redirect', $url); $this->changeRedirect(); } + } diff --git a/app/Http/Controllers/Common/SettingsController.php b/app/Http/Controllers/Common/SettingsController.php index ea9f5e7e5..f71ebe2a8 100644 --- a/app/Http/Controllers/Common/SettingsController.php +++ b/app/Http/Controllers/Common/SettingsController.php @@ -408,7 +408,7 @@ class SettingsController extends Controller $app = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php'; chmod($app, 0644); $str = "\n\n\t\t\t'App\\Plugins\\$filename"."\\ServiceProvider',"; - $line_i_am_looking_for = 185; + $line_i_am_looking_for = 190; $lines = file($app, FILE_IGNORE_NEW_LINES); $lines[$line_i_am_looking_for] = $str; file_put_contents($app, implode("\n", $lines)); @@ -580,7 +580,7 @@ class SettingsController extends Controller if (!$plug) { $app = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php'; $str = "\n'App\\Plugins\\$slug"."\\ServiceProvider',"; - $line_i_am_looking_for = 185; + $line_i_am_looking_for = 190; $lines = file($app, FILE_IGNORE_NEW_LINES); $lines[$line_i_am_looking_for] = $str; file_put_contents($app, implode("\n", $lines)); @@ -594,7 +594,7 @@ class SettingsController extends Controller $app = base_path().DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'app.php'; $str = "\n'App\\Plugins\\$slug"."\\ServiceProvider',"; - $line_i_am_looking_for = 185; + $line_i_am_looking_for = 190; $lines = file($app, FILE_IGNORE_NEW_LINES); $lines[$line_i_am_looking_for] = $str; file_put_contents($app, implode("\n", $lines)); diff --git a/config/app.php b/config/app.php index 6c74a4407..73e432c26 100644 --- a/config/app.php +++ b/config/app.php @@ -187,6 +187,8 @@ return [ App\FaveoLog\LaravelLogViewerServiceProvider::class, App\FaveoStorage\StorageServiceProvider::class, Yajra\Datatables\DatatablesServiceProvider::class, + + ], /* diff --git a/resources/views/themes/default1/agent/layout/agent.blade.php b/resources/views/themes/default1/agent/layout/agent.blade.php index 6f032b588..338787375 100644 --- a/resources/views/themes/default1/agent/layout/agent.blade.php +++ b/resources/views/themes/default1/agent/layout/agent.blade.php @@ -310,7 +310,7 @@ @endforeach - + @else @endif diff --git a/resources/views/themes/default1/client/layout/client.blade.php b/resources/views/themes/default1/client/layout/client.blade.php index e97cbb7ad..e5bf16bd1 100644 --- a/resources/views/themes/default1/client/layout/client.blade.php +++ b/resources/views/themes/default1/client/layout/client.blade.php @@ -166,6 +166,7 @@
{!! Form::password('password',['placeholder'=>Lang::get('lang.password'),'class' => 'form-control']) !!} + {!! Lang::get('lang.forgot_password') !!}
From b0b5bd8637c1a9287a01c3e9adda45b3c8b82dd2 Mon Sep 17 00:00:00 2001 From: Vijay Sebastian Date: Thu, 27 Jul 2017 16:38:21 +0530 Subject: [PATCH 06/46] api updates --- .../Agent/helpdesk/TicketController.php | 27 +- app/Http/Controllers/Api/v1/ApiController.php | 1067 +++++++++++------ .../Controllers/Api/v1/TicketController.php | 551 +++++---- .../Api/v1/TokenAuthController.php | 2 +- app/Http/Controllers/Auth/AuthController.php | 502 +++++--- app/Http/routes.php | 4 +- app/Model/helpdesk/Utility/Priority.php | 2 +- 7 files changed, 1363 insertions(+), 792 deletions(-) diff --git a/app/Http/Controllers/Agent/helpdesk/TicketController.php b/app/Http/Controllers/Agent/helpdesk/TicketController.php index 82245c848..732837cc6 100644 --- a/app/Http/Controllers/Agent/helpdesk/TicketController.php +++ b/app/Http/Controllers/Agent/helpdesk/TicketController.php @@ -284,29 +284,34 @@ class TicketController extends Controller if ($result[1]) { $status = $this->checkUserVerificationStatus(); if ($status == 1) { - if ($api != false) { - return Lang::get('lang.Ticket-created-successfully'); + if ($api != false) + { + $ticket = Tickets::where('ticket_number', '=', $result[0])->select('id')->first(); + return ['ticket_id' => $ticket->id, 'message' => Lang::get('lang.Ticket-created-successfully')]; } return Redirect('newticket')->with('success', Lang::get('lang.Ticket-created-successfully')); } else { - if ($api != false) { - return Lang::get('lang.Ticket-created-successfully'); + if ($api != false) + { + return response()->json(['success' => Lang::get('lang.Ticket-created-successfully')]); } return Redirect('newticket')->with('success', Lang::get('lang.Ticket-created-successfully2')); } } else { - if ($api != false) { - return Lang::get('lang.failed-to-create-user-tcket-as-mobile-has-been-taken'); + if ($api != false) + { + return response()->json(['error' => Lang::get('lang.failed-to-create-user-tcket-as-mobile-has-been-taken')], 500); } return Redirect('newticket')->with('fails', Lang::get('lang.failed-to-create-user-tcket-as-mobile-has-been-taken'))->withInput($request->except('password')); } } catch (Exception $e) { - // dd($e); - if ($api != false) { - return $e->getMessage(); + dd($e); + if ($api != false) + { + return response()->json(['error' => $e->getMessage()], 500); } return Redirect()->back()->with('fails', '
  • '.$e->getMessage().'
  • '); @@ -879,7 +884,7 @@ class TicketController extends Controller } $set_mails = []; - if (Alert::first()->ticket_status == 1 || Alert::first()->ticket_admin_email == 1) { + if (Alert::first() && (Alert::first()->ticket_status == 1 || Alert::first()->ticket_admin_email == 1)) { // send email to admin $admins = User::where('role', '=', 'admin')->get(); foreach ($admins as $admin) { @@ -891,7 +896,7 @@ class TicketController extends Controller } if ($is_reply == 0) { - if (Alert::first()->ticket_status == 1 || Alert::first()->ticket_department_member == 1) { + if (Alert::first() && (Alert::first()->ticket_status == 1 || Alert::first()->ticket_department_member == 1)) { // send email to agents $agents = User::where('role', '=', 'agent')->get(); foreach ($agents as $agent) { diff --git a/app/Http/Controllers/Api/v1/ApiController.php b/app/Http/Controllers/Api/v1/ApiController.php index 6878c510c..fa69a36b7 100644 --- a/app/Http/Controllers/Api/v1/ApiController.php +++ b/app/Http/Controllers/Api/v1/ApiController.php @@ -36,6 +36,7 @@ use Illuminate\Support\Collection; */ class ApiController extends Controller { + public $user; public $request; public $ticket; @@ -61,53 +62,60 @@ class ApiController extends Controller $this->middleware('jwt.auth'); $this->middleware('api', ['except' => 'GenerateApiKey']); - try { - $user = \JWTAuth::parseToken()->authenticate(); + try + { + $user = \JWTAuth::parseToken()->authenticate(); $this->user = $user; - } catch (\Tymon\JWTAuth\Exceptions\TokenExpiredException $e) { - } catch (\Tymon\JWTAuth\Exceptions\JWTException $e) { + } + catch (\Tymon\JWTAuth\Exceptions\TokenExpiredException $e) + { + + } + catch (\Tymon\JWTAuth\Exceptions\JWTException $e) + { + } - $ticket = new TicketController(); + $ticket = new TicketController(); $this->ticket = $ticket; - $model = new Tickets(); + $model = new Tickets(); $this->model = $model; - $thread = new Ticket_Thread(); + $thread = new Ticket_Thread(); $this->thread = $thread; - $attach = new Ticket_attachments(); + $attach = new Ticket_attachments(); $this->attach = $attach; - $ticketRequest = new TicketRequest(); + $ticketRequest = new TicketRequest(); $this->ticketRequest = $ticketRequest; - $faveoUser = new User(); + $faveoUser = new User(); $this->faveoUser = $faveoUser; - $faveoUser = new User(); + $faveoUser = new User(); $this->user = $faveoUser; - $team = new Teams(); + $team = new Teams(); $this->team = $team; - $setting = new System(); + $setting = new System(); $this->setting = $setting; - $helptopic = new Help_topic(); + $helptopic = new Help_topic(); $this->helptopic = $helptopic; - $slaPlan = new Sla_plan(); + $slaPlan = new Sla_plan(); $this->slaPlan = $slaPlan; - $priority = new Priority(); + $priority = new Priority(); $this->priority = $priority; - $department = new Department(); + $department = new Department(); $this->department = $department; - $source = new Ticket_source(); + $source = new Ticket_source(); $this->source = $source; } @@ -122,33 +130,37 @@ class ApiController extends Controller */ public function createTicket(\App\Http\Requests\helpdesk\CreateTicketRequest $request, \App\Model\helpdesk\Utility\CountryCode $code) { - try { + try + { $user_id = $this->request->input('user_id'); - $subject = $this->request->input('subject'); - $body = $this->request->input('body'); + $subject = $this->request->input('subject'); + $body = $this->request->input('body'); $helptopic = $this->request->input('helptopic'); - $sla = $this->request->input('sla'); - $priority = $this->request->input('priority'); - $header = $this->request->input('cc'); - $dept = $this->request->input('dept'); + $sla = $this->request->input('sla'); + $priority = $this->request->input('priority'); + $header = $this->request->input('cc'); + $dept = $this->request->input('dept'); - $assignto = $this->request->input('assignto'); + $assignto = $this->request->input('assignto'); $form_data = $this->request->input('form_data'); - $source = $this->request->input('source'); - $attach = $this->request->input('attachments'); - $headers = []; - if ($header) { + $source = $this->request->input('source'); + $attach = $this->request->input('attachments'); + $headers = []; + if ($header) + { $headers = explode(',', $header); } //return $headers; /* * return s ticket number */ - $PhpMailController = new \App\Http\Controllers\Common\PhpMailController(); + $PhpMailController = new \App\Http\Controllers\Common\PhpMailController(); $NotificationController = new \App\Http\Controllers\Common\NotificationController(); - $core = new CoreTicketController($PhpMailController, $NotificationController); - $response = $core->post_newticket($request, $code, true); + $core = new CoreTicketController($PhpMailController, $NotificationController); + $this->request->merge(['body' => preg_replace('/[ ](?=[^>]*(?:<|$))/', ' ', nl2br($this->request->get('body')))]); + $request->replace($this->request->except('token', 'api_key')); + $response = $core->post_newticket($request, $code, true); //$response = $this->ticket->createTicket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data, $attach); //return $response; /* @@ -158,13 +170,17 @@ class ApiController extends Controller //$result = $this->thread->where('id', $response)->first(); //$result = $this->attach($result->id,$file); return response()->json(compact('response')); - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')) @@ -182,12 +198,14 @@ class ApiController extends Controller public function ticketReply() { //dd($this->request->all()); - try { + try + { $v = \Validator::make($this->request->all(), [ 'ticket_ID' => 'required|exists:tickets,id', 'reply_content' => 'required', ]); - if ($v->fails()) { + if ($v->fails()) + { $error = $v->errors(); return response()->json(compact('error')); @@ -196,16 +214,21 @@ class ApiController extends Controller $result = $this->ticket->reply($this->thread, $this->request, $this->attach, $attach); $result = $result->join('users', 'ticket_thread.user_id', '=', 'users.id') ->select('ticket_thread.*', 'users.first_name as first_name') + ->orderBy('ticket_thread.id', 'desc') ->first(); return response()->json(compact('result')); - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -219,7 +242,8 @@ class ApiController extends Controller */ public function editTicket() { - try { + try + { $v = \Validator::make($this->request->all(), [ 'ticket_id' => 'required|exists:tickets,id', 'subject' => 'required', @@ -228,22 +252,25 @@ class ApiController extends Controller 'ticket_source' => 'required|exists:ticket_source,id', 'ticket_priority' => 'required|exists:ticket_priority,priority_id', ]); - if ($v->fails()) { + if ($v->fails()) + { $error = $v->errors(); return response()->json(compact('error')); } $ticket_id = $this->request->input('ticket_id'); - $result = $this->ticket->ticketEditPost($ticket_id, $this->thread, $this->model); - - return response()->json(compact('result')); - } catch (\Exception $e) { + return $this->ticket->ticketEditPost($ticket_id, $this->thread, $this->model); + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -257,27 +284,33 @@ class ApiController extends Controller */ public function deleteTicket() { - try { + try + { $v = \Validator::make($this->request->all(), [ 'ticket_id' => 'required|exists:tickets,id', ]); - if ($v->fails()) { + if ($v->fails()) + { $error = $v->errors(); return response()->json(compact('error')); } $id = $this->request->input('ticket_id'); - $result = $this->ticket->delete($id, $this->model); + $result = $this->ticket->delete(explode(',', $id), $this->model); return response()->json(compact('result')); - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -291,20 +324,23 @@ class ApiController extends Controller */ public function openedTickets() { - try { + try + { // $result = $this->model->where('status', '=', 1)->where('isanswered', '=', 0)->where('assigned_to', '=', null)->orderBy('id', 'DESC')->get(); // return response()->json(compact('result')); - $result = $this->user->join('tickets', function ($join) { - $join->on('users.id', '=', 'tickets.user_id') + $result = $this->user->join('tickets', function ($join) + { + $join->on('users.id', '=', 'tickets.user_id') ->where('isanswered', '=', 0)->where('status', '=', 1)->whereNull('assigned_to'); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') ->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id') ->join('ticket_status', 'ticket_status.id', '=', 'tickets.status') - ->join('ticket_thread', function ($join) { + ->join('ticket_thread', function ($join) + { $join->on('tickets.id', '=', 'ticket_thread.ticket_id') ->whereNotNull('title'); }) @@ -316,13 +352,17 @@ class ApiController extends Controller ->toJson(); return $result; - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -336,30 +376,38 @@ class ApiController extends Controller */ public function unassignedTickets() { - try { + try + { //dd('sdhjbc'); // $result = $this->model->where('assigned_to', '=', null)->where('status', '1')->orderBy('id', 'DESC')->get(); // return response()->json(compact('result')); - $user = \JWTAuth::parseToken()->authenticate(); - $unassigned = $this->user->join('tickets', function ($join) { - $join->on('users.id', '=', 'tickets.user_id') + $user = \JWTAuth::parseToken()->authenticate(); + $unassigned = $this->user->join('tickets', function ($join) + { + $join->on('users.id', '=', 'tickets.user_id') ->whereNull('assigned_to')->where('status', '=', 1); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') ->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id') ->join('ticket_status', 'ticket_status.id', '=', 'tickets.status') - ->join('ticket_thread', function ($join) { - $join->on('tickets.id', '=', 'ticket_thread.ticket_id') - ->whereNotNull('title'); - }) - ->select(\DB::raw('max(ticket_thread.updated_at) as updated_at'), 'user_name', 'first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'title', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name') - ->where(function ($query) use ($user) { - if ($user->role != 'admin') { - $query->where('tickets.dept_id', '=', $user->primary_dpt); - } + ->leftJoin('ticket_thread', function ($join) + { + $join->on('tickets.id', '=', 'ticket_thread.ticket_id'); }) + ->leftJoin('ticket_attachment', 'ticket_attachment.thread_id', '=', 'ticket_thread.id'); + if ($user->role == 'agent') + { + $id = $user->id; + $dept = \DB::table('department_assign_agents')->where('agent_id', '=', $id)->pluck('department_id')->toArray(); + $unassigned = $unassigned->where(function ($query) use ($dept, $id) + { + $query->whereIn('tickets.dept_id', $dept) + ->orWhere('assigned_to', '=', $id); + }); + } + $unassigned = $unassigned->select('ticket_priority.priority_color as priority_color', \DB::raw('substring_index(group_concat(ticket_thread.title order by ticket_thread.id asc) , ",", 1) as title'), 'tickets.duedate as overdue_date', \DB::raw('count(ticket_attachment.id) as attachment'), \DB::raw('max(ticket_thread.updated_at) as updated_at'), 'user_name', 'first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name') ->orderBy('updated_at', 'desc') ->groupby('tickets.id') ->distinct() @@ -367,13 +415,17 @@ class ApiController extends Controller ->toJson(); return $unassigned; - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -387,29 +439,37 @@ class ApiController extends Controller */ public function closeTickets() { - try { + try + { // $result = $this->model->where('status', '>', 1)->where('status', '<', 4)->orderBy('id', 'DESC')->get(); // return response()->json(compact('result')); - $user = \JWTAuth::parseToken()->authenticate(); - $result = $this->user->join('tickets', function ($join) { - $join->on('users.id', '=', 'tickets.user_id') + $user = \JWTAuth::parseToken()->authenticate(); + $result = $this->user->join('tickets', function ($join) + { + $join->on('users.id', '=', 'tickets.user_id') ->where('status', '=', 3)->orWhere('status', '=', 2); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') ->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id') ->join('ticket_status', 'ticket_status.id', '=', 'tickets.status') - ->join('ticket_thread', function ($join) { - $join->on('tickets.id', '=', 'ticket_thread.ticket_id') - ->whereNotNull('title'); - }) - ->select(\DB::raw('max(ticket_thread.updated_at) as updated_at'), 'user_name', 'first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'title', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name') - ->where(function ($query) use ($user) { - if ($user->role != 'admin') { - $query->where('tickets.dept_id', '=', $user->primary_dpt); - } + ->leftJoin('ticket_thread', function ($join) + { + $join->on('tickets.id', '=', 'ticket_thread.ticket_id'); }) + ->leftJoin('ticket_attachment', 'ticket_attachment.thread_id', '=', 'ticket_thread.id'); + if ($user->role == 'agent') + { + $id = $user->id; + $dept = \DB::table('department_assign_agents')->where('agent_id', '=', $id)->pluck('department_id')->toArray(); + $result = $result->where(function ($query) use ($dept, $id) + { + $query->whereIn('tickets.dept_id', $dept) + ->orWhere('assigned_to', '=', $id); + }); + } + $result = $result->select('tickets.duedate as overdue_date', 'ticket_priority.priority_color as priority_color', \DB::raw('substring_index(group_concat(ticket_thread.title order by ticket_thread.id asc) , ",", 1) as title'), \DB::raw('count(ticket_attachment.id) as attachment'), \DB::raw('max(ticket_thread.updated_at) as updated_at'), 'user_name', 'first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name') ->orderBy('updated_at', 'desc') ->groupby('tickets.id') ->distinct() @@ -417,13 +477,17 @@ class ApiController extends Controller ->toJson(); return $result; - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -437,17 +501,22 @@ class ApiController extends Controller */ public function getAgents() { - try { + try + { $result = $this->faveoUser->where('role', 'agent')->orWhere('role', 'admin')->where('active', 1)->get(); return response()->json(compact('result')); - } catch (Exception $e) { + } + catch (Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -461,17 +530,22 @@ class ApiController extends Controller */ public function getTeams() { - try { + try + { $result = $this->team->get(); return response()->json(compact('result')); - } catch (Exception $e) { + } + catch (Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -485,32 +559,41 @@ class ApiController extends Controller */ public function assignTicket() { - try { + try + { $v = \Validator::make($this->request->all(), [ 'ticket_id' => 'required', 'user' => 'required', ]); - if ($v->fails()) { + if ($v->fails()) + { $error = $v->errors(); return response()->json(compact('error')); } - $id = $this->request->input('ticket_id'); + $id = $this->request->input('ticket_id'); $response = $this->ticket->assign($id); - if ($response == 1) { + if ($response == 1) + { $result = 'success'; return response()->json(compact('result')); - } else { + } + else + { return response()->json(compact('response')); } - } catch (Exception $e) { + } + catch (Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -524,27 +607,33 @@ class ApiController extends Controller */ public function getCustomers() { - try { + try + { $v = \Validator::make($this->request->all(), [ 'search' => 'required', ]); - if ($v->fails()) { + if ($v->fails()) + { $error = $v->errors(); return response()->json(compact('error')); } $search = $this->request->input('search'); - $result = $this->faveoUser->where('first_name', 'like', '%'.$search.'%')->orWhere('last_name', 'like', '%'.$search.'%')->orWhere('user_name', 'like', '%'.$search.'%')->orWhere('email', 'like', '%'.$search.'%')->get(); + $result = $this->faveoUser->where('first_name', 'like', '%' . $search . '%')->orWhere('last_name', 'like', '%' . $search . '%')->orWhere('user_name', 'like', '%' . $search . '%')->orWhere('email', 'like', '%' . $search . '%')->get(); return response()->json(compact('result')) ->header('X-Header-One', 'Header Value'); - } catch (Exception $e) { + } + catch (Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')) @@ -559,24 +648,29 @@ class ApiController extends Controller */ public function getCustomersWith() { - try { + try + { $users = $this->user ->leftJoin('user_assign_organization', 'user_assign_organization.user_id', '=', 'users.id') ->leftJoin('organization', 'organization.id', '=', 'user_assign_organization.org_id') - ->where('role', 'user') - ->select('users.id', 'user_name', 'first_name', 'last_name', 'email', 'phone_number', 'users.profile_pic', 'organization.name AS company', 'users.active') + ->where('users.role', 'user') + ->select('users.id', 'users.user_name', 'users.first_name', 'users.last_name', 'users.email', 'users.phone_number', 'users.profile_pic', 'organization.name AS company', 'users.active', 'users.ext as telephone_extension', 'users.mobile', 'users.phone_number as telephone', 'users.country_code as mobile_code') ->paginate(10) ->toJson(); //dd($users); return $users; - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')) @@ -591,26 +685,32 @@ class ApiController extends Controller */ public function getCustomer() { - try { + try + { $v = \Validator::make($this->request->all(), [ 'user_id' => 'required', ]); - if ($v->fails()) { + if ($v->fails()) + { $error = $v->errors(); return response()->json(compact('error')); } - $id = $this->request->input('user_id'); + $id = $this->request->input('user_id'); $result = $this->faveoUser->where('id', $id)->where('role', 'user')->first(); return response()->json(compact('result')); - } catch (Exception $e) { + } + catch (Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -624,26 +724,32 @@ class ApiController extends Controller */ public function searchTicket() { - try { + try + { $v = \Validator::make($this->request->all(), [ 'search' => 'required', ]); - if ($v->fails()) { + if ($v->fails()) + { $error = $v->errors(); return response()->json(compact('error')); } $search = $this->request->input('search'); - $result = $this->thread->select('ticket_id')->where('title', 'like', '%'.$search.'%')->orWhere('body', 'like', '%'.$search.'%')->get(); + $result = $this->thread->select('ticket_id')->where('title', 'like', '%' . $search . '%')->orWhere('body', 'like', '%' . $search . '%')->get(); return response()->json(compact('result')); - } catch (Exception $e) { + } + catch (Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -657,31 +763,38 @@ class ApiController extends Controller */ public function ticketThreads() { - try { + try + { $v = \Validator::make($this->request->all(), [ 'id' => 'required', ]); - if ($v->fails()) { + if ($v->fails()) + { $error = $v->errors(); return response()->json(compact('error')); } - $id = $this->request->input('id'); + $id = $this->request->input('id'); $result = $this->user - ->leftjoin('ticket_thread', 'ticket_thread.user_id', '=', 'users.id') + ->rightjoin('ticket_thread', 'ticket_thread.user_id', '=', 'users.id') ->select('ticket_thread.id', 'ticket_id', 'user_id', 'poster', 'source', 'title', 'body', 'is_internal', 'format', 'ip_address', 'ticket_thread.created_at', 'ticket_thread.updated_at', 'users.first_name', 'users.last_name', 'users.user_name', 'users.email', 'users.profile_pic') ->where('ticket_id', $id) + ->orderBy('ticket_thread.id', 'desc') ->get() ->toJson(); return $result; - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -696,30 +809,37 @@ class ApiController extends Controller public function checkUrl() { //dd($this->request); - try { + try + { $v = \Validator::make($this->request->all(), [ 'url' => 'required|url', ]); - if ($v->fails()) { + if ($v->fails()) + { $error = $v->errors(); return response()->json(compact('error')); } $url = $this->request->input('url'); - if (!str_is('*/', $url)) { + if (!str_is('*/', $url)) + { $url = str_finish($url, '/'); } - $url = $url.'/api/v1/helpdesk/check-url?api_key='.$this->request->input('api_key').'&token='.\Config::get('app.token'); + $url = $url . '/api/v1/helpdesk/check-url?api_key=' . $this->request->input('api_key') . '&token=' . \Config::get('app.token'); $result = $this->CallGetApi($url); //dd($result); return response()->json(compact('result')); - } catch (\Exception $ex) { + } + catch (\Exception $ex) + { $error = $e->getMessage(); return response()->json(compact('error')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -745,15 +865,16 @@ class ApiController extends Controller */ public function callGetApi($url) { - $curl = curl_init($url); + $curl = curl_init($url); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl); - if (curl_errno($curl)) { - echo 'error:'.curl_error($curl); + if (curl_errno($curl)) + { + echo 'error:' . curl_error($curl); } return $response; @@ -770,7 +891,7 @@ class ApiController extends Controller */ public function callPostApi($url, $data) { - $curl = curl_init($url); + $curl = curl_init($url); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HEADER, 0); @@ -778,8 +899,9 @@ class ApiController extends Controller curl_setopt($curl, CURLOPT_POSTFIELDS, $data); $response = curl_exec($curl); - if (curl_errno($curl)) { - echo 'error:'.curl_error($curl); + if (curl_errno($curl)) + { + echo 'error:' . curl_error($curl); } return $response; @@ -793,28 +915,36 @@ class ApiController extends Controller */ public function generateApiKey() { - try { + try + { $set = $this->setting->where('id', '1')->first(); //dd($set); - if ($set->api_enable == 1) { - $key = str_random(32); + if ($set->api_enable == 1) + { + $key = str_random(32); $set->api_key = $key; $set->save(); - $result = $set->api_key; + $result = $set->api_key; return response()->json(compact('result')); - } else { + } + else + { $result = 'please enable api'; return response()->json(compact('result')); } - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -828,17 +958,22 @@ class ApiController extends Controller */ public function getHelpTopic() { - try { + try + { $result = $this->helptopic->get(); return response()->json(compact('result')); - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -852,17 +987,22 @@ class ApiController extends Controller */ public function getSlaPlan() { - try { + try + { $result = $this->slaPlan->get(); return response()->json(compact('result')); - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -876,17 +1016,22 @@ class ApiController extends Controller */ public function getPriority() { - try { - $result = $this->priority->get(); + try + { + $result = $this->priority->select('priority as name', 'priority_id as id')->get(); return response()->json(compact('result')); - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -900,17 +1045,22 @@ class ApiController extends Controller */ public function getDepartment() { - try { + try + { $result = $this->department->get(); return response()->json(compact('result')); - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -924,18 +1074,23 @@ class ApiController extends Controller */ public function getTickets() { - try { + try + { $tickets = $this->model->orderBy('created_at', 'desc')->paginate(10); $tickets->toJson(); return $tickets; - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -949,27 +1104,36 @@ class ApiController extends Controller */ public function inbox() { - try { - $user = \JWTAuth::parseToken()->authenticate(); - $inbox = $this->user->join('tickets', function ($join) { - $join->on('users.id', '=', 'tickets.user_id') + try + { + $user = \JWTAuth::parseToken()->authenticate(); + $inbox = $this->user->join('tickets', function ($join) + { + $join->on('users.id', '=', 'tickets.user_id') ->where('status', '=', 1); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') ->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id') ->join('ticket_status', 'ticket_status.id', '=', 'tickets.status') - ->join('ticket_thread', function ($join) { - $join->on('tickets.id', '=', 'ticket_thread.ticket_id') - ->whereNotNull('ticket_thread.title'); - }) - ->select(\DB::raw('max(ticket_thread.updated_at) as updated_at'), 'user_name', 'first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'ticket_thread.title', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name', 'department.id as department_id', 'users.primary_dpt as user_dpt') - ->where(function ($query) use ($user) { - if ($user->role != 'admin') { - $query->where('tickets.dept_id', '=', $user->primary_dpt); - } + ->leftJoin('ticket_thread', function ($join) + { + $join->on('tickets.id', '=', 'ticket_thread.ticket_id'); }) + ->leftJoin('ticket_attachment', 'ticket_attachment.thread_id', '=', 'ticket_thread.id') + ->where('ticket_status.name', 'Open'); + if ($user->role == 'agent') + { + $id = $user->id; + $dept = \DB::table('department_assign_agents')->where('agent_id', '=', $id)->pluck('department_id')->toArray(); + $inbox = $inbox->where(function ($query) use ($dept, $id) + { + $query->whereIn('tickets.dept_id', $dept) + ->orWhere('assigned_to', '=', $id); + }); + } + $inbox = $inbox->select(\DB::raw('max(ticket_thread.updated_at) as updated_at'), 'user_name', 'first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', \DB::raw('substring_index(group_concat(ticket_thread.title order by ticket_thread.id asc) , ",", 1) as title'), 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'ticket_priority.priority_color as priority_color', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name', 'department.id as department_id', 'users.primary_dpt as user_dpt', \DB::raw('count(ticket_attachment.id) as attachment'), 'tickets.duedate as overdue_date') ->orderBy('updated_at', 'desc') ->groupby('tickets.id') ->distinct() @@ -977,13 +1141,17 @@ class ApiController extends Controller ->toJson(); return $inbox; - } catch (\Exception $ex) { + } + catch (\Exception $ex) + { $error = $ex->getMessage(); - $line = $ex->getLine(); - $file = $ex->getFile(); + $line = $ex->getLine(); + $file = $ex->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -997,31 +1165,37 @@ class ApiController extends Controller */ public function internalNote() { - try { + try + { $v = \Validator::make($this->request->all(), [ 'userid' => 'required|exists:users,id', 'ticketid' => 'required|exists:tickets,id', 'body' => 'required', ]); - if ($v->fails()) { + if ($v->fails()) + { $error = $v->errors(); return response()->json(compact('error')); } - $userid = $this->request->input('userid'); + $userid = $this->request->input('userid'); $ticketid = $this->request->input('ticketid'); - $body = $this->request->input('body'); + $body = preg_replace('/[ ](?=[^>]*(?:<|$))/', ' ', nl2br($this->request->input('body'))); $thread = $this->thread->create(['ticket_id' => $ticketid, 'user_id' => $userid, 'is_internal' => 1, 'body' => $body]); return response()->json(compact('thread')); - } catch (\Exception $ex) { + } + catch (\Exception $ex) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -1030,27 +1204,35 @@ class ApiController extends Controller public function getTrash() { - try { - $user = \JWTAuth::parseToken()->authenticate(); - $trash = $this->user->join('tickets', function ($join) { - $join->on('users.id', '=', 'tickets.user_id') + try + { + $user = \JWTAuth::parseToken()->authenticate(); + $trash = $this->user->join('tickets', function ($join) + { + $join->on('users.id', '=', 'tickets.user_id') ->where('status', '=', 5); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') ->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id') ->join('ticket_status', 'ticket_status.id', '=', 'tickets.status') - ->join('ticket_thread', function ($join) { - $join->on('tickets.id', '=', 'ticket_thread.ticket_id') - ->whereNotNull('title'); - }) - ->select(\DB::raw('max(ticket_thread.updated_at) as updated_at'), 'user_name', 'first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'title', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name') - ->where(function ($query) use ($user) { - if ($user->role != 'admin') { - $query->where('tickets.dept_id', '=', $user->primary_dpt); - } + ->leftJoin('ticket_thread', function ($join) + { + $join->on('tickets.id', '=', 'ticket_thread.ticket_id'); }) + ->leftJoin('ticket_attachment', 'ticket_attachment.thread_id', '=', 'ticket_thread.id'); + if ($user->role == 'agent') + { + $id = $user->id; + $dept = \DB::table('department_assign_agents')->where('agent_id', '=', $id)->pluck('department_id')->toArray(); + $trash = $trash->where(function ($query) use ($dept, $id) + { + $query->whereIn('tickets.dept_id', $dept) + ->orWhere('assigned_to', '=', $id); + }); + } + $trash = $trash->select('ticket_priority.priority_color as priority_color', \DB::raw('substring_index(group_concat(ticket_thread.title order by ticket_thread.id asc) , ",", 1) as title'), 'tickets.duedate as overdue_date', \DB::raw('count(ticket_attachment.id) as attachment'), \DB::raw('max(ticket_thread.updated_at) as updated_at'), 'user_name', 'first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name') ->orderBy('updated_at', 'desc') ->groupby('tickets.id') ->distinct() @@ -1058,13 +1240,17 @@ class ApiController extends Controller ->toJson(); return $trash; - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -1073,43 +1259,46 @@ class ApiController extends Controller public function getMyTicketsAgent() { - try { + try + { $v = \Validator::make($this->request->all(), [ 'user_id' => 'required|exists:users,id', ]); - if ($v->fails()) { + if ($v->fails()) + { $error = $v->errors(); return response()->json(compact('error')); } $id = $this->request->input('user_id'); - if ($this->user->where('id', $id)->first()->role == 'user') { + if ($this->user->where('id', $id)->first()->role == 'user') + { $error = 'This user is not an Agent or Admin'; return response()->json(compact('error')); } //$user = \JWTAuth::parseToken()->authenticate(); - $result = $this->user->join('tickets', function ($join) use ($id) { - $join->on('users.id', '=', 'tickets.assigned_to') + $result = $this->user->join('tickets', function ($join) use ($id) + { + $join->on('users.id', '=', 'tickets.assigned_to') ->where('status', '=', 1); //->where('user_id', '=', $id); - }) + }) + ->join('users as client', 'tickets.user_id', '=', 'client.id') ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') ->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id') ->join('ticket_status', 'ticket_status.id', '=', 'tickets.status') - ->join('ticket_thread', function ($join) { - $join->on('tickets.id', '=', 'ticket_thread.ticket_id') - ->whereNotNull('title'); + ->leftJoin('ticket_thread', function ($join) + { + $join->on('tickets.id', '=', 'ticket_thread.ticket_id'); }) + ->leftJoin('ticket_attachment', 'ticket_attachment.thread_id', '=', 'ticket_thread.id') ->where('users.id', $id) - ->select(\DB::raw('max(ticket_thread.updated_at) as updated_at'), 'user_name', 'first_name', 'last_name', 'email', 'profile_pic', 'ticket_number', 'tickets.id', 'title', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name') -// ->where(function($query) use($user) { -// if ($user->role != 'admin') { -// $query->where('tickets.dept_id', '=', $user->primary_dpt); -// } -// }) + ->select( + 'ticket_priority.priority_color as priority_color', \DB::raw('substring_index(group_concat(ticket_thread.title order by ticket_thread.id asc) , ",", 1) as title'), 'tickets.duedate as overdue_date', \DB::raw('count(ticket_attachment.id) as attachment'), \DB::raw('max(ticket_thread.updated_at) as updated_at'), 'client.user_name', 'client.first_name', 'client.last_name', 'client.email', 'client.profile_pic', 'ticket_number', 'tickets.id', 'tickets.created_at', 'department.name as department_name', 'ticket_priority.priority as priotity_name', 'sla_plan.name as sla_plan_name', 'help_topic.topic as help_topic_name', 'ticket_status.name as ticket_status_name' + ) ->orderBy('updated_at', 'desc') ->groupby('tickets.id') ->distinct() @@ -1117,13 +1306,17 @@ class ApiController extends Controller ->toJson(); return $result; - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -1132,31 +1325,36 @@ class ApiController extends Controller public function getMyTicketsUser() { - try { + try + { $v = \Validator::make($this->request->all(), [ 'user_id' => 'required|exists:users,id', ]); - if ($v->fails()) { + if ($v->fails()) + { $error = $v->errors(); return response()->json(compact('error')); } $id = $this->request->input('user_id'); - if ($this->user->where('id', $id)->first()->role == 'admin' || $this->user->where('id', $id)->first()->role == 'agent') { + if ($this->user->where('id', $id)->first()->role == 'admin' || $this->user->where('id', $id)->first()->role == 'agent') + { $error = 'This is not a client'; return response()->json(compact('error')); } - $result = $this->user->join('tickets', function ($join) use ($id) { - $join->on('users.id', '=', 'tickets.user_id') + $result = $this->user->join('tickets', function ($join) use ($id) + { + $join->on('users.id', '=', 'tickets.user_id') ->where('user_id', '=', $id); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') ->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id') ->join('ticket_status', 'ticket_status.id', '=', 'tickets.status') - ->join('ticket_thread', function ($join) { + ->join('ticket_thread', function ($join) + { $join->on('tickets.id', '=', 'ticket_thread.ticket_id') ->whereNotNull('title'); }) @@ -1169,13 +1367,17 @@ class ApiController extends Controller ->toJson(); return $result; - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -1184,72 +1386,53 @@ class ApiController extends Controller public function getTicketById() { - try { + try + { $v = \Validator::make($this->request->all(), [ 'id' => 'required|exists:tickets,id', ]); - if ($v->fails()) { + if ($v->fails()) + { $error = $v->errors(); return response()->json(compact('error')); } $id = $this->request->input('id'); - if (!$this->model->where('id', $id)->first()) { - $error = 'There is no Ticket as ticket id: '.$id; + if (!$this->model->where('id', $id)->first()) + { + $error = 'There is no Ticket as ticket id: ' . $id; return response()->json(compact('error')); } - $query = $this->user->join('tickets', function ($join) use ($id) { + $query = $this->user->join('tickets', function ($join) use ($id) + { $join->on('users.id', '=', 'tickets.user_id') ->where('tickets.id', '=', $id); }); $response = $this->differenciateHelpTopic($query) - ->leftJoin('department', 'tickets.dept_id', '=', 'department.id') - ->leftJoin('ticket_priority', 'tickets.priority_id', '=', 'ticket_priority.priority_id') - ->leftJoin('ticket_status', 'tickets.status', '=', 'ticket_status.id') - ->leftJoin('sla_plan', 'tickets.sla', '=', 'sla_plan.id') - ->leftJoin('ticket_source', 'tickets.source', '=', 'ticket_source.id'); + ->leftJoin('department', 'tickets.dept_id', '=', 'department.id') + ->leftJoin('ticket_priority', 'tickets.priority_id', '=', 'ticket_priority.priority_id') + ->leftJoin('ticket_status', 'tickets.status', '=', 'ticket_status.id') + ->leftJoin('sla_plan', 'tickets.sla', '=', 'sla_plan.id') + ->leftJoin('ticket_source', 'tickets.source', '=', 'ticket_source.id'); //$select = 'users.email','users.user_name','users.first_name','users.last_name','tickets.id','ticket_number','num_sequence','user_id','priority_id','sla','max_open_ticket','captcha','status','lock_by','lock_at','source','isoverdue','reopened','isanswered','is_deleted', 'closed','is_transfer','transfer_at','reopened_at','duedate','closed_at','last_message_at'; $result = $response->addSelect( - 'users.email', - 'users.user_name', - 'users.first_name', - 'users.last_name', - 'tickets.id', - 'ticket_number', - 'user_id', - 'ticket_priority.priority_id', - 'ticket_priority.priority as priority_name', - 'department.name as dept_name', - 'ticket_status.name as status_name', - 'sla_plan.name as sla_name', - 'ticket_source.name as source_name', - 'sla_plan.id as sla', - 'ticket_status.id as status', - 'lock_by', - 'lock_at', - 'ticket_source.id as source', - 'isoverdue', - 'reopened', - 'isanswered', - 'is_deleted', - 'closed', - 'reopened_at', - 'duedate', - 'closed_at', - 'tickets.created_at', - 'tickets.updated_at')->first(); + 'users.email', 'users.user_name', 'users.first_name', 'users.last_name', 'tickets.id', 'ticket_number', 'user_id', 'ticket_priority.priority_id', 'ticket_priority.priority as priority_name', 'department.name as dept_name', 'ticket_status.name as status_name', 'sla_plan.name as sla_name', 'ticket_source.name as source_name', 'sla_plan.id as sla', 'ticket_status.id as status', 'lock_by', 'lock_at', 'ticket_source.id as source', 'isoverdue', 'reopened', 'isanswered', 'is_deleted', 'closed', 'reopened_at', 'duedate', 'closed_at', 'tickets.created_at', 'tickets.updated_at')->first(); return response()->json(compact('result')); - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -1258,7 +1441,8 @@ class ApiController extends Controller public function createPagination($array, $perPage) { - try { + try + { //Get current page form url e.g. &page=6 $currentPage = LengthAwarePaginator::resolveCurrentPage(); @@ -1272,13 +1456,17 @@ class ApiController extends Controller $paginatedResults = new LengthAwarePaginator($currentPageSearchResults, count($collection), $perPage); return $paginatedResults; - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (\TokenExpiredException $e) { + } + catch (\TokenExpiredException $e) + { $error = $e->getMessage(); return response()->json(compact('error')); @@ -1288,26 +1476,31 @@ class ApiController extends Controller public function collaboratorSearch() { $this->validate($this->request, ['term' => 'required']); - try { + try + { $emails = $this->ticket->autosearch(); //return $emails; - $user = new User(); - if (count($emails) > 0) { - foreach ($emails as $key => $email) { - $user_model = $user->where('email', $email)->first(); + $user = new User(); + if (count($emails) > 0) + { + foreach ($emails as $key => $email) + { + $user_model = $user->where('email', $email)->first(); //return $user_model; - $users[$key]['name'] = $user_model->first_name.' '.$user_model->last_name; - $users[$key]['email'] = $email; + $users[$key]['name'] = $user_model->first_name . ' ' . $user_model->last_name; + $users[$key]['email'] = $email; $users[$key]['avatar'] = $this->avatarUrl($email); } } //return $users; return response()->json(compact('users')); - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); } @@ -1315,17 +1508,23 @@ class ApiController extends Controller public function avatarUrl($email) { - try { + try + { $user = new User(); $user = $user->where('email', $email)->first(); - if ($user->profile_pic) { - $url = url('uploads/profilepic/'.$user->profile_pic); - } else { + if ($user->profile_pic) + { + $url = url('uploads/profilepic/' . $user->profile_pic); + } + else + { $url = \Gravatar::src($email); } return $url; - } catch (\Exception $ex) { + } + catch (\Exception $ex) + { //return $ex->getMessage(); throw new \Exception($ex->getMessage()); } @@ -1333,13 +1532,15 @@ class ApiController extends Controller public function addCollaboratorForTicket() { - try { + try + { $v = \Validator::make(\Input::get(), [ 'email' => 'required|email|unique:users', 'ticket_id' => 'required', ] ); - if ($v->fails()) { + if ($v->fails()) + { $error = $v->messages(); return response()->json(compact('error')); @@ -1347,16 +1548,20 @@ class ApiController extends Controller $collaborator = $this->ticket->useradd(); return response()->json(compact('collaborator')); - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (Tymon\JWTAuth\Exceptions\TokenExpiredException $ex) { + } + catch (Tymon\JWTAuth\Exceptions\TokenExpiredException $ex) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); } @@ -1364,12 +1569,14 @@ class ApiController extends Controller public function getCollaboratorForTicket() { - try { + try + { $v = \Validator::make(\Input::get(), [ 'ticket_id' => 'required', ] ); - if ($v->fails()) { + if ($v->fails()) + { $error = $v->messages(); return response()->json(compact('error')); @@ -1377,16 +1584,20 @@ class ApiController extends Controller $collaborator = $this->ticket->getCollaboratorForTicket(); return response()->json(compact('collaborator')); - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } catch (Tymon\JWTAuth\Exceptions\TokenExpiredException $ex) { + } + catch (Tymon\JWTAuth\Exceptions\TokenExpiredException $ex) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); } @@ -1394,13 +1605,15 @@ class ApiController extends Controller public function deleteCollaborator() { - try { + try + { $v = \Validator::make(\Input::get(), [ 'ticketid' => 'required', 'email' => 'required', ] ); - if ($v->fails()) { + if ($v->fails()) + { $result = $v->messages(); return response()->json(compact('result')); @@ -1408,10 +1621,12 @@ class ApiController extends Controller $collaborator = $this->ticket->userremove(); return response()->json(compact('collaborator')); - } catch (\Exception $ex) { + } + catch (\Exception $ex) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); } @@ -1419,23 +1634,26 @@ class ApiController extends Controller public function dependency() { - try { + try + { $department = $this->department->select('name', 'id')->get()->toArray(); - $sla = $this->slaPlan->select('name', 'id')->get()->toArray(); - $staff = $this->user->where('role', 'agent')->select('email', 'id')->get()->toArray(); - $team = $this->team->select('name', 'id')->get()->toArray(); - $priority = \DB::table('ticket_priority')->select('priority', 'priority_id')->get(); - $helptopic = $this->helptopic->select('topic', 'id')->get()->toArray(); - $status = \DB::table('ticket_status')->select('name', 'id')->get(); - $source = \DB::table('ticket_source')->select('name', 'id')->get(); - $result = ['departments' => $department, 'sla' => $sla, 'staffs' => $staff, 'teams' => $team, - 'priorities' => $priority, 'helptopics' => $helptopic, 'status' => $status, 'sources' => $source, ]; + $sla = $this->slaPlan->select('name', 'id')->get()->toArray(); + $staff = $this->user->where('role', 'agent')->select('email', 'id')->get()->toArray(); + $team = $this->team->select('name', 'id')->get()->toArray(); + $priority = \DB::table('ticket_priority')->select('priority', 'priority_id')->get(); + $helptopic = $this->helptopic->select('topic', 'id')->get()->toArray(); + $status = \DB::table('ticket_status')->select('name', 'id')->get(); + $source = \DB::table('ticket_source')->select('name', 'id')->get(); + $result = ['departments' => $department, 'sla' => $sla, 'staffs' => $staff, 'teams' => $team, + 'priorities' => $priority, 'helptopics' => $helptopic, 'status' => $status, 'sources' => $source,]; return response()->json(compact('result')); - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); } @@ -1444,15 +1662,19 @@ class ApiController extends Controller public function differenciateHelpTopic($query) { $ticket = $query->first(); - $check = 'department'; - if ($ticket) { - if ($ticket->dept_id && $ticket->help_topic_id) { + $check = 'department'; + if ($ticket) + { + if ($ticket->dept_id && $ticket->help_topic_id) + { return $this->getSystem($check, $query); } - if (!$ticket->dept_id && $ticket->help_topic_id) { + if (!$ticket->dept_id && $ticket->help_topic_id) + { return $query->select('tickets.help_topic_id'); } - if ($ticket->dept_id && !$ticket->help_topic_id) { + if ($ticket->dept_id && !$ticket->help_topic_id) + { return $query->select('tickets.dept_id'); } } @@ -1462,7 +1684,8 @@ class ApiController extends Controller public function getSystem($check, $query) { - switch ($check) { + switch ($check) + { case 'department': return $query->select('tickets.dept_id'); case 'helpTopic': @@ -1481,36 +1704,94 @@ class ApiController extends Controller */ public function register(Request $request) { - try { + try + { $v = \Validator::make($request->all(), [ 'email' => 'required|email|unique:users', 'password' => 'required|min:6', ]); - if ($v->fails()) { + if ($v->fails()) + { $error = $v->errors(); return response()->json(compact('error')); } - $auth = $this->user; - $email = $request->input('email'); + $auth = $this->user; + $email = $request->input('email'); $username = $request->input('email'); $password = \Hash::make($request->input('password')); - $role = $request->input('role'); - if ($auth->role == 'agent') { + $role = $request->input('role'); + if ($auth->role == 'agent') + { $role = 'user'; } - $user = new User(); - $user->password = $password; + $user = new User(); + $user->password = $password; $user->user_name = $username; - $user->email = $email; - $user->role = $role; + $user->email = $email; + $user->role = $role; $user->save(); return response()->json(compact('user')); - } catch (\Exception $e) { + } + catch (\Exception $e) + { $error = $e->getMessage(); return response()->json(compact('error')); } } + + public function createUser() + { + try + { + $v = \Validator::make( + $this->request->all(), [ + 'username' => 'required|unique:users,user_name', + 'first_name' => 'required', + ] + ); + if ($v->fails()) + { + $error = $v->messages(); + return response()->json(compact('error')); + } + $str = str_random(8); + $array = ['password' => $str, 'password_confirmation' => $str, 'email' => $this->request->input('email'), 'full_name' => $this->request->input('first_name')]; + $all = $this->request->input(); + $merged = $array + $all; + $request = new \App\Http\Requests\helpdesk\RegisterRequest(); + $request->replace($merged); + if ($request->has('username')) + { + $request->merge(['user_name' => $request->get('username')]); + } + \Route::dispatch($request); + $auth = new \App\Http\Controllers\Auth\AuthController(); + $user = new User(); + $register = $auth->postRegister($user, $request, true); + if ($register) + { + return response()->json(compact('register')); + } + } + catch (\Exception $e) + { + $error = $e->getMessage(); + $line = $e->getLine(); + $file = $e->getFile(); + + return response()->json(compact('error', 'file', 'line')); + } + catch (Tymon\JWTAuth\Exceptions\TokenExpiredException $e) + { + $error = $e->getMessage(); + $line = $e->getLine(); + $file = $e->getFile(); + + return response()->json(compact('error', 'file', 'line')); + } + } + } diff --git a/app/Http/Controllers/Api/v1/TicketController.php b/app/Http/Controllers/Api/v1/TicketController.php index b9e3bfc30..24c5281f5 100644 --- a/app/Http/Controllers/Api/v1/TicketController.php +++ b/app/Http/Controllers/Api/v1/TicketController.php @@ -32,6 +32,7 @@ use Mail; */ class TicketController extends Controller { + /** * Create a new controller instance. * @@ -39,7 +40,7 @@ class TicketController extends Controller */ public function __construct() { - $PhpMailController = new PhpMailController(); + $PhpMailController = new PhpMailController(); $this->PhpMailController = $PhpMailController; } @@ -57,42 +58,51 @@ class TicketController extends Controller */ public function createTicket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data, $attach = '') { - try { + try + { //return $headers; $max_number = Tickets::whereRaw('id = (select max(`id`) from tickets)')->first(); //dd($max_number); - if ($max_number == null) { + if ($max_number == null) + { $ticket_number = 'AAAA-9999-9999999'; - } else { - foreach ($max_number as $number) { + } + else + { + foreach ($max_number as $number) + { $ticket_number = $max_number->ticket_number; } } - $ticket = new Tickets(); + $ticket = new Tickets(); $ticket->ticket_number = $this->ticketNumber($ticket_number); //dd($this->ticketNumber($ticket_number)); - $ticket->user_id = $user_id; - $ticket->dept_id = $dept; + $ticket->user_id = $user_id; + $ticket->dept_id = $dept; $ticket->help_topic_id = $helptopic; - $ticket->sla = $sla; - $ticket->assigned_to = $assignto; - $ticket->status = '1'; - $ticket->priority_id = $priority; - $ticket->source = $source; + $ticket->sla = $sla; + $ticket->assigned_to = $assignto; + $ticket->status = '1'; + $ticket->priority_id = $priority; + $ticket->source = $source; $ticket->save(); //dd($ticket); - $ticket_number = $ticket->ticket_number; - $id = $ticket->id; - if ($form_data != null) { + $ticket_number = $ticket->ticket_number; + $id = $ticket->id; + if ($form_data != null) + { $help_topic = Help_topic::where('id', '=', $helptopic)->first(); - $forms = Fields::where('forms_id', '=', $help_topic->custom_form)->get(); - foreach ($form_data as $key => $form_details) { - foreach ($forms as $from) { - if ($from->name == $key) { - $form_value = new Ticket_Form_Data(); + $forms = Fields::where('forms_id', '=', $help_topic->custom_form)->get(); + foreach ($form_data as $key => $form_details) + { + foreach ($forms as $from) + { + if ($from->name == $key) + { + $form_value = new Ticket_Form_Data(); $form_value->ticket_id = $id; - $form_value->title = $from->label; - $form_value->content = $form_details; + $form_value->title = $from->label; + $form_value->content = $form_details; $form_value->save(); } } @@ -102,12 +112,15 @@ class TicketController extends Controller $this->storeCollaborators($headers, $id); $thread = $this->ticketThread($subject, $body, $id, $user_id); - if (!empty($attach)) { + if (!empty($attach)) + { $this->attach($thread, $attach); } return $thread; - } catch (\Exception $e) { + } + catch (\Exception $e) + { return $e->getMessage(); } } @@ -121,44 +134,52 @@ class TicketController extends Controller */ public function storeCollaborators($headers, $id) { - try { + try + { //return $headers; $company = $this->company(); - if (isset($headers)) { - foreach ($headers as $email) { - $name = $email; + if (isset($headers)) + { + foreach ($headers as $email) + { + $name = $email; $email = $email; - if ($this->checkEmail($email) == false) { - $create_user = new User(); + if ($this->checkEmail($email) == false) + { + $create_user = new User(); $create_user->user_name = $name; - $create_user->email = $email; - $create_user->active = 1; - $create_user->role = 'user'; - $password = $this->generateRandomString(); - $create_user->password = Hash::make($password); + $create_user->email = $email; + $create_user->active = 1; + $create_user->role = 'user'; + $password = $this->generateRandomString(); + $create_user->password = Hash::make($password); $create_user->save(); - $user_id = $create_user->id; + $user_id = $create_user->id; // Mail::send('emails.pass', ['password' => $password, 'name' => $name, 'from' => $company, 'emailadd' => $email], function ($message) use ($email, $name) { // $message->to($email, $name)->subject('password'); // }); - $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]); - } else { - $user = $this->checkEmail($email); + $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]); + } + else + { + $user = $this->checkEmail($email); $user_id = $user->id; } //return $user_id; - $collaborator_store = new Ticket_Collaborator(); - $collaborator_store->isactive = 1; + $collaborator_store = new Ticket_Collaborator(); + $collaborator_store->isactive = 1; $collaborator_store->ticket_id = $id; - $collaborator_store->user_id = $user_id; - $collaborator_store->role = 'ccc'; + $collaborator_store->user_id = $user_id; + $collaborator_store->role = 'ccc'; $collaborator_store->save(); } } return true; - } catch (\Exception $e) { + } + catch (\Exception $e) + { return $e->getMessage(); } } @@ -175,17 +196,20 @@ class TicketController extends Controller */ public function ticketThread($subject, $body, $id, $user_id) { - try { - $thread = new Ticket_Thread(); - $thread->user_id = $user_id; + try + { + $thread = new Ticket_Thread(); + $thread->user_id = $user_id; $thread->ticket_id = $id; - $thread->poster = 'client'; - $thread->title = $subject; - $thread->body = $body; + $thread->poster = 'client'; + $thread->title = $subject; + $thread->body = $body; $thread->save(); return $thread->id; - } catch (\Exception $e) { + } + catch (\Exception $e) + { return $e->getMessage(); } } @@ -199,20 +223,24 @@ class TicketController extends Controller */ public function ticketNumber($ticket_number) { - try { + try + { //dd($ticket_number); - $number = $ticket_number; - $number = explode('-', $number); + $number = $ticket_number; + $number = explode('-', $number); $number1 = $number[0]; - if ($number1 == 'ZZZZ') { + if ($number1 == 'ZZZZ') + { $number1 = 'AAAA'; } $number2 = $number[1]; - if ($number2 == '9999') { + if ($number2 == '9999') + { $number2 = '0000'; } $number3 = $number[2]; - if ($number3 == '9999999') { + if ($number3 == '9999999') + { $number3 = '0000000'; } $number1++; @@ -220,11 +248,13 @@ class TicketController extends Controller $number3++; $number2 = sprintf('%04s', $number2); $number3 = sprintf('%07s', $number3); - $array = [$number1, $number2, $number3]; - $number = implode('-', $array); + $array = [$number1, $number2, $number3]; + $number = implode('-', $array); return $number; - } catch (\Exception $e) { + } + catch (\Exception $e) + { dd($e); return $e->getMessage(); @@ -240,16 +270,20 @@ class TicketController extends Controller */ public function generateRandomString($length = 10) { - try { - $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + try + { + $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); - $randomString = ''; - for ($i = 0; $i < $length; $i++) { + $randomString = ''; + for ($i = 0; $i < $length; $i++) + { $randomString .= $characters[rand(0, $charactersLength - 1)]; } return $randomString; - } catch (\Exception $e) { + } + catch (\Exception $e) + { return $e->getMessage(); } } @@ -264,64 +298,71 @@ class TicketController extends Controller */ public function reply($thread, $request, $ta, $attach = '') { - try { + try + { $check_attachment = null; - $eventthread = $thread->where('ticket_id', $request->input('ticket_ID'))->first(); + $eventthread = $thread->where('ticket_id', $request->input('ticket_ID'))->first(); //dd($request->input('ticket_ID')); //dd($eventthread); - $eventuserid = $eventthread->user_id; - $emailadd = User::where('id', $eventuserid)->first()->email; + $eventuserid = $eventthread->user_id; + $emailadd = User::where('id', $eventuserid)->first()->email; //dd($emailadd); - $source = $eventthread->source; + $source = $eventthread->source; - $form_data = $request->except('reply_content', 'ticket_ID', 'attachment'); + $form_data = $request->except('reply_content', 'ticket_ID', 'attachment'); \Event::fire(new \App\Events\ClientTicketFormPost($form_data, $emailadd, $source)); //dd('yes'); - $reply_content = $request->input('reply_content'); - $thread->ticket_id = $request->input('ticket_ID'); - $thread->poster = 'support'; - $thread->body = $request->input('reply_content'); - $thread->user_id = Auth::user()->id; - $ticket_id = $request->input('ticket_ID'); - $tickets = Tickets::where('id', '=', $ticket_id)->first(); + $reply_content = $request->input('reply_content'); + $thread->ticket_id = $request->input('ticket_ID'); + $thread->poster = 'support'; + $thread->body = $request->input('reply_content'); + $thread->user_id = Auth::user()->id; + $ticket_id = $request->input('ticket_ID'); + $tickets = Tickets::where('id', '=', $ticket_id)->first(); $tickets->isanswered = '1'; $tickets->save(); $ticket_user = User::where('id', '=', $tickets->user_id)->first(); - if ($tickets->assigned_to == 0) { + if ($tickets->assigned_to == 0) + { $tickets->assigned_to = Auth::user()->id; $tickets->save(); - $thread2 = new Ticket_Thread(); - $thread2->ticket_id = $thread->ticket_id; - $thread2->user_id = Auth::user()->id; + $thread2 = new Ticket_Thread(); + $thread2->ticket_id = $thread->ticket_id; + $thread2->user_id = Auth::user()->id; $thread2->is_internal = 1; - $thread2->body = 'This Ticket have been assigned to '.Auth::user()->first_name.' '.Auth::user()->last_name; + $thread2->body = 'This Ticket have been assigned to ' . Auth::user()->first_name . ' ' . Auth::user()->last_name; $thread2->save(); } - if ($tickets->status > 1) { - $tickets->status = '1'; + if ($tickets->status > 1) + { + $tickets->status = '1'; $tickets->isanswered = '1'; $tickets->save(); } $thread->save(); - if (!empty($attach)) { + if (!empty($attach)) + { $check_attachment = $this->attach($thread->id, $attach); } - $thread1 = Ticket_Thread::where('ticket_id', '=', $ticket_id)->first(); + $thread1 = Ticket_Thread::where('ticket_id', '=', $ticket_id)->first(); $ticket_subject = $thread1->title; - $user_id = $tickets->user_id; - $user = User::where('id', '=', $user_id)->first(); - $email = $user->email; - $user_name = $user->user_name; - $ticket_number = $tickets->ticket_number; - $company = $this->company(); - $username = $ticket_user->user_name; - if (!empty(Auth::user()->agent_sign)) { + $user_id = $tickets->user_id; + $user = User::where('id', '=', $user_id)->first(); + $email = $user->email; + $user_name = $user->user_name; + $ticket_number = $tickets->ticket_number; + $company = $this->company(); + $username = $ticket_user->user_name; + if (!empty(Auth::user()->agent_sign)) + { $agentsign = Auth::user()->agent_sign; - } else { + } + else + { $agentsign = null; } \Event::fire(new \App\Events\FaveoAfterReply($reply_content, $user->phone_number, $request, $tickets)); @@ -341,23 +382,30 @@ class TicketController extends Controller * Getting the subject of the thread */ //dd($eventthread); - try { - $re = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $tickets->dept_id), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => $eventthread->title, 'scenario' => 'create-ticket-by-agent', 'body' => $thread->body], $template_variables = ['agent_sign' => Auth::user()->agent_sign, 'ticket_number' => $tickets->number]); + try + { + $re = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $tickets->dept_id), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => $eventthread->title, 'scenario' => 'create-ticket-by-agent', 'body' => $thread->body], $template_variables = ['agent_sign' => Auth::user()->agent_sign, 'ticket_number' => $tickets->number]); //dd($re); - } catch (\Exception $e) { - throw new \Exception($e->getMessage()); + } + catch (\Exception $e) + { + //throw new \Exception($e->getMessage()); } $collaborators = Ticket_Collaborator::where('ticket_id', '=', $ticket_id)->get(); - foreach ($collaborators as $collaborator) { + foreach ($collaborators as $collaborator) + { //mail to collaborators $collab_user_id = $collaborator->user_id; $user_id_collab = User::where('id', '=', $collab_user_id)->first(); - $collab_email = $user_id_collab->email; - if ($user_id_collab->role == 'user') { + $collab_email = $user_id_collab->email; + if ($user_id_collab->role == 'user') + { $collab_user_name = $user_id_collab->user_name; - } else { - $collab_user_name = $user_id_collab->first_name.' '.$user_id_collab->last_name; + } + else + { + $collab_user_name = $user_id_collab->first_name . ' ' . $user_id_collab->last_name; } // Mail::send('emails.ticket_re-reply', ['content' => $reply_content, 'ticket_number' => $ticket_number, 'From' => $company, 'name' => $collab_user_name, 'Agent_Signature' => $agentsign], function ($message) use ($collab_email, $collab_user_name, $ticket_number, $ticket_subject, $check_attachment) { // $message->to($collab_email, $collab_user_name)->subject($ticket_subject . '[#' . $ticket_number . ']'); @@ -369,14 +417,20 @@ class TicketController extends Controller // // } // }, true); - try { - $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['user' => $admin_user, 'email' => $admin_email], $message = ['subject' => $updated_subject, 'body' => $body, 'scenario' => $mail], $template_variables = ['ticket_agent_name' => $admin_user, 'ticket_client_name' => $username, 'ticket_client_email' => $emailadd, 'user' => $admin_user, 'ticket_number' => $ticket_number2, 'email_address' => $emailadd, 'name' => $ticket_creator]); - } catch (\Exception $e) { + try + { + $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['user' => $admin_user, 'email' => $admin_email], $message = ['subject' => $updated_subject, 'body' => $body, 'scenario' => $mail], $template_variables = ['ticket_agent_name' => $admin_user, 'ticket_client_name' => $username, 'ticket_client_email' => $emailadd, 'user' => $admin_user, 'ticket_number' => $ticket_number2, 'email_address' => $emailadd, 'name' => $ticket_creator]); + } + catch (\Exception $e) + { + } } return $thread; - } catch (\Exception $e) { + } + catch (\Exception $e) + { //dd($e); return $e->getMessage(); } @@ -389,16 +443,22 @@ class TicketController extends Controller */ public function company() { - try { + try + { $company = Company::Where('id', '=', '1')->first(); - if ($company->company_name == null) { + if ($company->company_name == null) + { $company = 'Support Center'; - } else { + } + else + { $company = $company->company_name; } return $company; - } catch (\Exception $e) { + } + catch (\Exception $e) + { return $e->getMessage(); } } @@ -413,24 +473,28 @@ class TicketController extends Controller */ public function ticketEditPost($ticket_id, $thread, $ticket) { - try { + try + { $ticket = $ticket->where('id', '=', $ticket_id)->first(); - $ticket->sla = Input::get('sla_plan'); + $ticket->sla = Input::get('sla_plan'); $ticket->help_topic_id = Input::get('help_topic'); - $ticket->source = Input::get('ticket_source'); - $ticket->priority_id = Input::get('ticket_priority'); - $ticket->status = Input::get('status'); + $ticket->source = Input::get('ticket_source'); + $ticket->priority_id = Input::get('ticket_priority'); + $ticket->status = Input::get('status'); $ticket->save(); - $threads = $thread->where('ticket_id', '=', $ticket_id)->first(); + $threads = $thread->where('ticket_id', '=', $ticket_id)->first(); $threads->title = Input::get('subject'); $threads->save(); - - return $threads; - } catch (\Exception $e) { - return $e->getMessage(); } + catch (\Exception $ex) + { + $result = $ex->getMessage(); + return response()->json(compact('result'), 500); + } + $result = ["success" => "Edited successfully"]; + return response()->json(compact('result')); } /** @@ -442,56 +506,66 @@ class TicketController extends Controller */ public function assign($id) { - try { + try + { $UserEmail = Input::get('user'); //dd($UserEmail); // $UserEmail = 'sujitprasad12@yahoo.in'; - $user = User::where('email', '=', $UserEmail)->first(); - if (!$user) { + $user = User::where('email', '=', $UserEmail)->first(); + if (!$user) + { return ['error' => 'No agent not found']; } $user_id = $user->id; - $ticket = Tickets::where('id', '=', $id)->first(); - if (!$ticket) { + $ticket = Tickets::where('id', '=', $id)->first(); + if (!$ticket) + { return ['error' => 'No ticket not found']; } - $ticket_number = $ticket->ticket_number; + $ticket_number = $ticket->ticket_number; $ticket->assigned_to = $user_id; $ticket->save(); - $ticket_thread = Ticket_Thread::where('ticket_id', '=', $id)->first(); - if (!$ticket_thread) { + $ticket_thread = Ticket_Thread::where('ticket_id', '=', $id)->first(); + if (!$ticket_thread) + { return ['error' => 'No thread not found']; } - $ticket_subject = $ticket_thread->title; - $thread = new Ticket_Thread(); - $thread->ticket_id = $ticket->id; - $thread->user_id = Auth::user()->id; + $ticket_subject = $ticket_thread->title; + $thread = new Ticket_Thread(); + $thread->ticket_id = $ticket->id; + $thread->user_id = Auth::user()->id; $thread->is_internal = 1; - $thread->body = 'This Ticket has been assigned to '.$user->first_name.' '.$user->last_name; + $thread->body = 'This Ticket has been assigned to ' . $user->first_name . ' ' . $user->last_name; $thread->save(); $company = $this->company(); - $system = $this->system(); + $system = $this->system(); - $agent = $user->first_name; + $agent = $user->first_name; $agent_email = $user->email; - $master = Auth::user()->first_name.' '.Auth::user()->last_name; - if (Alert::first()->internal_status == 1 || Alert::first()->internal_assigned_agent == 1) { + $master = Auth::user()->first_name . ' ' . Auth::user()->last_name; + if (Alert::first()->internal_status == 1 || Alert::first()->internal_assigned_agent == 1) + { // // ticket assigned send mail // Mail::send('emails.Ticket_assign', ['agent' => $agent, 'ticket_number' => $ticket_number, 'from' => $company, 'master' => $master, 'system' => $system], function ($message) use ($agent_email, $agent, $ticket_number, $ticket_subject) { // $message->to($agent_email, $agent)->subject($ticket_subject . '[#' . $ticket_number . ']'); // }); - try { - $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticket->dept_id), $to = ['name' => $agent, 'email' => $agent_email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'assign-ticket'], $template_variables = ['ticket_agent_name' => $agent, 'ticket_number' => $ticket_number, 'ticket_assigner' => $master]); - } catch (\Exception $e) { + try + { + $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticket->dept_id), $to = ['name' => $agent, 'email' => $agent_email], $message = ['subject' => $ticket_subject . '[#' . $ticket_number . ']', 'scenario' => 'assign-ticket'], $template_variables = ['ticket_agent_name' => $agent, 'ticket_number' => $ticket_number, 'ticket_assigner' => $master]); + } + catch (\Exception $e) + { return 0; } } return 1; - } catch (\Exception $e) { + } + catch (\Exception $e) + { return $e->getMessage(); } } @@ -506,47 +580,63 @@ class TicketController extends Controller */ public function delete($ids, $ticket) { - try { - foreach ($ids as $id) { + try + { + foreach ($ids as $id) + { $ticket_delete = $ticket->where('id', '=', $id)->first(); - if ($ticket_delete) { - if ($ticket_delete->status == 5) { + if ($ticket_delete) + { + if ($ticket_delete->status == 5) + { $ticket_delete->delete(); $ticket_threads = Ticket_Thread::where('ticket_id', '=', $id)->get(); - if ($ticket_threads) { - foreach ($ticket_threads as $ticket_thread) { - if ($ticket_thread) { + if ($ticket_threads) + { + foreach ($ticket_threads as $ticket_thread) + { + if ($ticket_thread) + { $ticket_thread->delete(); } } } $ticket_attachments = Ticket_attachments::where('thread_id', '=', $id)->get(); - if ($ticket_attachments) { - foreach ($ticket_attachments as $ticket_attachment) { - if ($ticket_attachment) { + if ($ticket_attachments) + { + foreach ($ticket_attachments as $ticket_attachment) + { + if ($ticket_attachment) + { $ticket_attachment->delete(); } } } - } else { + } + else + { $ticket_delete->is_deleted = 0; - $ticket_delete->status = 5; + $ticket_delete->status = 5; $ticket_delete->save(); - $ticket_status_message = Ticket_Status::where('id', '=', $ticket_delete->status)->first(); - $thread = new Ticket_Thread(); - $thread->ticket_id = $ticket_delete->id; - $thread->user_id = Auth::user()->id; - $thread->is_internal = 1; - $thread->body = $ticket_status_message->message.' '.Auth::user()->first_name.' '.Auth::user()->last_name; + $ticket_status_message = Ticket_Status::where('id', '=', $ticket_delete->status)->first(); + $thread = new Ticket_Thread(); + $thread->ticket_id = $ticket_delete->id; + $thread->user_id = Auth::user()->id; + $thread->is_internal = 1; + $thread->body = $ticket_status_message->message . ' ' . Auth::user()->first_name . ' ' . Auth::user()->last_name; $thread->save(); } - } else { + } + else + { return 'ticket not found'; } } return 'your tickets has been deleted'; - } catch (\Exception $e) { + } + catch (\Exception $e) + { return $e->getMessage(); } } @@ -560,14 +650,20 @@ class TicketController extends Controller */ public function checkEmail($email) { - try { + try + { $check = User::where('email', '=', $email)->first(); - if ($check) { + if ($check) + { return $check; - } else { + } + else + { return false; } - } catch (\Exception $e) { + } + catch (\Exception $e) + { return $e->getMessage(); } } @@ -579,16 +675,22 @@ class TicketController extends Controller */ public function system() { - try { + try + { $system = System::Where('id', '=', '1')->first(); - if ($system->name == null) { + if ($system->name == null) + { $system = 'Support Center'; - } else { + } + else + { $system = $system->name; } return $system; - } catch (\Exception $e) { + } + catch (\Exception $e) + { return $e->getMessage(); } } @@ -603,15 +705,19 @@ class TicketController extends Controller */ public function attach($thread, $attach) { - try { + try + { $ta = new Ticket_attachments(); - foreach ($attach as $file) { + foreach ($attach as $file) + { $ta->create(['thread_id' => $thread, 'name' => $file['name'], 'size' => $file['size'], 'type' => $file['type'], 'file' => $file['file'], 'poster' => 'ATTACHMENT']); } $ta->create(['thread_id' => $thread, 'name' => $name, 'size' => $size, 'type' => $type, 'file' => $file, 'poster' => 'ATTACHMENT']); return 1; - } catch (\Exception $e) { + } + catch (\Exception $e) + { return $e->getMessage(); } } @@ -624,7 +730,7 @@ class TicketController extends Controller public function autosearch() { $term = \Input::get('term'); - $user = \App\User::where('email', 'LIKE', '%'.$term.'%')->orWhere('first_name', 'LIKE', '%'.$term.'%')->orWhere('last_name', 'LIKE', '%'.$term.'%')->orWhere('user_name', 'LIKE', '%'.$term.'%')->lists('email'); + $user = \App\User::where('email', 'LIKE', '%' . $term . '%')->orWhere('first_name', 'LIKE', '%' . $term . '%')->orWhere('last_name', 'LIKE', '%' . $term . '%')->orWhere('user_name', 'LIKE', '%' . $term . '%')->lists('email'); return $user; } @@ -638,26 +744,27 @@ class TicketController extends Controller */ public function useradd() { - $email = Input::get('email'); - $ticket_id = Input::get('ticket_id'); - $company = $this->company(); - $user = new User(); + $email = Input::get('email'); + $ticket_id = Input::get('ticket_id'); + $company = $this->company(); + $user = new User(); $user->user_name = $email; - $user->email = $email; - $password = $this->generateRandomString(); - $user->password = \Hash::make($password); - $user->role = 'user'; - $user->active = 1; - if ($user->save()) { - $user_id = $user->id; - $php_mailer = new PhpMailController(); - $php_mailer->sendmail($from = $php_mailer->mailfrom('1', '0'), $to = ['name' => $email, 'email' => $email], $message = ['subject' => 'Password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $email, 'email_address' => $email, 'user_password' => $password]); + $user->email = $email; + $password = $this->generateRandomString(); + $user->password = \Hash::make($password); + $user->role = 'user'; + $user->active = 1; + if ($user->save()) + { + $user_id = $user->id; + $php_mailer = new PhpMailController(); + $php_mailer->sendmail($from = $php_mailer->mailfrom('1', '0'), $to = ['name' => $email, 'email' => $email], $message = ['subject' => 'Password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $email, 'email_address' => $email, 'user_password' => $password]); } - $ticket_collaborator = new Ticket_Collaborator(); - $ticket_collaborator->isactive = 1; + $ticket_collaborator = new Ticket_Collaborator(); + $ticket_collaborator->isactive = 1; $ticket_collaborator->ticket_id = $ticket_id; - $ticket_collaborator->user_id = $user->id; - $ticket_collaborator->role = 'ccc'; + $ticket_collaborator->user_id = $user->id; + $ticket_collaborator->role = 'ccc'; $ticket_collaborator->save(); $result = [$user->user_name => $user->email]; @@ -672,46 +779,57 @@ class TicketController extends Controller */ public function userremove() { - $email = Input::get('email'); - $ticketid = Input::get('ticketid'); - $user = new User(); - $user = $user->where('email', $email)->first(); + $email = Input::get('email'); + $ticketid = Input::get('ticketid'); + $user = new User(); + $user = $user->where('email', $email)->first(); $ticket_collaborator = Ticket_Collaborator::where('ticket_id', '=', $ticketid) ->where('user_id', $user->id) ->first(); - if ($ticket_collaborator) { + if ($ticket_collaborator) + { $ticket_collaborator->delete(); return 'deleted successfully'; - } else { + } + else + { return 'not found'; } } public function getCollaboratorForTicket() { - try { + try + { $ticketid = Input::get('ticket_id'); $ticket_collaborator = \DB::table('users') - ->join('ticket_collaborator', function ($join) use ($ticketid) { + ->join('ticket_collaborator', function ($join) use ($ticketid) + { $join->on('users.id', '=', 'ticket_collaborator.user_id') ->where('ticket_collaborator.ticket_id', '=', $ticketid); }) ->select('users.email', 'users.user_name') ->get(); - if (count($ticket_collaborator) > 0) { - foreach ($ticket_collaborator as $key => $collaborator) { - $collab[$key]['email'] = $collaborator->email; + if (count($ticket_collaborator) > 0) + { + foreach ($ticket_collaborator as $key => $collaborator) + { + $collab[$key]['email'] = $collaborator->email; $collab[$key]['user_name'] = $collaborator->user_name; - $collab[$key]['avatar'] = $this->avatarUrl($collaborator->email); + $collab[$key]['avatar'] = $this->avatarUrl($collaborator->email); } - } else { + } + else + { $collab = $ticket_collaborator; } return $collab; - } catch (\Exception $ex) { + } + catch (\Exception $ex) + { return $ex->getMessage(); throw new \Exception('get collaborator for ticket fails'); } @@ -719,19 +837,26 @@ class TicketController extends Controller public function avatarUrl($email) { - try { + try + { $user = new User(); $user = $user->where('email', $email)->first(); - if ($user->profile_pic) { - $url = url('uploads/profilepic/'.$user->profile_pic); - } else { + if ($user->profile_pic) + { + $url = url('uploads/profilepic/' . $user->profile_pic); + } + else + { $url = \Gravatar::src($email); } return $url; - } catch (\Exception $ex) { + } + catch (\Exception $ex) + { //return $ex->getMessage(); throw new \Exception($ex->getMessage()); } } + } diff --git a/app/Http/Controllers/Api/v1/TokenAuthController.php b/app/Http/Controllers/Api/v1/TokenAuthController.php index f08d0346d..f5c38b722 100644 --- a/app/Http/Controllers/Api/v1/TokenAuthController.php +++ b/app/Http/Controllers/Api/v1/TokenAuthController.php @@ -61,7 +61,7 @@ class TokenAuthController extends Controller return response()->json(compact('error')); } - $user_id = \Auth::user()->id; + $user_id = \Auth::user(); // if no errors are encountered we can return a JWT return response()->json(compact('token', 'user_id')); } diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index f6f00dba7..cbba80e92 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -36,18 +36,19 @@ use Socialite; * * @author Ladybird */ -class AuthController extends Controller { +class AuthController extends Controller +{ use AuthenticatesAndRegistersUsers; /* to redirect after login */ // if auth is agent - protected $redirectTo = '/dashboard'; + protected $redirectTo = '/dashboard'; // if auth is user - protected $redirectToUser = '/profile'; + protected $redirectToUser = '/profile'; /* Direct After Logout */ protected $redirectAfterLogout = '/'; - protected $loginPath = '/auth/login'; + protected $loginPath = '/auth/login'; protected $social; /** @@ -58,14 +59,18 @@ class AuthController extends Controller { * * @return void */ - public function __construct(PhpMailController $PhpMailController, SocialMediaController $social) { - $this->PhpMailController = $PhpMailController; + public function __construct() + { + $this->PhpMailController = new PhpMailController(); + $social = new SocialMediaController(); $social->configService(); $this->middleware('guest', ['except' => ['getLogout', 'verifyOTP', 'redirectToProvider']]); } - public function redirectToProvider($provider, $redirect = '') { - if ($redirect !== '') { + public function redirectToProvider($provider, $redirect = '') + { + if ($redirect !== '') + { $this->setSession($provider, $redirect); } //dd(\Config::get('services')); @@ -74,41 +79,50 @@ class AuthController extends Controller { return $s; } - public function handleProviderCallback($provider) { - try { + public function handleProviderCallback($provider) + { + try + { //notice we are not doing any validation, you should do it $this->changeRedirect(); $user = Socialite::driver($provider)->user(); - if ($user) { + if ($user) + { // stroing data to our use table and logging them in - $username = $user->getEmail(); + $username = $user->getEmail(); $first_name = $user->getName(); - if ($user->nickname) { + if ($user->nickname) + { $username = $user->nickname; } - if (!$first_name) { + if (!$first_name) + { $first_name = $username; } $data = [ 'first_name' => $first_name, - 'email' => $user->getEmail(), - 'user_name' => $username, - 'role' => 'user', - 'active' => 1, + 'email' => $user->getEmail(), + 'user_name' => $username, + 'role' => 'user', + 'active' => 1, ]; $user = User::where('email', $data['email'])->first(); - if (!$user) { + if (!$user) + { $user = User::where('user_name', $data['user_name'])->first(); } - if (!$user) { + if (!$user) + { $user = User::firstOrCreate($data); } Auth::login($user); } //after login redirecting to home page return redirect('/'); - } catch (\Exception $ex) { + } + catch (\Exception $ex) + { return redirect()->back()->with('fails', $ex->getMessage()); } } @@ -118,19 +132,26 @@ class AuthController extends Controller { * * @return type Response */ - public function getRegister(CommonSettings $settings) { + public function getRegister(CommonSettings $settings) + { // Event for login - $settings = $settings->select('status')->where('option_name', '=', 'send_otp')->first(); + $settings = $settings->select('status')->where('option_name', '=', 'send_otp')->first(); $email_mandatory = $settings->select('status')->where('option_name', '=', 'email_mandatory')->first(); //dd($settings->status); \Event::fire(new \App\Events\FormRegisterEvent()); - if (Auth::user()) { - if (Auth::user()->role == 'admin' || Auth::user()->role == 'agent') { + if (Auth::user()) + { + if (Auth::user()->role == 'admin' || Auth::user()->role == 'agent') + { return \Redirect::route('dashboard'); - } elseif (Auth::user()->role == 'user') { + } + elseif (Auth::user()->role == 'user') + { // return view('auth.register'); } - } else { + } + else + { return view('auth.register', compact('settings', 'email_mandatory')); } } @@ -143,65 +164,102 @@ class AuthController extends Controller { * * @return type Response */ - public function postRegister(User $user, RegisterRequest $request) { - try { - $request_array = $request->input(); - $password = Hash::make($request->input('password')); - $user->password = $password; - $name = $request->input('full_name'); + public function postRegister(User $user, RegisterRequest $request, $api = false) + { + //dd($request->all()); + try + { + $request_array = $request->input(); + $password = Hash::make($request->input('password')); + $user->password = $password; + $name = $request->input('full_name'); $user->first_name = $name; - if ($request_array['email'] == '') { + if ($request_array['email'] == '') + { $user->email = null; - } else { + } + else + { $user->email = $request->input('email'); } - if ($request_array['mobile'] == '') { + if (!checkArray('mobile', $request_array)) + { $user->mobile = null; - } else { + } + else + { $user->mobile = $request->input('mobile'); } - if ($request_array['code'] == '') { + if (!checkArray('code', $request_array)) + { $user->country_code = 0; - } else { + } + else + { $user->country_code = $request->input('code'); } - if ($request_array['email'] != '') { - $user->user_name = $request->input('email'); - } else { - $user->user_name = $request->input('mobile'); + if (checkArray('username', $request_array)) + { + $user->user_name = checkArray('username', $request_array); } - $user->role = 'user'; - $code = str_random(60); + else + { + $user->user_name = $request->input('email'); + } + $user->role = 'user'; + $code = str_random(60); $user->remember_token = $code; $user->save(); - $message12 = ''; - $settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first(); - $sms = Plugin::select('status')->where('name', '=', 'SMS')->first(); + $message12 = ''; + $settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first(); + $sms = Plugin::select('status')->where('name', '=', 'SMS')->first(); // Event for login \Event::fire(new \App\Events\LoginEvent($request)); - if ($request->input('email') !== '') { - $var = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $request->input('email')], $message = ['subject' => null, 'scenario' => 'registration'], $template_variables = ['user' => $name, 'email_address' => $request->input('email'), 'password_reset_link' => url('account/activate/' . $code)]); + if ($request->input('email') !== '') + { + $var = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $request->input('email')], $message = ['subject' => null, 'scenario' => 'registration'], $template_variables = ['user' => $name, 'email_address' => $request->input('email'), 'password_reset_link' => url('account/activate/' . $code)]); } - if ($settings->status == 1 || $settings->status == '1') { - if (count($sms) > 0) { - if ($sms->status == 1 || $sms->status == '1') { + if ($settings->status == 1 || $settings->status == '1') + { + if (count($sms) > 0) + { + if ($sms->status == 1 || $sms->status == '1') + { $message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail_and_moble'); - } else { + } + else + { $message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail_sms_plugin_inactive_or_not_setup'); } - } else { - if ($request->input('email') !== '') { + } + else + { + if ($request->input('email') !== '') + { $message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail'); - } else { + } + else + { $message12 = Lang::get('lang.account-created-contact-admin-as-we-were-not-able-to-send-opt'); } } - } else { + } + else + { $message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail'); } - + if ($api == true) + { + return ['message' => $message12, 'user' => $user->toArray()]; + } return redirect('home')->with('success', $message12); - } catch (\Exception $e) { + } + catch (\Exception $e) + { + if ($api == true) + { + throw new \Exception($e->getMessage()); + } return redirect()->back()->with('fails', $e->getMessage()); } } @@ -213,16 +271,20 @@ class AuthController extends Controller { * * @return type redirect */ - public function accountActivate($token) { + public function accountActivate($token) + { $user = User::where('remember_token', '=', $token)->first(); - if ($user) { - $user->active = 1; + if ($user) + { + $user->active = 1; $user->remember_token = null; $user->save(); $this->openTicketAfterVerification($user->id); return redirect('/auth/login')->with('status', 'Acount activated. Login to start'); - } else { + } + else + { return redirect('/auth/login')->with('fails', 'Invalid Token'); } } @@ -235,14 +297,18 @@ class AuthController extends Controller { * * @return type Response */ - public function getMail($token, User $user) { + public function getMail($token, User $user) + { $user = $user->where('remember_token', $token)->where('active', 0)->first(); - if ($user) { + if ($user) + { $user->active = 1; $user->save(); return redirect('auth/login'); - } else { + } + else + { return redirect('auth/login'); } } @@ -252,19 +318,29 @@ class AuthController extends Controller { * * @return type Response */ - public function getLogin() { + public function getLogin() + { $directory = base_path(); - if (file_exists($directory . DIRECTORY_SEPARATOR . '.env')) { - if (Auth::user()) { - if (Auth::user()->role == 'admin' || Auth::user()->role == 'agent') { + if (file_exists($directory . DIRECTORY_SEPARATOR . '.env')) + { + if (Auth::user()) + { + if (Auth::user()->role == 'admin' || Auth::user()->role == 'agent') + { return \Redirect::route('dashboard'); - } elseif (Auth::user()->role == 'user') { + } + elseif (Auth::user()->role == 'user') + { return \Redirect::route('home'); } - } else { + } + else + { return view('auth.login'); } - } else { + } + else + { return Redirect::route('licence'); } } @@ -276,120 +352,155 @@ class AuthController extends Controller { * * @return type Response */ - public function postLogin(LoginRequest $request) { - try { + public function postLogin(LoginRequest $request) + { + try + { // dd($request->input()); \Event::fire('auth.login.event', []); //added 5/5/2016 // Set login attempts and login time - $value = $_SERVER['REMOTE_ADDR']; + $value = $_SERVER['REMOTE_ADDR']; $usernameinput = $request->input('email'); - $password = $request->input('password'); - if ($request->input('referer')) { + $password = $request->input('password'); + if ($request->input('referer')) + { $referer = 'form'; - } else { + } + else + { $referer = '/'; } - $field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name'; + $field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name'; $result = $this->confirmIPAddress($value, $usernameinput); // If attempts > 3 and time < 30 minutes $security = Security::whereId('1')->first(); - if ($result == 1) { + if ($result == 1) + { return redirect()->back()->withErrors('email', 'Incorrect details')->with(['error' => $security->lockout_message, 'referer' => $referer]); } $check_active = User::where('email', '=', $request->input('email'))->orwhere('user_name', '=', $request->input('email'))->first(); - if (!$check_active) { //check if user exists or not + if (!$check_active) + { //check if user exists or not //if user deos not exist then return back with error that user is not registered return redirect()->back() ->withInput($request->only('email', 'remember')) ->withErrors([ - 'email' => $this->getFailedLoginMessage(), + 'email' => $this->getFailedLoginMessage(), 'password' => $this->getFailedLoginMessage(), - ])->with(['error' => Lang::get('lang.not-registered'), + ])->with(['error' => Lang::get('lang.not-registered'), 'referer' => $referer,]); } //if user exists $settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first(); - if ($settings->status == '1' || $settings->status == 1) { // check for otp verification setting + if ($settings->status == '1' || $settings->status == 1) + { // check for otp verification setting // setting is enabled $sms = Plugin::select('status')->where('name', '=', 'SMS')->first(); - if ($sms) { //check sms plugin installed or not + if ($sms) + { //check sms plugin installed or not // plugin is installed - if ($sms->status == 1 || $sms->status === '1') { //check plugin is active or not + if ($sms->status == 1 || $sms->status === '1') + { //check plugin is active or not // plugin is active - if (!$check_active->active) { //check account is active or not + if (!$check_active->active) + { //check account is active or not // account is not active show verify otp window - if ($check_active->mobile) { //check user has mobile or not + if ($check_active->mobile) + { //check user has mobile or not // user has mobile number return verify OTP screen return \Redirect::route('otp-verification') ->withInput($request->input()) - ->with(['values' => $request->input(), + ->with(['values' => $request->input(), 'referer' => $referer, - 'name' => $check_active->first_name, - 'number' => $check_active->mobile, - 'code' => $check_active->country_code,]); - } else { + 'name' => $check_active->first_name, + 'number' => $check_active->mobile, + 'code' => $check_active->country_code,]); + } + else + { goto a; //attenmpt login (be careful while using goto statements) } - } else { + } + else + { goto a; //attenmpt login (be careful while using goto statements) } - } else { + } + else + { goto a; //attenmpt login (be careful while using goto statements) } - } else { + } + else + { goto a; //attenmpt login (be careful while using goto statements) } - } else { + } + else + { // setting is disabled - a: if (!$check_active->active) { //check account is active or not + a: if (!$check_active->active) + { //check account is active or not // if accoutn is not active return back with error message that account is inactive return redirect()->back() ->withInput($request->only('email', 'remember')) ->withErrors([ - 'email' => $this->getFailedLoginMessage(), + 'email' => $this->getFailedLoginMessage(), 'password' => $this->getFailedLoginMessage(), - ])->with(['error' => Lang::get('lang.this_account_is_currently_inactive'), + ])->with(['error' => Lang::get('lang.this_account_is_currently_inactive'), 'referer' => $referer,]); - } else { + } + else + { // try login $loginAttempts = 1; // If session has login attempts, retrieve attempts counter and attempts time - if (\Session::has('loginAttempts')) { - $loginAttempts = \Session::get('loginAttempts'); + if (\Session::has('loginAttempts')) + { + $loginAttempts = \Session::get('loginAttempts'); $loginAttemptTime = \Session::get('loginAttemptTime'); $this->addLoginAttempt($value, $usernameinput); // $credentials = $request->only('email', 'password'); - $usernameinput = $request->input('email'); - $password = $request->input('password'); - $field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name'; + $usernameinput = $request->input('email'); + $password = $request->input('password'); + $field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name'; // If attempts > 3 and time < 10 minutes - if ($loginAttempts > $security->backlist_threshold && (time() - $loginAttemptTime <= ($security->lockout_period * 60))) { + if ($loginAttempts > $security->backlist_threshold && (time() - $loginAttemptTime <= ($security->lockout_period * 60))) + { return redirect()->back()->withErrors('email', 'incorrect email')->with('error', $security->lockout_message); } // If time > 10 minutes, reset attempts counter and time in session - if (time() - $loginAttemptTime > ($security->lockout_period * 60)) { + if (time() - $loginAttemptTime > ($security->lockout_period * 60)) + { \Session::put('loginAttempts', 1); \Session::put('loginAttemptTime', time()); } - } else { // If no login attempts stored, init login attempts and time + } + else + { // If no login attempts stored, init login attempts and time \Session::put('loginAttempts', $loginAttempts); \Session::put('loginAttemptTime', time()); $this->clearLoginAttempts($value, $usernameinput); } // If auth ok, redirect to restricted area \Session::put('loginAttempts', $loginAttempts + 1); - if (Auth::Attempt([$field => $usernameinput, 'password' => $password], $request->has('remember'))) { - if (Auth::user()->role == 'user') { - if ($request->input('referer')) { + if (Auth::Attempt([$field => $usernameinput, 'password' => $password], $request->has('remember'))) + { + if (Auth::user()->role == 'user') + { + if ($request->input('referer')) + { return \Redirect::route($request->input('referer')); } return \Redirect::route('/'); - } else { + } + else + { return redirect()->intended($this->redirectPath()); } } @@ -399,12 +510,14 @@ class AuthController extends Controller { return redirect()->back() ->withInput($request->only('email', 'remember')) ->withErrors([ - 'email' => $this->getFailedLoginMessage(), + 'email' => $this->getFailedLoginMessage(), 'password' => $this->getFailedLoginMessage(), - ])->with(['error' => Lang::get('lang.invalid'), + ])->with(['error' => Lang::get('lang.invalid'), 'referer' => $referer,]); // Increment login attempts - } catch (\Exception $e) { + } + catch (\Exception $e) + { return redirect()->back()->with('fails', $e->getMessage()); } } @@ -416,21 +529,28 @@ class AuthController extends Controller { * * @return type Response */ - public function addLoginAttempt($value, $field) { - $result = DB::table('login_attempts')->where('IP', '=', $value)->first(); - $data = $result; + public function addLoginAttempt($value, $field) + { + $result = DB::table('login_attempts')->where('IP', '=', $value)->first(); + $data = $result; $security = Security::whereId('1')->first(); - $apt = $security->backlist_threshold; - if ($data) { + $apt = $security->backlist_threshold; + if ($data) + { $attempts = $data->Attempts + 1; - if ($attempts == $apt) { + if ($attempts == $apt) + { // $result = DB::select('UPDATE login_attempts SET Attempts='.$attempts.", LastLogin=NOW() WHERE IP = '$value' OR User = '$field'"); $result = DB::table('login_attempts')->where('IP', '=', $value)->orWhere('User', '=', $field)->update(['Attempts' => $attempts, 'LastLogin' => date('Y-m-d H:i:s')]); - } else { + } + else + { $result = DB::table('login_attempts')->where('IP', '=', $value)->orWhere('User', '=', $field)->update(['Attempts' => $attempts]); // $result = DB::select("UPDATE login_attempts SET Attempts=".$attempts." WHERE IP = '$value' OR User = '$field'"); } - } else { + } + else + { // $result = DB::select("INSERT INTO login_attempts (Attempts,User,IP,LastLogin) values (1,'$field','$value', NOW())"); $result = DB::table('login_attempts')->update(['Attempts' => 1, 'User' => $field, 'IP' => $value, 'LastLogin' => date('Y-m-d H:i:s')]); } @@ -443,7 +563,8 @@ class AuthController extends Controller { * * @return type Response */ - public function clearLoginAttempts($value, $field) { + public function clearLoginAttempts($value, $field) + { $data = DB::table('login_attempts')->where('IP', '=', $value)->orWhere('User', '=', $field)->update(['attempts' => '0']); return $data; @@ -456,22 +577,28 @@ class AuthController extends Controller { * * @return type Response */ - public function confirmIPAddress($value, $field) { - $security = Security::whereId('1')->first(); - $time = $security->lockout_period; + public function confirmIPAddress($value, $field) + { + $security = Security::whereId('1')->first(); + $time = $security->lockout_period; $max_attempts = $security->backlist_threshold; - $table = 'login_attempts'; - $result = DB::select('SELECT Attempts, (CASE when LastLogin is not NULL and DATE_ADD(LastLogin, INTERVAL ' . $time . ' MINUTE)>NOW() then 1 else 0 end) as Denied ' . + $table = 'login_attempts'; + $result = DB::select('SELECT Attempts, (CASE when LastLogin is not NULL and DATE_ADD(LastLogin, INTERVAL ' . $time . ' MINUTE)>NOW() then 1 else 0 end) as Denied ' . ' FROM ' . $table . " WHERE IP = '$value' OR User = '$field'"); - $data = $result; + $data = $result; //Verify that at least one login attempt is in database - if (!$data) { + if (!$data) + { return 0; } - if ($data[0]->Attempts >= $max_attempts) { - if ($data[0]->Denied == 1) { + if ($data[0]->Attempts >= $max_attempts) + { + if ($data[0]->Denied == 1) + { return 1; - } else { + } + else + { $this->clearLoginAttempts($value, $field); return 0; @@ -486,7 +613,8 @@ class AuthController extends Controller { * * @return type string */ - protected function getFailedLoginMessage() { + protected function getFailedLoginMessage() + { return Lang::get('lang.this_field_do_not_match_our_records'); } @@ -497,10 +625,14 @@ class AuthController extends Controller { * * @return response|view */ - public function getVerifyOTP() { - if (\Session::has('values')) { + public function getVerifyOTP() + { + if (\Session::has('values')) + { return view('auth.otp-verify'); - } else { + } + else + { return redirect('auth/login'); } } @@ -512,27 +644,37 @@ class AuthController extends Controller { * * @return int|string */ - public function verifyOTP(LoginRequest $request) { - $user = User::select('id', 'mobile', 'user_name')->where('email', '=', $request->input('email')) + public function verifyOTP(LoginRequest $request) + { + $user = User::select('id', 'mobile', 'user_name')->where('email', '=', $request->input('email')) ->orWhere('user_name', '=', $request->input('email'))->first(); $otp_length = strlen($request->input('otp')); - if (!\Schema::hasTable('user_verification')) { + if (!\Schema::hasTable('user_verification')) + { $message = Lang::get('lang.opt-can-not-be-verified'); - } else { + } + else + { $otp = Otp::select('otp', 'updated_at')->where('user_id', '=', $user->id) ->first(); - if ($otp != null) { - if (($otp_length == 6 && !preg_match('/[a-z]/i', $request->input('otp')))) { - $otp2 = Hash::make($request->input('otp')); - $date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa'); - $date2 = date('Y-m-d h:i:sa'); - $time1 = new DateTime($date2); - $time2 = new DateTime($date1); + if ($otp != null) + { + if (($otp_length == 6 && !preg_match('/[a-z]/i', $request->input('otp')))) + { + $otp2 = Hash::make($request->input('otp')); + $date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa'); + $date2 = date('Y-m-d h:i:sa'); + $time1 = new DateTime($date2); + $time2 = new DateTime($date1); $interval = $time1->diff($time2); - if ($interval->i > 30 || $interval->h > 0) { + if ($interval->i > 30 || $interval->h > 0) + { $message = Lang::get('lang.otp-expired'); - } else { - if (Hash::check($request->input('otp'), $otp->otp)) { + } + else + { + if (Hash::check($request->input('otp'), $otp->otp)) + { Otp::where('user_id', '=', $user->id) ->update(['otp' => '']); User::where('id', '=', $user->id) @@ -540,14 +682,20 @@ class AuthController extends Controller { $this->openTicketAfterVerification($user->id); return $this->postLogin($request); - } else { + } + else + { $message = Lang::get('lang.otp-not-matched'); } } - } else { + } + else + { $message = Lang::get('lang.otp-invalid'); } - } else { + } + else + { $message = Lang::get('lang.otp-not-matched'); } } @@ -556,22 +704,29 @@ class AuthController extends Controller { ->withInput($request->input()) ->with(['values' => $request->input(), 'number' => $user->mobile, - 'name' => $user->user_name, - 'fails' => $message,]); + 'name' => $user->user_name, + 'fails' => $message,]); } - public function resendOTP(OtpVerifyRequest $request) { - if (!\Schema::hasTable('user_verification') || !\Schema::hasTable('sms')) { + public function resendOTP(OtpVerifyRequest $request) + { + if (!\Schema::hasTable('user_verification') || !\Schema::hasTable('sms')) + { $message = Lang::get('lang.opt-can-not-be-verified'); return $message; - } else { + } + else + { $sms = DB::table('sms')->get(); - if (count($sms) > 0) { + if (count($sms) > 0) + { \Event::fire(new \App\Events\LoginEvent($request)); return 1; - } else { + } + else + { $message = Lang::get('lang.opt-can-not-be-verified'); return $message; @@ -588,15 +743,18 @@ class AuthController extends Controller { * * @author manish.verma@ladybirdweb.com */ - public function openTicketAfterVerification($id) { + public function openTicketAfterVerification($id) + { // dd($id); $ticket = Tickets::select('id') ->where(['user_id' => $id, 'status' => 6]) ->get(); Tickets::where(['user_id' => $id, 'status' => 6]) ->update(['status' => 1]); - if ($ticket != null) { - foreach ($ticket as $value) { + if ($ticket != null) + { + foreach ($ticket as $value) + { $ticket_id = $value->id; Ticket_Thread::where('ticket_id', '=', $ticket_id) ->update(['updated_at' => date('Y-m-d H:i:s')]); @@ -604,13 +762,15 @@ class AuthController extends Controller { } } - public function changeRedirect() { + public function changeRedirect() + { $provider = \Session::get('provider'); - $url = \Session::get($provider . 'redirect'); + $url = \Session::get($provider . 'redirect'); \Config::set("services.$provider.redirect", $url); } - public function setSession($provider, $redirect) { + public function setSession($provider, $redirect) + { $url = url($redirect); \Session::set('provider', $provider); \Session::set($provider . 'redirect', $url); diff --git a/app/Http/routes.php b/app/Http/routes.php index 131494175..304be246f 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -705,8 +705,7 @@ Route::group(['middleware' => ['web']], function () { * @author Vijay Sebastian * @name Faveo */ - Route::group(['prefix' => 'api/v1'], function () { - Route::post('register', 'Api\v1\ApiController@register'); + Route::group(['prefix' => 'api/v1'], function () { Route::post('authenticate', 'Api\v1\TokenAuthController@authenticate'); Route::get('authenticate/user', 'Api\v1\TokenAuthController@getAuthenticatedUser'); Route::get('/database-config', ['as' => 'database-config', 'uses' => 'Api\v1\InstallerApiController@config_database']); @@ -752,6 +751,7 @@ Route::group(['middleware' => ['web']], function () { Route::post('collaborator/get-ticket', 'Api\v1\ApiController@getCollaboratorForTicket'); Route::get('my-tickets-user', 'Api\v1\ApiController@getMyTicketsUser'); Route::get('dependency', 'Api\v1\ApiController@dependency'); + Route::post('register', 'Api\v1\ApiController@createUser'); }); /* diff --git a/app/Model/helpdesk/Utility/Priority.php b/app/Model/helpdesk/Utility/Priority.php index 051b6460a..92bb54ccb 100644 --- a/app/Model/helpdesk/Utility/Priority.php +++ b/app/Model/helpdesk/Utility/Priority.php @@ -7,7 +7,7 @@ use App\BaseModel; class Priority extends BaseModel { public $timestamps = false; - protected $table = 'priority'; + protected $table = 'ticket_priority'; protected $fillable = [ 'id', 'name', ]; From 7d7a097966a1305deaf66a96d463e5fce51bcb38 Mon Sep 17 00:00:00 2001 From: Vijay Sebastian Date: Thu, 27 Jul 2017 17:50:14 +0530 Subject: [PATCH 07/46] update api --- app/Http/Controllers/Api/v1/ApiController.php | 57 ++++++++++++++++++- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/v1/ApiController.php b/app/Http/Controllers/Api/v1/ApiController.php index fa69a36b7..76ed9f456 100644 --- a/app/Http/Controllers/Api/v1/ApiController.php +++ b/app/Http/Controllers/Api/v1/ApiController.php @@ -1636,6 +1636,14 @@ class ApiController extends Controller { try { + $user = \JWTAuth::parseToken()->authenticate(); + $tickets = \DB::table('tickets'); + if ($user->role == 'agent') + { + $id = $user->id; + $dept = DepartmentAssignAgents::where('agent_id', '=', $id)->pluck('department_id')->toArray(); + $tickets = $tickets->whereIn('tickets.dept_id', $dept)->orWhere('assigned_to', '=', $user->id); + } $department = $this->department->select('name', 'id')->get()->toArray(); $sla = $this->slaPlan->select('name', 'id')->get()->toArray(); $staff = $this->user->where('role', 'agent')->select('email', 'id')->get()->toArray(); @@ -1644,8 +1652,53 @@ class ApiController extends Controller $helptopic = $this->helptopic->select('topic', 'id')->get()->toArray(); $status = \DB::table('ticket_status')->select('name', 'id')->get(); $source = \DB::table('ticket_source')->select('name', 'id')->get(); - $result = ['departments' => $department, 'sla' => $sla, 'staffs' => $staff, 'teams' => $team, - 'priorities' => $priority, 'helptopics' => $helptopic, 'status' => $status, 'sources' => $source,]; + $statuses = collect($tickets + ->join('ticket_status', 'tickets.status', '=', 'ticket_status.id') + ->select('ticket_status.name as status', \DB::raw('COUNT(tickets.id) as count')) + ->groupBy('ticket_status.id') + ->get())->transform(function ($item) + { + return ['name' => ucfirst($item->status), 'count' => $item->count]; + }); + $unassigned = $this->user->leftJoin('tickets', function ($join) + { + $join->on('users.id', '=', 'tickets.user_id') + ->whereNull('assigned_to')->where('status', '=', 1); + }) + ->where(function($query) use($user) + { + if ($user->role != 'admin') + { + $query->where('tickets.dept_id', '=', $user->primary_dpt); + } + }) + ->select(\DB::raw('COUNT(tickets.id) as unassined')) + ->value('unassined'); + $mytickets = $this->user->leftJoin('tickets', function ($join) use ($user) + { + $join->on('users.id', '=', 'tickets.assigned_to') + ->where('tickets.assigned_to', '=', $user->id)->where('status', '=', 1); + }) + ->where(function ($query) use ($user) + { + if ($user->role != 'admin') + { + $query->where('tickets.dept_id', '=', $user->primary_dpt)->orWhere('assigned_to', '=', $user->id); + } + }) + ->select(\DB::raw('COUNT(tickets.id) as my_ticket')) + ->value('my_ticket'); + $depend = collect([['name' => 'unassigned', 'count' => $unassigned], ['name' => 'mytickets', 'count' => $mytickets]]); + $collection = $statuses->merge($depend); + $result = ['departments' => $department, 'sla' => $sla, 'staffs' => $staff, 'teams' => $team, + 'priorities' => $priority, 'helptopics' => $helptopic, + 'status' => $status, + 'sources' => $source, + 'tickets_count' => $collection]; + + return response()->json(compact('result')); +// $result = ['departments' => $department, 'sla' => $sla, 'staffs' => $staff, 'teams' => $team, +// 'priorities' => $priority, 'helptopics' => $helptopic, 'status' => $status, 'sources' => $source,]; return response()->json(compact('result')); } From 54a566b49af897706764d35bc096dd12e0c2e547 Mon Sep 17 00:00:00 2001 From: Vijay Sebastian Date: Tue, 1 Aug 2017 19:43:52 +0530 Subject: [PATCH 08/46] updates --- app/Http/Controllers/Api/v1/ApiController.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Api/v1/ApiController.php b/app/Http/Controllers/Api/v1/ApiController.php index 76ed9f456..8dfb10630 100644 --- a/app/Http/Controllers/Api/v1/ApiController.php +++ b/app/Http/Controllers/Api/v1/ApiController.php @@ -1343,6 +1343,12 @@ class ApiController extends Controller return response()->json(compact('error')); } + $user = User::where('users.id', $id) + ->leftJoin('user_assign_organization', 'users.id', '=', 'user_assign_organization.user_id') + ->leftJoin('organization', 'user_assign_organization.org_id', '=', 'organization.id') + ->select( + 'users.first_name', 'users.last_name', 'users.user_name', 'users.email', 'users.id', 'users.profile_pic', 'users.ban', 'users.active', 'users.is_delete', 'users.phone_number', 'users.ext', 'users.country_code', 'users.mobile', 'organization.name as company' + )->first()->toArray(); $result = $this->user->join('tickets', function ($join) use ($id) { $join->on('users.id', '=', 'tickets.user_id') @@ -1363,10 +1369,9 @@ class ApiController extends Controller ->groupby('tickets.id') ->distinct() ->get() - // ->paginate(10) - ->toJson(); + ->toArray(); - return $result; + return response()->json(['tickets' => $result, 'requester' => $user]); } catch (\Exception $e) { From 837c99db39ebb5c38b0f206168cbee5ea3ea6274 Mon Sep 17 00:00:00 2001 From: Manish Verma Date: Mon, 4 Sep 2017 15:21:44 +0530 Subject: [PATCH 09/46] Create CONTRIBUTING.md --- CONTRIBUTING.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..078a469d1 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,10 @@ +## Contributing +Contributions are welcome, and are accepted via pull requests. Please review these guidelines before submitting any pull requests. + +* Please follow the [PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) and [PHP-FIG Naming Conventions](https://github.com/php-fig/fig-standards/blob/master/bylaws/007-psr-naming-conventions.md). +* Remember to follow [SemVer](http://semver.org/). If you are changing the behavior, or the public api, you may need to update the docs. +* Make sure that the current tests pass, and if you have added something new, add the tests where relevant. +* Send a coherent commit history, making sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History) them before submitting. +* You may also need to [rebase](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) to avoid merge conflicts. + +NOTE: StyleCI is set up to automatically check and fix any code style issues. From 7a7836803712a185b5290c9f525f2f6c2d0fb5df Mon Sep 17 00:00:00 2001 From: Manish Verma Date: Mon, 4 Sep 2017 09:52:33 +0000 Subject: [PATCH 10/46] Apply fixes from StyleCI --- .../Controllers/StorageController.php | 4 +- app/Helper/Finder.php | 114 +- .../Admin/helpdesk/AgentController.php | 2 + .../Admin/helpdesk/EmailsController.php | 1 + .../Admin/helpdesk/FormController.php | 6 + .../Admin/helpdesk/PriorityController.php | 4 +- .../Admin/helpdesk/SettingsController2.php | 26 +- .../SocialMedia/SocialMediaController.php | 1 + .../Admin/helpdesk/TeamController.php | 10 +- .../Admin/helpdesk/TemplateController.php | 10 +- .../Admin/helpdesk/UrlSettingController.php | 2 +- .../Admin/helpdesk/WorkflowController.php | 1 + .../helpdesk/Filter/FilterController.php | 2 +- .../Agent/helpdesk/TicketController.php | 28 +- .../Agent/helpdesk/UserController.php | 68 +- .../Controllers/Agent/kb/PageController.php | 3 + app/Http/Controllers/Api/v1/ApiController.php | 997 +++++++----------- .../Controllers/Api/v1/TicketController.php | 571 ++++------ .../Api/v1/TokenAuthController.php | 8 +- app/Http/Controllers/Auth/AuthController.php | 441 +++----- .../Controllers/Auth/PasswordController.php | 8 +- .../helpdesk/ClientTicketController.php | 2 +- .../Client/helpdesk/GuestController.php | 9 +- .../Client/helpdesk/UnAuthController.php | 56 +- app/Http/Controllers/Common/ApiSettings.php | 3 + .../Controllers/Common/PhpMailController.php | 6 +- .../Controllers/Common/SettingsController.php | 6 + .../Installer/helpdesk/InstallController.php | 3 +- app/Http/Controllers/Job/MailController.php | 1 + app/Http/Middleware/CheckUpdate.php | 4 +- app/Http/Requests/helpdesk/TicketRequest.php | 1 + app/Http/routes.php | 50 +- .../helpdesk/Notification/Notification.php | 2 +- config/app.php | 2 - ...4_18_115852_create_workflow_name_table.php | 18 +- ...4_18_115900_create_workflow_rule_table.php | 24 +- ...18_115908_create_workflow_action_table.php | 24 +- ..._102604_create_bar_notifications_table.php | 2 +- .../samples/old/assets/posteddata.php | 1 - 39 files changed, 1023 insertions(+), 1498 deletions(-) diff --git a/app/FaveoStorage/Controllers/StorageController.php b/app/FaveoStorage/Controllers/StorageController.php index 8a9e46e31..428381f0f 100644 --- a/app/FaveoStorage/Controllers/StorageController.php +++ b/app/FaveoStorage/Controllers/StorageController.php @@ -250,9 +250,9 @@ class StorageController extends Controller if ($disposition == 'INLINE' || $disposition == 'inline') { $id = str_replace('>', '', str_replace('<', '', $structure->id)); $body = $thread->body; - // dd($id,$filename,$body); + // dd($id,$filename,$body); $body = str_replace('cid:'.$id, $filename, $body); - // dd($body); + // dd($body); $thread->body = $body; $thread->save(); } diff --git a/app/Helper/Finder.php b/app/Helper/Finder.php index 1895f451d..8f0bb2d30 100644 --- a/app/Helper/Finder.php +++ b/app/Helper/Finder.php @@ -58,26 +58,26 @@ class Finder return $group->first()->name; } - /** - * STATUS TYPE - * This function is used for returning status type name with respect to id. - * - * @param $id type int - * @param $custom type array/null - * - * @return type string - */ - public static function statusType($id, $custom = null) - { - if ($custom == null) { - $status_type = TicketStatusType::whereId($id)->select(['name']); - } elseif (isset($custom)) { - $status_type = TicketStatusType::whereId($id)->select($custom); - } - - return $status_type->first()->name; + /** + * STATUS TYPE + * This function is used for returning status type name with respect to id. + * + * @param $id type int + * @param $custom type array/null + * + * @return type string + */ + public static function statusType($id, $custom = null) + { + if ($custom == null) { + $status_type = TicketStatusType::whereId($id)->select(['name']); + } elseif (isset($custom)) { + $status_type = TicketStatusType::whereId($id)->select($custom); } + return $status_type->first()->name; + } + /** * STATUS * This function is used for returning status name with respect to id. @@ -137,48 +137,48 @@ class Finder } } - /** - * ANY TYPE STATUS - * This function is used to return the set of status which are of any type passed in the param. - * - * @param type $id - * - * @return type array - */ - public static function anyTypeStatus($id) - { - $status_group = Ticket_Status::where('purpose_of_status', '=', $id)->select(['id'])->get(); - foreach ($status_group as $status) { - $status_group2[] = $status->id; - } - - return $status_group2; + /** + * ANY TYPE STATUS + * This function is used to return the set of status which are of any type passed in the param. + * + * @param type $id + * + * @return type array + */ + public static function anyTypeStatus($id) + { + $status_group = Ticket_Status::where('purpose_of_status', '=', $id)->select(['id'])->get(); + foreach ($status_group as $status) { + $status_group2[] = $status->id; } - /** - * RETURNS ALL STATUS - * This function is used to return all the status given in the system. - * - * @return type array - */ - public static function getAllStatus() - { - $status = Ticket_Status::where('purpose_of_status', '!=', 3)->orwhere('purpose_of_status', '!=', 4)->get(); + return $status_group2; + } - return $status; + /** + * RETURNS ALL STATUS + * This function is used to return all the status given in the system. + * + * @return type array + */ + public static function getAllStatus() + { + $status = Ticket_Status::where('purpose_of_status', '!=', 3)->orwhere('purpose_of_status', '!=', 4)->get(); + + return $status; + } + + /** + * VARIABLE REPLACEMENT + * This function is used to replace the replaceable variables form a given content for templates. + */ + public static function replaceTemplateVariables($variables, $data, $contents) + { + foreach ($variables as $key => $variable) { + $messagebody = str_replace($variables[$key], $data[$key], $contents); + $contents = $messagebody; } - /** - * VARIABLE REPLACEMENT - * This function is used to replace the replaceable variables form a given content for templates. - */ - public static function replaceTemplateVariables($variables, $data, $contents) - { - foreach ($variables as $key => $variable) { - $messagebody = str_replace($variables[$key], $data[$key], $contents); - $contents = $messagebody; - } - - return $contents; - } + return $contents; + } } diff --git a/app/Http/Controllers/Admin/helpdesk/AgentController.php b/app/Http/Controllers/Admin/helpdesk/AgentController.php index 9b94793bd..7fd17f8f9 100644 --- a/app/Http/Controllers/Admin/helpdesk/AgentController.php +++ b/app/Http/Controllers/Admin/helpdesk/AgentController.php @@ -271,10 +271,12 @@ class AgentController extends Controller $team_assign_agent = $team_assign_agent->where('agent_id', $id); $team_assign_agent->delete(); $user = $user->whereId($id)->first(); + try { $error = Lang::get('lang.this_staff_is_related_to_some_tickets'); $user->id; $user->delete(); + throw new \Exception($error); return redirect('agents')->with('success', Lang::get('lang.agent_deleted_sucessfully')); } catch (\Exception $e) { diff --git a/app/Http/Controllers/Admin/helpdesk/EmailsController.php b/app/Http/Controllers/Admin/helpdesk/EmailsController.php index 8c15c251e..7b9be5355 100644 --- a/app/Http/Controllers/Admin/helpdesk/EmailsController.php +++ b/app/Http/Controllers/Admin/helpdesk/EmailsController.php @@ -428,6 +428,7 @@ class EmailsController extends Controller return redirect('emails')->with('fails', Lang::get('lang.you_cannot_delete_system_default_email')); } } + try { // fetching the database instance of the current email $emails = $email->whereId($id)->first(); diff --git a/app/Http/Controllers/Admin/helpdesk/FormController.php b/app/Http/Controllers/Admin/helpdesk/FormController.php index 5a7d90d9b..c5005cc39 100644 --- a/app/Http/Controllers/Admin/helpdesk/FormController.php +++ b/app/Http/Controllers/Admin/helpdesk/FormController.php @@ -106,6 +106,7 @@ class FormController extends Controller return view('themes.default1.admin.helpdesk.manage.form.preview', compact('form', 'fields')); } + throw new Exception("Sorry we can't find your request"); } catch (Exception $ex) { return redirect()->back()->with('fails', $ex->getMessage()); @@ -125,6 +126,7 @@ class FormController extends Controller 'name.*' => 'required', 'type.*' => 'required', ]); + try { $forms = new Forms(); $require = Input::get('required'); @@ -195,6 +197,7 @@ class FormController extends Controller //dd($fields); return view('themes.default1.admin.helpdesk.manage.form.edit', compact('form', 'fields', 'select_forms')); } + throw new Exception("Sorry we can't find your request"); } catch (Exception $ex) { return redirect()->back()->with('fails', $ex->getMessage()); @@ -213,6 +216,7 @@ class FormController extends Controller //dd($fields); return view('themes.default1.admin.helpdesk.manage.form.add-child', compact('form', 'fields', 'select_forms')); } + throw new Exception("Sorry we can't find your request"); } catch (Exception $ex) { return redirect()->back()->with('fails', $ex->getMessage()); @@ -227,6 +231,7 @@ class FormController extends Controller 'name.*' => 'required', 'type.*' => 'required', ]); + try { if (!$request->input('formname')) { throw new Exception(Lang::get('lang.please_fill_form_name')); @@ -391,6 +396,7 @@ class FormController extends Controller public function addChild($fieldid, Request $request) { $ids = $request->except('_token'); + try { foreach ($ids as $valueid => $formid) { $field_value = new \App\Model\helpdesk\Form\FieldValue(); diff --git a/app/Http/Controllers/Admin/helpdesk/PriorityController.php b/app/Http/Controllers/Admin/helpdesk/PriorityController.php index 2b999d298..7e0b39289 100644 --- a/app/Http/Controllers/Admin/helpdesk/PriorityController.php +++ b/app/Http/Controllers/Admin/helpdesk/PriorityController.php @@ -46,7 +46,7 @@ class PriorityController extends Controller $user_status = CommonSettings::where('option_name', '=', 'user_priority')->first(); // dd( $user_status); - return view('themes.default1.admin.helpdesk.manage.ticket_priority.index', compact('user_status')); + return view('themes.default1.admin.helpdesk.manage.ticket_priority.index', compact('user_status')); } /** @@ -172,7 +172,7 @@ class PriorityController extends Controller public function destroy($priority_id) { $default_priority = Ticket_Priority::where('is_default', '>', '0')->first(); -// dd($default_priority->is_default); + // dd($default_priority->is_default); $topic = DB::table('help_topic')->where('priority', '=', $priority_id)->update(['priority' => $default_priority->is_default]); // if ($topic > 0) { // if ($topic > 1) { diff --git a/app/Http/Controllers/Admin/helpdesk/SettingsController2.php b/app/Http/Controllers/Admin/helpdesk/SettingsController2.php index 9682941f2..0a18728a1 100644 --- a/app/Http/Controllers/Admin/helpdesk/SettingsController2.php +++ b/app/Http/Controllers/Admin/helpdesk/SettingsController2.php @@ -150,8 +150,8 @@ class SettingsController2 extends Controller public function createStatuses(\App\Model\helpdesk\Ticket\Ticket_Status $statuss) { // try { - /* fetch the values of company from company table */ - $statuss->name = Input::get('name'); + /* fetch the values of company from company table */ + $statuss->name = Input::get('name'); $statuss->icon_class = Input::get('icon_class'); $statuss->email_user = Input::get('email_user'); $statuss->sort = Input::get('sort'); @@ -164,7 +164,7 @@ class SettingsController2 extends Controller $statuss->sort = Input::get('sort'); $statuss->save(); /* Direct to Company Settings Page */ - return redirect()->back()->with('success', 'Status has been created!'); + return redirect()->back()->with('success', 'Status has been created!'); // } catch (Exception $ex) { // return redirect()->back()->with('fails', $ex->errorInfo[2]); // } @@ -175,9 +175,9 @@ class SettingsController2 extends Controller try { if ($id > 5) { /* fetch the values of company from company table */ - \App\Model\helpdesk\Ticket\Ticket_Status::whereId($id)->delete(); - /* Direct to Company Settings Page */ - return redirect()->back()->with('success', 'Status has been deleted'); + \App\Model\helpdesk\Ticket\Ticket_Status::whereId($id)->delete(); + /* Direct to Company Settings Page */ + return redirect()->back()->with('success', 'Status has been deleted'); } else { return redirect()->back()->with('failed', 'You cannot delete this status'); } @@ -446,12 +446,12 @@ class SettingsController2 extends Controller public function getSchedular(Email $email, Template $template, Emails $email1) { // try { - /* fetch the values of email from Email table */ - $emails = $email->whereId('1')->first(); - /* Fetch the values from Template table */ - $templates = $template->get(); - /* Fetch the values from Emails table */ - $emails1 = $email1->get(); + /* fetch the values of email from Email table */ + $emails = $email->whereId('1')->first(); + /* Fetch the values from Template table */ + $templates = $template->get(); + /* Fetch the values from Emails table */ + $emails1 = $email1->get(); return view('themes.default1.admin.helpdesk.settings.crone', compact('emails', 'templates', 'emails1')); // } catch { @@ -503,7 +503,7 @@ class SettingsController2 extends Controller // try { // /* fetch the values of access from access table */ // $accesses = $access->whereId('1')->first(); -// // Direct to Access Settings Page + // // Direct to Access Settings Page // return view('themes.default1.admin.helpdesk.settings.access', compact('accesses')); // } catch (Exception $e) { // return view('404'); diff --git a/app/Http/Controllers/Admin/helpdesk/SocialMedia/SocialMediaController.php b/app/Http/Controllers/Admin/helpdesk/SocialMedia/SocialMediaController.php index 0c8abfc65..64fa87207 100644 --- a/app/Http/Controllers/Admin/helpdesk/SocialMedia/SocialMediaController.php +++ b/app/Http/Controllers/Admin/helpdesk/SocialMedia/SocialMediaController.php @@ -32,6 +32,7 @@ class SocialMediaController extends Controller 'client_secret' => 'required', 'redirect' => 'required|url', ]); + try { $requests = $request->except('_token'); $this->insertProvider($provider, $requests); diff --git a/app/Http/Controllers/Admin/helpdesk/TeamController.php b/app/Http/Controllers/Admin/helpdesk/TeamController.php index d662875c1..b643bc915 100644 --- a/app/Http/Controllers/Admin/helpdesk/TeamController.php +++ b/app/Http/Controllers/Admin/helpdesk/TeamController.php @@ -143,16 +143,16 @@ class TeamController extends Controller { // dd($request); -// $id = $request->input('show_id'); + // $id = $request->input('show_id'); -// dd($id); + // dd($id); -$users = DB::table('team_assign_agent')->select('team_assign_agent.id', 'team_assign_agent.team_id', 'users.user_name', 'users.first_name', 'users.last_name', 'users.active', 'users.assign_group', 'users.primary_dpt', 'users.role') + $users = DB::table('team_assign_agent')->select('team_assign_agent.id', 'team_assign_agent.team_id', 'users.user_name', 'users.first_name', 'users.last_name', 'users.active', 'users.assign_group', 'users.primary_dpt', 'users.role') ->join('users', 'users.id', '=', 'team_assign_agent.agent_id') ->where('team_assign_agent.team_id', '=', $id); // ->get(); -// dd($users); - return \Datatable::query($users) + // dd($users); + return \Datatable::query($users) ->showColumns('user_name') ->addColumn('first_name', function ($model) { diff --git a/app/Http/Controllers/Admin/helpdesk/TemplateController.php b/app/Http/Controllers/Admin/helpdesk/TemplateController.php index 6158ac4ed..7103f7407 100644 --- a/app/Http/Controllers/Admin/helpdesk/TemplateController.php +++ b/app/Http/Controllers/Admin/helpdesk/TemplateController.php @@ -157,11 +157,11 @@ class TemplateController extends Controller $fname = Input::get('folder_name'); $filename = $directory.$fname; -// images folder creation using php -// $mydir = dirname( __FILE__ )."/html/images"; -// if(!is_dir($mydir)){ -// mkdir("html/images"); -// } + // images folder creation using php + // $mydir = dirname( __FILE__ )."/html/images"; + // if(!is_dir($mydir)){ + // mkdir("html/images"); + // } // Move all images files if (!file_exists($filename)) { diff --git a/app/Http/Controllers/Admin/helpdesk/UrlSettingController.php b/app/Http/Controllers/Admin/helpdesk/UrlSettingController.php index fd8d966b5..6e526bdae 100644 --- a/app/Http/Controllers/Admin/helpdesk/UrlSettingController.php +++ b/app/Http/Controllers/Admin/helpdesk/UrlSettingController.php @@ -91,7 +91,7 @@ RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\n"; public function changeHttp() { //$string = "RewriteCond %{HTTPS} off -//RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\n"; + //RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]\n"; $string = ''; return $string; diff --git a/app/Http/Controllers/Admin/helpdesk/WorkflowController.php b/app/Http/Controllers/Admin/helpdesk/WorkflowController.php index f0756bf77..809a276f8 100644 --- a/app/Http/Controllers/Admin/helpdesk/WorkflowController.php +++ b/app/Http/Controllers/Admin/helpdesk/WorkflowController.php @@ -149,6 +149,7 @@ class WorkflowController extends Controller $email_data["E-$key"] = $email; } $emails = $email_data; + try { return view('themes.default1.admin.helpdesk.manage.workflow.create', compact('emails')); } catch (Exception $e) { diff --git a/app/Http/Controllers/Agent/helpdesk/Filter/FilterController.php b/app/Http/Controllers/Agent/helpdesk/Filter/FilterController.php index 927787da4..2c065b1f7 100644 --- a/app/Http/Controllers/Agent/helpdesk/Filter/FilterController.php +++ b/app/Http/Controllers/Agent/helpdesk/Filter/FilterController.php @@ -232,7 +232,7 @@ class FilterController extends Controller public function table() { // if (Auth::user()->role == 'admin') { - $ticket = new Tickets(); + $ticket = new Tickets(); $tickets = $ticket ->leftJoin('ticket_thread', function ($join) { $join->on('tickets.id', '=', 'ticket_thread.ticket_id') diff --git a/app/Http/Controllers/Agent/helpdesk/TicketController.php b/app/Http/Controllers/Agent/helpdesk/TicketController.php index 732837cc6..7ebf415a4 100644 --- a/app/Http/Controllers/Agent/helpdesk/TicketController.php +++ b/app/Http/Controllers/Agent/helpdesk/TicketController.php @@ -284,24 +284,22 @@ class TicketController extends Controller if ($result[1]) { $status = $this->checkUserVerificationStatus(); if ($status == 1) { - if ($api != false) - { + if ($api != false) { $ticket = Tickets::where('ticket_number', '=', $result[0])->select('id')->first(); + return ['ticket_id' => $ticket->id, 'message' => Lang::get('lang.Ticket-created-successfully')]; } return Redirect('newticket')->with('success', Lang::get('lang.Ticket-created-successfully')); } else { - if ($api != false) - { + if ($api != false) { return response()->json(['success' => Lang::get('lang.Ticket-created-successfully')]); } return Redirect('newticket')->with('success', Lang::get('lang.Ticket-created-successfully2')); } } else { - if ($api != false) - { + if ($api != false) { return response()->json(['error' => Lang::get('lang.failed-to-create-user-tcket-as-mobile-has-been-taken')], 500); } @@ -309,8 +307,7 @@ class TicketController extends Controller } } catch (Exception $e) { dd($e); - if ($api != false) - { + if ($api != false) { return response()->json(['error' => $e->getMessage()], 500); } @@ -403,6 +400,7 @@ class TicketController extends Controller public function reply(Ticket_Thread $thread, Request $request, Ticket_attachments $ta, $mail = true, $system_reply = true, $user_id = '') { \Event::fire('reply.request', [$request]); + try { if (is_array($request->file('attachment'))) { } else { @@ -815,6 +813,7 @@ class TicketController extends Controller } // Event fire \Event::fire(new \App\Events\ReadMailEvent($user_id, $password)); + try { if ($auto_response == 0) { $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $user->first_name, 'email' => $emailadd], $message = ['subject' => null, 'scenario' => 'registration-notification'], $template_variables = ['user' => $user->first_name, 'email_address' => $emailadd, 'user_password' => $password]); @@ -867,6 +866,7 @@ class TicketController extends Controller } } else { $body2 = null; + try { if ($auto_response == 0) { $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['name' => $username, 'email' => $emailadd], $message = ['subject' => $updated_subject, 'scenario' => 'create-ticket'], @@ -1234,10 +1234,10 @@ class TicketController extends Controller } else { $ticket_status = $ticket->where('id', '=', $id)->first(); } - // checking for unautherised access attempt on other than owner ticket id - if ($ticket_status == null) { - return redirect()->route('unauth'); - } + // checking for unautherised access attempt on other than owner ticket id + if ($ticket_status == null) { + return redirect()->route('unauth'); + } $ticket_status->status = 3; $ticket_status->closed = 1; $ticket_status->closed_at = date('Y-m-d H:i:s'); @@ -1265,6 +1265,7 @@ class TicketController extends Controller } else { $from_email = $sending_emails->id; } + try { $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticket_status->dept_id), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'close-ticket'], $template_variables = ['ticket_number' => $ticket_number]); } catch (\Exception $e) { @@ -1501,6 +1502,7 @@ class TicketController extends Controller $agent_email = $user_detail->email; $ticket_link = route('ticket.thread', $id); $master = Auth::user()->first_name.' '.Auth::user()->last_name; + try { $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticket->dept_id), $to = ['name' => $agent, 'email' => $agent_email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'assign-ticket'], $template_variables = ['ticket_agent_name' => $agent, 'ticket_number' => $ticket_number, 'ticket_assigner' => $master, 'ticket_link' => $ticket_link]); } catch (\Exception $e) { @@ -1634,6 +1636,7 @@ class TicketController extends Controller $create_user->password = Hash::make($password); $create_user->save(); $user_id = $create_user->id; + try { $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]); } catch (\Exception $e) { @@ -2321,6 +2324,7 @@ class TicketController extends Controller $user->role = 'user'; if ($user->save()) { $user_id = $user->id; + try { $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'Password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]); } catch (\Exception $e) { diff --git a/app/Http/Controllers/Agent/helpdesk/UserController.php b/app/Http/Controllers/Agent/helpdesk/UserController.php index aeefbd717..a8fe00292 100644 --- a/app/Http/Controllers/Agent/helpdesk/UserController.php +++ b/app/Http/Controllers/Agent/helpdesk/UserController.php @@ -149,7 +149,7 @@ class UserController extends Controller } // displaying list of users with chumper datatables // return \Datatable::collection(User::where('role', "!=", "admin")->get()) - return \Datatables::of($users) + return \Datatables::of($users) /* column username */ ->removeColumn('id', 'last_name', 'country_code', 'phone_number') ->addColumn('user_name', function ($model) { @@ -218,14 +218,14 @@ class UserController extends Controller if (Auth::user()->role == 'admin') { // @if(Auth::user()->role == 'admin') - return ''.\Lang::get('lang.view').''; + return ''.\Lang::get('lang.view').''; } if (Auth::user()->role == 'agent') { // @if(Auth::user()->role == 'admin') - if ($model->role == 'user') { - return ''.\Lang::get('lang.view').''; - } + if ($model->role == 'user') { + return ''.\Lang::get('lang.view').''; + } } } }) @@ -235,7 +235,7 @@ class UserController extends Controller public function restoreUser($id) { // dd($id); - // $delete_all = Input::get('delete_all'); + // $delete_all = Input::get('delete_all'); $users = User::where('id', '=', $id)->first(); $users->is_delete = 0; $users->active = 1; @@ -298,6 +298,7 @@ class UserController extends Controller $password = $this->generateRandomString(); $user->password = Hash::make($password); $user->role = 'user'; + try { if ($request->get('country_code') == '' && ($request->get('phone_number') != '' || $request->get('mobile') != '')) { return redirect()->back()->with(['fails' => Lang::get('lang.country-code-required-error'), 'country_code_error' => 1])->withInput(); @@ -514,19 +515,19 @@ class UserController extends Controller // $ticket_logic4 = User_org::where('user_id', '=', $id)->update(['user_id' => $assign_to[1]]); // } - // $thread2 = Ticket_Thread::where('ticket_id', '=', $ticket->id)->first(); - // $thread2->body = 'This Ticket have been Reassigned to' .' '. $assignee; - // $thread2->save(); - // UserNotification::where('notification_id', '=', $ticket->id)->delete(); - // $users = User::where('id', '=', $id)->get(); - // $organization = User_org::where('user_id', '=', $id)->delete(); - // Assign_team_agent::where('agent_id', '=', $id)->update(['agent_id' => $assign_to[1]]); - $tickets = Tickets::where('assigned_to', '=', $id)->get(); + // $thread2 = Ticket_Thread::where('ticket_id', '=', $ticket->id)->first(); + // $thread2->body = 'This Ticket have been Reassigned to' .' '. $assignee; + // $thread2->save(); + // UserNotification::where('notification_id', '=', $ticket->id)->delete(); + // $users = User::where('id', '=', $id)->get(); + // $organization = User_org::where('user_id', '=', $id)->delete(); + // Assign_team_agent::where('agent_id', '=', $id)->update(['agent_id' => $assign_to[1]]); + $tickets = Tickets::where('assigned_to', '=', $id)->get(); foreach ($tickets as $ticket) { // code... - $ticket->assigned_to = $assign_to[1]; + $ticket->assigned_to = $assign_to[1]; $user_detail = User::where('id', '=', $assign_to[1])->first(); $assignee = $user_detail->first_name.' '.$user_detail->last_name; $ticket_number = $ticket->ticket_number; @@ -561,20 +562,20 @@ class UserController extends Controller } elseif ($delete_all == 1) { if ($delete_all) { // dd('here'); - $tickets = Tickets::where('assigned_to', '=', $id)->get(); - // dd($tickets); - foreach ($tickets as $ticket) { - $ticket->assigned_to = null; - $ticket_number = $ticket->ticket_number; - $ticket->save(); + $tickets = Tickets::where('assigned_to', '=', $id)->get(); + // dd($tickets); + foreach ($tickets as $ticket) { + $ticket->assigned_to = null; + $ticket_number = $ticket->ticket_number; + $ticket->save(); - $thread = new Ticket_Thread(); - $thread->ticket_id = $ticket->id; - $thread->user_id = Auth::user()->id; - $thread->is_internal = 1; - $thread->body = 'This Ticket has been unassigned '; - $thread->save(); - } + $thread = new Ticket_Thread(); + $thread->ticket_id = $ticket->id; + $thread->user_id = Auth::user()->id; + $thread->is_internal = 1; + $thread->body = 'This Ticket has been unassigned '; + $thread->save(); + } // $users = User::where('id', '=', $id)->get(); $user = User::find($id); $users->is_delete = 1; @@ -708,6 +709,7 @@ class UserController extends Controller public function getProfile() { $user = Auth::user(); + try { return view('themes.default1.agent.helpdesk.user.profile', compact('user')); } catch (Exception $e) { @@ -727,6 +729,7 @@ class UserController extends Controller $phonecode = $code->where('iso', '=', $location->iso_code)->first(); $settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first(); $status = $settings->status; + try { return view('themes.default1.agent.helpdesk.user.profile-edit', compact('user')) ->with(['phonecode' => $phonecode->phonecode, @@ -766,13 +769,13 @@ class UserController extends Controller $name = Input::file('profile_pic')->getClientOriginalName(); // dd($name); // dd(str_replace(" ", "_", $name)); - // fetching upload destination path + // fetching upload destination path $destinationPath = 'uploads/profilepic'; - // adding a random value to profile picture filename + // adding a random value to profile picture filename $fileName = rand(0000, 9999).'.'.str_replace(' ', '_', $name); - // moving the picture to a destination folder + // moving the picture to a destination folder Input::file('profile_pic')->move($destinationPath, $fileName); - // saving filename to database + // saving filename to database $user->profile_pic = $fileName; } if ($request->get('mobile')) { @@ -805,6 +808,7 @@ class UserController extends Controller // checking if the old password matches the new password if (Hash::check($request->input('old_password'), $user->getAuthPassword())) { $user->password = Hash::make($request->input('new_password')); + try { $user->save(); diff --git a/app/Http/Controllers/Agent/kb/PageController.php b/app/Http/Controllers/Agent/kb/PageController.php index 92a74e1c3..104290086 100644 --- a/app/Http/Controllers/Agent/kb/PageController.php +++ b/app/Http/Controllers/Agent/kb/PageController.php @@ -51,6 +51,7 @@ class PageController extends Controller { $pages = $this->page->paginate(3); $pages->setPath('page'); + try { return view('themes.default1.agent.kb.pages.index', compact('pages')); } catch (Exception $e) { @@ -128,6 +129,7 @@ class PageController extends Controller $sl = $request->input('name'); $slug = str_slug($sl, '-'); $this->page->slug = $slug; + try { $this->page->fill($request->input())->save(); @@ -169,6 +171,7 @@ class PageController extends Controller $pages = $this->page->where('slug', $slug)->first(); $sl = $request->input('name'); $slug = str_slug($sl, '-'); + try { $pages->fill($request->all())->save(); $pages->slug = $slug; diff --git a/app/Http/Controllers/Api/v1/ApiController.php b/app/Http/Controllers/Api/v1/ApiController.php index 8dfb10630..b77369fb7 100644 --- a/app/Http/Controllers/Api/v1/ApiController.php +++ b/app/Http/Controllers/Api/v1/ApiController.php @@ -36,7 +36,6 @@ use Illuminate\Support\Collection; */ class ApiController extends Controller { - public $user; public $request; public $ticket; @@ -62,60 +61,54 @@ class ApiController extends Controller $this->middleware('jwt.auth'); $this->middleware('api', ['except' => 'GenerateApiKey']); - try - { - $user = \JWTAuth::parseToken()->authenticate(); + + try { + $user = \JWTAuth::parseToken()->authenticate(); $this->user = $user; - } - catch (\Tymon\JWTAuth\Exceptions\TokenExpiredException $e) - { - - } - catch (\Tymon\JWTAuth\Exceptions\JWTException $e) - { - + } catch (\Tymon\JWTAuth\Exceptions\TokenExpiredException $e) { + } catch (\Tymon\JWTAuth\Exceptions\JWTException $e) { } - $ticket = new TicketController(); + $ticket = new TicketController(); $this->ticket = $ticket; - $model = new Tickets(); + $model = new Tickets(); $this->model = $model; - $thread = new Ticket_Thread(); + $thread = new Ticket_Thread(); $this->thread = $thread; - $attach = new Ticket_attachments(); + $attach = new Ticket_attachments(); $this->attach = $attach; - $ticketRequest = new TicketRequest(); + $ticketRequest = new TicketRequest(); $this->ticketRequest = $ticketRequest; - $faveoUser = new User(); + $faveoUser = new User(); $this->faveoUser = $faveoUser; - $faveoUser = new User(); + $faveoUser = new User(); $this->user = $faveoUser; - $team = new Teams(); + $team = new Teams(); $this->team = $team; - $setting = new System(); + $setting = new System(); $this->setting = $setting; - $helptopic = new Help_topic(); + $helptopic = new Help_topic(); $this->helptopic = $helptopic; - $slaPlan = new Sla_plan(); + $slaPlan = new Sla_plan(); $this->slaPlan = $slaPlan; - $priority = new Priority(); + $priority = new Priority(); $this->priority = $priority; - $department = new Department(); + $department = new Department(); $this->department = $department; - $source = new Ticket_source(); + $source = new Ticket_source(); $this->source = $source; } @@ -130,37 +123,35 @@ class ApiController extends Controller */ public function createTicket(\App\Http\Requests\helpdesk\CreateTicketRequest $request, \App\Model\helpdesk\Utility\CountryCode $code) { - try - { + try { $user_id = $this->request->input('user_id'); - $subject = $this->request->input('subject'); - $body = $this->request->input('body'); + $subject = $this->request->input('subject'); + $body = $this->request->input('body'); $helptopic = $this->request->input('helptopic'); - $sla = $this->request->input('sla'); - $priority = $this->request->input('priority'); - $header = $this->request->input('cc'); - $dept = $this->request->input('dept'); + $sla = $this->request->input('sla'); + $priority = $this->request->input('priority'); + $header = $this->request->input('cc'); + $dept = $this->request->input('dept'); - $assignto = $this->request->input('assignto'); + $assignto = $this->request->input('assignto'); $form_data = $this->request->input('form_data'); - $source = $this->request->input('source'); - $attach = $this->request->input('attachments'); - $headers = []; - if ($header) - { + $source = $this->request->input('source'); + $attach = $this->request->input('attachments'); + $headers = []; + if ($header) { $headers = explode(',', $header); } //return $headers; /* * return s ticket number */ - $PhpMailController = new \App\Http\Controllers\Common\PhpMailController(); + $PhpMailController = new \App\Http\Controllers\Common\PhpMailController(); $NotificationController = new \App\Http\Controllers\Common\NotificationController(); - $core = new CoreTicketController($PhpMailController, $NotificationController); + $core = new CoreTicketController($PhpMailController, $NotificationController); $this->request->merge(['body' => preg_replace('/[ ](?=[^>]*(?:<|$))/', ' ', nl2br($this->request->get('body')))]); $request->replace($this->request->except('token', 'api_key')); - $response = $core->post_newticket($request, $code, true); + $response = $core->post_newticket($request, $code, true); //$response = $this->ticket->createTicket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data, $attach); //return $response; /* @@ -170,17 +161,13 @@ class ApiController extends Controller //$result = $this->thread->where('id', $response)->first(); //$result = $this->attach($result->id,$file); return response()->json(compact('response')); - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')) @@ -198,14 +185,12 @@ class ApiController extends Controller public function ticketReply() { //dd($this->request->all()); - try - { + try { $v = \Validator::make($this->request->all(), [ 'ticket_ID' => 'required|exists:tickets,id', 'reply_content' => 'required', ]); - if ($v->fails()) - { + if ($v->fails()) { $error = $v->errors(); return response()->json(compact('error')); @@ -218,17 +203,13 @@ class ApiController extends Controller ->first(); return response()->json(compact('result')); - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -242,8 +223,7 @@ class ApiController extends Controller */ public function editTicket() { - try - { + try { $v = \Validator::make($this->request->all(), [ 'ticket_id' => 'required|exists:tickets,id', 'subject' => 'required', @@ -252,25 +232,21 @@ class ApiController extends Controller 'ticket_source' => 'required|exists:ticket_source,id', 'ticket_priority' => 'required|exists:ticket_priority,priority_id', ]); - if ($v->fails()) - { + if ($v->fails()) { $error = $v->errors(); return response()->json(compact('error')); } $ticket_id = $this->request->input('ticket_id'); + return $this->ticket->ticketEditPost($ticket_id, $this->thread, $this->model); - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -284,13 +260,11 @@ class ApiController extends Controller */ public function deleteTicket() { - try - { + try { $v = \Validator::make($this->request->all(), [ 'ticket_id' => 'required|exists:tickets,id', ]); - if ($v->fails()) - { + if ($v->fails()) { $error = $v->errors(); return response()->json(compact('error')); @@ -300,17 +274,13 @@ class ApiController extends Controller $result = $this->ticket->delete(explode(',', $id), $this->model); return response()->json(compact('result')); - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -324,23 +294,20 @@ class ApiController extends Controller */ public function openedTickets() { - try - { + try { // $result = $this->model->where('status', '=', 1)->where('isanswered', '=', 0)->where('assigned_to', '=', null)->orderBy('id', 'DESC')->get(); // return response()->json(compact('result')); - $result = $this->user->join('tickets', function ($join) - { - $join->on('users.id', '=', 'tickets.user_id') + $result = $this->user->join('tickets', function ($join) { + $join->on('users.id', '=', 'tickets.user_id') ->where('isanswered', '=', 0)->where('status', '=', 1)->whereNull('assigned_to'); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') ->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id') ->join('ticket_status', 'ticket_status.id', '=', 'tickets.status') - ->join('ticket_thread', function ($join) - { + ->join('ticket_thread', function ($join) { $join->on('tickets.id', '=', 'ticket_thread.ticket_id') ->whereNotNull('title'); }) @@ -352,17 +319,13 @@ class ApiController extends Controller ->toJson(); return $result; - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -376,33 +339,28 @@ class ApiController extends Controller */ public function unassignedTickets() { - try - { + try { //dd('sdhjbc'); // $result = $this->model->where('assigned_to', '=', null)->where('status', '1')->orderBy('id', 'DESC')->get(); // return response()->json(compact('result')); - $user = \JWTAuth::parseToken()->authenticate(); - $unassigned = $this->user->join('tickets', function ($join) - { - $join->on('users.id', '=', 'tickets.user_id') + $user = \JWTAuth::parseToken()->authenticate(); + $unassigned = $this->user->join('tickets', function ($join) { + $join->on('users.id', '=', 'tickets.user_id') ->whereNull('assigned_to')->where('status', '=', 1); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') ->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id') ->join('ticket_status', 'ticket_status.id', '=', 'tickets.status') - ->leftJoin('ticket_thread', function ($join) - { + ->leftJoin('ticket_thread', function ($join) { $join->on('tickets.id', '=', 'ticket_thread.ticket_id'); }) ->leftJoin('ticket_attachment', 'ticket_attachment.thread_id', '=', 'ticket_thread.id'); - if ($user->role == 'agent') - { - $id = $user->id; - $dept = \DB::table('department_assign_agents')->where('agent_id', '=', $id)->pluck('department_id')->toArray(); - $unassigned = $unassigned->where(function ($query) use ($dept, $id) - { + if ($user->role == 'agent') { + $id = $user->id; + $dept = \DB::table('department_assign_agents')->where('agent_id', '=', $id)->pluck('department_id')->toArray(); + $unassigned = $unassigned->where(function ($query) use ($dept, $id) { $query->whereIn('tickets.dept_id', $dept) ->orWhere('assigned_to', '=', $id); }); @@ -415,17 +373,13 @@ class ApiController extends Controller ->toJson(); return $unassigned; - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -439,32 +393,27 @@ class ApiController extends Controller */ public function closeTickets() { - try - { + try { // $result = $this->model->where('status', '>', 1)->where('status', '<', 4)->orderBy('id', 'DESC')->get(); // return response()->json(compact('result')); - $user = \JWTAuth::parseToken()->authenticate(); - $result = $this->user->join('tickets', function ($join) - { - $join->on('users.id', '=', 'tickets.user_id') + $user = \JWTAuth::parseToken()->authenticate(); + $result = $this->user->join('tickets', function ($join) { + $join->on('users.id', '=', 'tickets.user_id') ->where('status', '=', 3)->orWhere('status', '=', 2); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') ->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id') ->join('ticket_status', 'ticket_status.id', '=', 'tickets.status') - ->leftJoin('ticket_thread', function ($join) - { + ->leftJoin('ticket_thread', function ($join) { $join->on('tickets.id', '=', 'ticket_thread.ticket_id'); }) ->leftJoin('ticket_attachment', 'ticket_attachment.thread_id', '=', 'ticket_thread.id'); - if ($user->role == 'agent') - { - $id = $user->id; - $dept = \DB::table('department_assign_agents')->where('agent_id', '=', $id)->pluck('department_id')->toArray(); - $result = $result->where(function ($query) use ($dept, $id) - { + if ($user->role == 'agent') { + $id = $user->id; + $dept = \DB::table('department_assign_agents')->where('agent_id', '=', $id)->pluck('department_id')->toArray(); + $result = $result->where(function ($query) use ($dept, $id) { $query->whereIn('tickets.dept_id', $dept) ->orWhere('assigned_to', '=', $id); }); @@ -477,17 +426,13 @@ class ApiController extends Controller ->toJson(); return $result; - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -501,22 +446,17 @@ class ApiController extends Controller */ public function getAgents() { - try - { + try { $result = $this->faveoUser->where('role', 'agent')->orWhere('role', 'admin')->where('active', 1)->get(); return response()->json(compact('result')); - } - catch (Exception $e) - { + } catch (Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -530,22 +470,17 @@ class ApiController extends Controller */ public function getTeams() { - try - { + try { $result = $this->team->get(); return response()->json(compact('result')); - } - catch (Exception $e) - { + } catch (Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -559,41 +494,32 @@ class ApiController extends Controller */ public function assignTicket() { - try - { + try { $v = \Validator::make($this->request->all(), [ 'ticket_id' => 'required', 'user' => 'required', ]); - if ($v->fails()) - { + if ($v->fails()) { $error = $v->errors(); return response()->json(compact('error')); } - $id = $this->request->input('ticket_id'); + $id = $this->request->input('ticket_id'); $response = $this->ticket->assign($id); - if ($response == 1) - { + if ($response == 1) { $result = 'success'; return response()->json(compact('result')); - } - else - { + } else { return response()->json(compact('response')); } - } - catch (Exception $e) - { + } catch (Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -607,33 +533,27 @@ class ApiController extends Controller */ public function getCustomers() { - try - { + try { $v = \Validator::make($this->request->all(), [ 'search' => 'required', ]); - if ($v->fails()) - { + if ($v->fails()) { $error = $v->errors(); return response()->json(compact('error')); } $search = $this->request->input('search'); - $result = $this->faveoUser->where('first_name', 'like', '%' . $search . '%')->orWhere('last_name', 'like', '%' . $search . '%')->orWhere('user_name', 'like', '%' . $search . '%')->orWhere('email', 'like', '%' . $search . '%')->get(); + $result = $this->faveoUser->where('first_name', 'like', '%'.$search.'%')->orWhere('last_name', 'like', '%'.$search.'%')->orWhere('user_name', 'like', '%'.$search.'%')->orWhere('email', 'like', '%'.$search.'%')->get(); return response()->json(compact('result')) ->header('X-Header-One', 'Header Value'); - } - catch (Exception $e) - { + } catch (Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')) @@ -648,8 +568,7 @@ class ApiController extends Controller */ public function getCustomersWith() { - try - { + try { $users = $this->user ->leftJoin('user_assign_organization', 'user_assign_organization.user_id', '=', 'users.id') ->leftJoin('organization', 'organization.id', '=', 'user_assign_organization.org_id') @@ -660,17 +579,13 @@ class ApiController extends Controller //dd($users); return $users; - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')) @@ -685,32 +600,26 @@ class ApiController extends Controller */ public function getCustomer() { - try - { + try { $v = \Validator::make($this->request->all(), [ 'user_id' => 'required', ]); - if ($v->fails()) - { + if ($v->fails()) { $error = $v->errors(); return response()->json(compact('error')); } - $id = $this->request->input('user_id'); + $id = $this->request->input('user_id'); $result = $this->faveoUser->where('id', $id)->where('role', 'user')->first(); return response()->json(compact('result')); - } - catch (Exception $e) - { + } catch (Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -724,32 +633,26 @@ class ApiController extends Controller */ public function searchTicket() { - try - { + try { $v = \Validator::make($this->request->all(), [ 'search' => 'required', ]); - if ($v->fails()) - { + if ($v->fails()) { $error = $v->errors(); return response()->json(compact('error')); } $search = $this->request->input('search'); - $result = $this->thread->select('ticket_id')->where('title', 'like', '%' . $search . '%')->orWhere('body', 'like', '%' . $search . '%')->get(); + $result = $this->thread->select('ticket_id')->where('title', 'like', '%'.$search.'%')->orWhere('body', 'like', '%'.$search.'%')->get(); return response()->json(compact('result')); - } - catch (Exception $e) - { + } catch (Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -763,18 +666,16 @@ class ApiController extends Controller */ public function ticketThreads() { - try - { + try { $v = \Validator::make($this->request->all(), [ 'id' => 'required', ]); - if ($v->fails()) - { + if ($v->fails()) { $error = $v->errors(); return response()->json(compact('error')); } - $id = $this->request->input('id'); + $id = $this->request->input('id'); $result = $this->user ->rightjoin('ticket_thread', 'ticket_thread.user_id', '=', 'users.id') ->select('ticket_thread.id', 'ticket_id', 'user_id', 'poster', 'source', 'title', 'body', 'is_internal', 'format', 'ip_address', 'ticket_thread.created_at', 'ticket_thread.updated_at', 'users.first_name', 'users.last_name', 'users.user_name', 'users.email', 'users.profile_pic') @@ -784,17 +685,13 @@ class ApiController extends Controller ->toJson(); return $result; - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -809,37 +706,30 @@ class ApiController extends Controller public function checkUrl() { //dd($this->request); - try - { + try { $v = \Validator::make($this->request->all(), [ 'url' => 'required|url', ]); - if ($v->fails()) - { + if ($v->fails()) { $error = $v->errors(); return response()->json(compact('error')); } $url = $this->request->input('url'); - if (!str_is('*/', $url)) - { + if (!str_is('*/', $url)) { $url = str_finish($url, '/'); } - $url = $url . '/api/v1/helpdesk/check-url?api_key=' . $this->request->input('api_key') . '&token=' . \Config::get('app.token'); + $url = $url.'/api/v1/helpdesk/check-url?api_key='.$this->request->input('api_key').'&token='.\Config::get('app.token'); $result = $this->CallGetApi($url); //dd($result); return response()->json(compact('result')); - } - catch (\Exception $ex) - { + } catch (\Exception $ex) { $error = $e->getMessage(); return response()->json(compact('error')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -865,16 +755,15 @@ class ApiController extends Controller */ public function callGetApi($url) { - $curl = curl_init($url); + $curl = curl_init($url); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HEADER, 0); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl); - if (curl_errno($curl)) - { - echo 'error:' . curl_error($curl); + if (curl_errno($curl)) { + echo 'error:'.curl_error($curl); } return $response; @@ -891,7 +780,7 @@ class ApiController extends Controller */ public function callPostApi($url, $data) { - $curl = curl_init($url); + $curl = curl_init($url); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HEADER, 0); @@ -899,9 +788,8 @@ class ApiController extends Controller curl_setopt($curl, CURLOPT_POSTFIELDS, $data); $response = curl_exec($curl); - if (curl_errno($curl)) - { - echo 'error:' . curl_error($curl); + if (curl_errno($curl)) { + echo 'error:'.curl_error($curl); } return $response; @@ -915,36 +803,28 @@ class ApiController extends Controller */ public function generateApiKey() { - try - { + try { $set = $this->setting->where('id', '1')->first(); //dd($set); - if ($set->api_enable == 1) - { - $key = str_random(32); + if ($set->api_enable == 1) { + $key = str_random(32); $set->api_key = $key; $set->save(); - $result = $set->api_key; + $result = $set->api_key; return response()->json(compact('result')); - } - else - { + } else { $result = 'please enable api'; return response()->json(compact('result')); } - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -958,22 +838,17 @@ class ApiController extends Controller */ public function getHelpTopic() { - try - { + try { $result = $this->helptopic->get(); return response()->json(compact('result')); - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -987,22 +862,17 @@ class ApiController extends Controller */ public function getSlaPlan() { - try - { + try { $result = $this->slaPlan->get(); return response()->json(compact('result')); - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -1016,22 +886,17 @@ class ApiController extends Controller */ public function getPriority() { - try - { + try { $result = $this->priority->select('priority as name', 'priority_id as id')->get(); return response()->json(compact('result')); - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -1045,22 +910,17 @@ class ApiController extends Controller */ public function getDepartment() { - try - { + try { $result = $this->department->get(); return response()->json(compact('result')); - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -1074,23 +934,18 @@ class ApiController extends Controller */ public function getTickets() { - try - { + try { $tickets = $this->model->orderBy('created_at', 'desc')->paginate(10); $tickets->toJson(); return $tickets; - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -1104,31 +959,26 @@ class ApiController extends Controller */ public function inbox() { - try - { - $user = \JWTAuth::parseToken()->authenticate(); - $inbox = $this->user->join('tickets', function ($join) - { - $join->on('users.id', '=', 'tickets.user_id') + try { + $user = \JWTAuth::parseToken()->authenticate(); + $inbox = $this->user->join('tickets', function ($join) { + $join->on('users.id', '=', 'tickets.user_id') ->where('status', '=', 1); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') ->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id') ->join('ticket_status', 'ticket_status.id', '=', 'tickets.status') - ->leftJoin('ticket_thread', function ($join) - { + ->leftJoin('ticket_thread', function ($join) { $join->on('tickets.id', '=', 'ticket_thread.ticket_id'); }) ->leftJoin('ticket_attachment', 'ticket_attachment.thread_id', '=', 'ticket_thread.id') ->where('ticket_status.name', 'Open'); - if ($user->role == 'agent') - { - $id = $user->id; - $dept = \DB::table('department_assign_agents')->where('agent_id', '=', $id)->pluck('department_id')->toArray(); - $inbox = $inbox->where(function ($query) use ($dept, $id) - { + if ($user->role == 'agent') { + $id = $user->id; + $dept = \DB::table('department_assign_agents')->where('agent_id', '=', $id)->pluck('department_id')->toArray(); + $inbox = $inbox->where(function ($query) use ($dept, $id) { $query->whereIn('tickets.dept_id', $dept) ->orWhere('assigned_to', '=', $id); }); @@ -1141,17 +991,13 @@ class ApiController extends Controller ->toJson(); return $inbox; - } - catch (\Exception $ex) - { + } catch (\Exception $ex) { $error = $ex->getMessage(); - $line = $ex->getLine(); - $file = $ex->getFile(); + $line = $ex->getLine(); + $file = $ex->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -1165,37 +1011,31 @@ class ApiController extends Controller */ public function internalNote() { - try - { + try { $v = \Validator::make($this->request->all(), [ 'userid' => 'required|exists:users,id', 'ticketid' => 'required|exists:tickets,id', 'body' => 'required', ]); - if ($v->fails()) - { + if ($v->fails()) { $error = $v->errors(); return response()->json(compact('error')); } - $userid = $this->request->input('userid'); + $userid = $this->request->input('userid'); $ticketid = $this->request->input('ticketid'); - $body = preg_replace('/[ ](?=[^>]*(?:<|$))/', ' ', nl2br($this->request->input('body'))); + $body = preg_replace('/[ ](?=[^>]*(?:<|$))/', ' ', nl2br($this->request->input('body'))); $thread = $this->thread->create(['ticket_id' => $ticketid, 'user_id' => $userid, 'is_internal' => 1, 'body' => $body]); return response()->json(compact('thread')); - } - catch (\Exception $ex) - { + } catch (\Exception $ex) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -1204,30 +1044,25 @@ class ApiController extends Controller public function getTrash() { - try - { - $user = \JWTAuth::parseToken()->authenticate(); - $trash = $this->user->join('tickets', function ($join) - { - $join->on('users.id', '=', 'tickets.user_id') + try { + $user = \JWTAuth::parseToken()->authenticate(); + $trash = $this->user->join('tickets', function ($join) { + $join->on('users.id', '=', 'tickets.user_id') ->where('status', '=', 5); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') ->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id') ->join('ticket_status', 'ticket_status.id', '=', 'tickets.status') - ->leftJoin('ticket_thread', function ($join) - { + ->leftJoin('ticket_thread', function ($join) { $join->on('tickets.id', '=', 'ticket_thread.ticket_id'); }) ->leftJoin('ticket_attachment', 'ticket_attachment.thread_id', '=', 'ticket_thread.id'); - if ($user->role == 'agent') - { - $id = $user->id; - $dept = \DB::table('department_assign_agents')->where('agent_id', '=', $id)->pluck('department_id')->toArray(); - $trash = $trash->where(function ($query) use ($dept, $id) - { + if ($user->role == 'agent') { + $id = $user->id; + $dept = \DB::table('department_assign_agents')->where('agent_id', '=', $id)->pluck('department_id')->toArray(); + $trash = $trash->where(function ($query) use ($dept, $id) { $query->whereIn('tickets.dept_id', $dept) ->orWhere('assigned_to', '=', $id); }); @@ -1240,17 +1075,13 @@ class ApiController extends Controller ->toJson(); return $trash; - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -1259,39 +1090,34 @@ class ApiController extends Controller public function getMyTicketsAgent() { - try - { + try { $v = \Validator::make($this->request->all(), [ 'user_id' => 'required|exists:users,id', ]); - if ($v->fails()) - { + if ($v->fails()) { $error = $v->errors(); return response()->json(compact('error')); } $id = $this->request->input('user_id'); - if ($this->user->where('id', $id)->first()->role == 'user') - { + if ($this->user->where('id', $id)->first()->role == 'user') { $error = 'This user is not an Agent or Admin'; return response()->json(compact('error')); } //$user = \JWTAuth::parseToken()->authenticate(); - $result = $this->user->join('tickets', function ($join) use ($id) - { - $join->on('users.id', '=', 'tickets.assigned_to') + $result = $this->user->join('tickets', function ($join) use ($id) { + $join->on('users.id', '=', 'tickets.assigned_to') ->where('status', '=', 1); - //->where('user_id', '=', $id); - }) + //->where('user_id', '=', $id); + }) ->join('users as client', 'tickets.user_id', '=', 'client.id') ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') ->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id') ->join('ticket_status', 'ticket_status.id', '=', 'tickets.status') - ->leftJoin('ticket_thread', function ($join) - { + ->leftJoin('ticket_thread', function ($join) { $join->on('tickets.id', '=', 'ticket_thread.ticket_id'); }) ->leftJoin('ticket_attachment', 'ticket_attachment.thread_id', '=', 'ticket_thread.id') @@ -1306,17 +1132,13 @@ class ApiController extends Controller ->toJson(); return $result; - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -1325,20 +1147,17 @@ class ApiController extends Controller public function getMyTicketsUser() { - try - { + try { $v = \Validator::make($this->request->all(), [ 'user_id' => 'required|exists:users,id', ]); - if ($v->fails()) - { + if ($v->fails()) { $error = $v->errors(); return response()->json(compact('error')); } $id = $this->request->input('user_id'); - if ($this->user->where('id', $id)->first()->role == 'admin' || $this->user->where('id', $id)->first()->role == 'agent') - { + if ($this->user->where('id', $id)->first()->role == 'admin' || $this->user->where('id', $id)->first()->role == 'agent') { $error = 'This is not a client'; return response()->json(compact('error')); @@ -1349,18 +1168,16 @@ class ApiController extends Controller ->select( 'users.first_name', 'users.last_name', 'users.user_name', 'users.email', 'users.id', 'users.profile_pic', 'users.ban', 'users.active', 'users.is_delete', 'users.phone_number', 'users.ext', 'users.country_code', 'users.mobile', 'organization.name as company' )->first()->toArray(); - $result = $this->user->join('tickets', function ($join) use ($id) - { - $join->on('users.id', '=', 'tickets.user_id') + $result = $this->user->join('tickets', function ($join) use ($id) { + $join->on('users.id', '=', 'tickets.user_id') ->where('user_id', '=', $id); - }) + }) ->join('department', 'department.id', '=', 'tickets.dept_id') ->join('ticket_priority', 'ticket_priority.priority_id', '=', 'tickets.priority_id') ->join('sla_plan', 'sla_plan.id', '=', 'tickets.sla') ->join('help_topic', 'help_topic.id', '=', 'tickets.help_topic_id') ->join('ticket_status', 'ticket_status.id', '=', 'tickets.status') - ->join('ticket_thread', function ($join) - { + ->join('ticket_thread', function ($join) { $join->on('tickets.id', '=', 'ticket_thread.ticket_id') ->whereNotNull('title'); }) @@ -1372,17 +1189,13 @@ class ApiController extends Controller ->toArray(); return response()->json(['tickets' => $result, 'requester' => $user]); - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -1391,26 +1204,22 @@ class ApiController extends Controller public function getTicketById() { - try - { + try { $v = \Validator::make($this->request->all(), [ 'id' => 'required|exists:tickets,id', ]); - if ($v->fails()) - { + if ($v->fails()) { $error = $v->errors(); return response()->json(compact('error')); } $id = $this->request->input('id'); - if (!$this->model->where('id', $id)->first()) - { - $error = 'There is no Ticket as ticket id: ' . $id; + if (!$this->model->where('id', $id)->first()) { + $error = 'There is no Ticket as ticket id: '.$id; return response()->json(compact('error')); } - $query = $this->user->join('tickets', function ($join) use ($id) - { + $query = $this->user->join('tickets', function ($join) use ($id) { $join->on('users.id', '=', 'tickets.user_id') ->where('tickets.id', '=', $id); }); @@ -1427,17 +1236,13 @@ class ApiController extends Controller 'users.email', 'users.user_name', 'users.first_name', 'users.last_name', 'tickets.id', 'ticket_number', 'user_id', 'ticket_priority.priority_id', 'ticket_priority.priority as priority_name', 'department.name as dept_name', 'ticket_status.name as status_name', 'sla_plan.name as sla_name', 'ticket_source.name as source_name', 'sla_plan.id as sla', 'ticket_status.id as status', 'lock_by', 'lock_at', 'ticket_source.id as source', 'isoverdue', 'reopened', 'isanswered', 'is_deleted', 'closed', 'reopened_at', 'duedate', 'closed_at', 'tickets.created_at', 'tickets.updated_at')->first(); return response()->json(compact('result')); - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -1446,8 +1251,7 @@ class ApiController extends Controller public function createPagination($array, $perPage) { - try - { + try { //Get current page form url e.g. &page=6 $currentPage = LengthAwarePaginator::resolveCurrentPage(); @@ -1461,17 +1265,13 @@ class ApiController extends Controller $paginatedResults = new LengthAwarePaginator($currentPageSearchResults, count($collection), $perPage); return $paginatedResults; - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (\TokenExpiredException $e) - { + } catch (\TokenExpiredException $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -1481,31 +1281,27 @@ class ApiController extends Controller public function collaboratorSearch() { $this->validate($this->request, ['term' => 'required']); - try - { + + try { $emails = $this->ticket->autosearch(); //return $emails; - $user = new User(); - if (count($emails) > 0) - { - foreach ($emails as $key => $email) - { - $user_model = $user->where('email', $email)->first(); + $user = new User(); + if (count($emails) > 0) { + foreach ($emails as $key => $email) { + $user_model = $user->where('email', $email)->first(); //return $user_model; - $users[$key]['name'] = $user_model->first_name . ' ' . $user_model->last_name; - $users[$key]['email'] = $email; + $users[$key]['name'] = $user_model->first_name.' '.$user_model->last_name; + $users[$key]['email'] = $email; $users[$key]['avatar'] = $this->avatarUrl($email); } } //return $users; return response()->json(compact('users')); - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); } @@ -1513,23 +1309,17 @@ class ApiController extends Controller public function avatarUrl($email) { - try - { + try { $user = new User(); $user = $user->where('email', $email)->first(); - if ($user->profile_pic) - { - $url = url('uploads/profilepic/' . $user->profile_pic); - } - else - { + if ($user->profile_pic) { + $url = url('uploads/profilepic/'.$user->profile_pic); + } else { $url = \Gravatar::src($email); } return $url; - } - catch (\Exception $ex) - { + } catch (\Exception $ex) { //return $ex->getMessage(); throw new \Exception($ex->getMessage()); } @@ -1537,15 +1327,13 @@ class ApiController extends Controller public function addCollaboratorForTicket() { - try - { + try { $v = \Validator::make(\Input::get(), [ 'email' => 'required|email|unique:users', 'ticket_id' => 'required', ] ); - if ($v->fails()) - { + if ($v->fails()) { $error = $v->messages(); return response()->json(compact('error')); @@ -1553,20 +1341,16 @@ class ApiController extends Controller $collaborator = $this->ticket->useradd(); return response()->json(compact('collaborator')); - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (Tymon\JWTAuth\Exceptions\TokenExpiredException $ex) - { + } catch (Tymon\JWTAuth\Exceptions\TokenExpiredException $ex) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); } @@ -1574,14 +1358,12 @@ class ApiController extends Controller public function getCollaboratorForTicket() { - try - { + try { $v = \Validator::make(\Input::get(), [ 'ticket_id' => 'required', ] ); - if ($v->fails()) - { + if ($v->fails()) { $error = $v->messages(); return response()->json(compact('error')); @@ -1589,20 +1371,16 @@ class ApiController extends Controller $collaborator = $this->ticket->getCollaboratorForTicket(); return response()->json(compact('collaborator')); - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (Tymon\JWTAuth\Exceptions\TokenExpiredException $ex) - { + } catch (Tymon\JWTAuth\Exceptions\TokenExpiredException $ex) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); } @@ -1610,15 +1388,13 @@ class ApiController extends Controller public function deleteCollaborator() { - try - { + try { $v = \Validator::make(\Input::get(), [ 'ticketid' => 'required', 'email' => 'required', ] ); - if ($v->fails()) - { + if ($v->fails()) { $result = $v->messages(); return response()->json(compact('result')); @@ -1626,12 +1402,10 @@ class ApiController extends Controller $collaborator = $this->ticket->userremove(); return response()->json(compact('collaborator')); - } - catch (\Exception $ex) - { + } catch (\Exception $ex) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); } @@ -1639,79 +1413,68 @@ class ApiController extends Controller public function dependency() { - try - { - $user = \JWTAuth::parseToken()->authenticate(); + try { + $user = \JWTAuth::parseToken()->authenticate(); $tickets = \DB::table('tickets'); - if ($user->role == 'agent') - { - $id = $user->id; - $dept = DepartmentAssignAgents::where('agent_id', '=', $id)->pluck('department_id')->toArray(); + if ($user->role == 'agent') { + $id = $user->id; + $dept = DepartmentAssignAgents::where('agent_id', '=', $id)->pluck('department_id')->toArray(); $tickets = $tickets->whereIn('tickets.dept_id', $dept)->orWhere('assigned_to', '=', $user->id); } $department = $this->department->select('name', 'id')->get()->toArray(); - $sla = $this->slaPlan->select('name', 'id')->get()->toArray(); - $staff = $this->user->where('role', 'agent')->select('email', 'id')->get()->toArray(); - $team = $this->team->select('name', 'id')->get()->toArray(); - $priority = \DB::table('ticket_priority')->select('priority', 'priority_id')->get(); - $helptopic = $this->helptopic->select('topic', 'id')->get()->toArray(); - $status = \DB::table('ticket_status')->select('name', 'id')->get(); - $source = \DB::table('ticket_source')->select('name', 'id')->get(); - $statuses = collect($tickets + $sla = $this->slaPlan->select('name', 'id')->get()->toArray(); + $staff = $this->user->where('role', 'agent')->select('email', 'id')->get()->toArray(); + $team = $this->team->select('name', 'id')->get()->toArray(); + $priority = \DB::table('ticket_priority')->select('priority', 'priority_id')->get(); + $helptopic = $this->helptopic->select('topic', 'id')->get()->toArray(); + $status = \DB::table('ticket_status')->select('name', 'id')->get(); + $source = \DB::table('ticket_source')->select('name', 'id')->get(); + $statuses = collect($tickets ->join('ticket_status', 'tickets.status', '=', 'ticket_status.id') ->select('ticket_status.name as status', \DB::raw('COUNT(tickets.id) as count')) ->groupBy('ticket_status.id') - ->get())->transform(function ($item) - { - return ['name' => ucfirst($item->status), 'count' => $item->count]; - }); - $unassigned = $this->user->leftJoin('tickets', function ($join) - { - $join->on('users.id', '=', 'tickets.user_id') + ->get())->transform(function ($item) { + return ['name' => ucfirst($item->status), 'count' => $item->count]; + }); + $unassigned = $this->user->leftJoin('tickets', function ($join) { + $join->on('users.id', '=', 'tickets.user_id') ->whereNull('assigned_to')->where('status', '=', 1); - }) - ->where(function($query) use($user) - { - if ($user->role != 'admin') - { + }) + ->where(function ($query) use ($user) { + if ($user->role != 'admin') { $query->where('tickets.dept_id', '=', $user->primary_dpt); } }) ->select(\DB::raw('COUNT(tickets.id) as unassined')) ->value('unassined'); - $mytickets = $this->user->leftJoin('tickets', function ($join) use ($user) - { - $join->on('users.id', '=', 'tickets.assigned_to') + $mytickets = $this->user->leftJoin('tickets', function ($join) use ($user) { + $join->on('users.id', '=', 'tickets.assigned_to') ->where('tickets.assigned_to', '=', $user->id)->where('status', '=', 1); - }) - ->where(function ($query) use ($user) - { - if ($user->role != 'admin') - { + }) + ->where(function ($query) use ($user) { + if ($user->role != 'admin') { $query->where('tickets.dept_id', '=', $user->primary_dpt)->orWhere('assigned_to', '=', $user->id); } }) ->select(\DB::raw('COUNT(tickets.id) as my_ticket')) ->value('my_ticket'); - $depend = collect([['name' => 'unassigned', 'count' => $unassigned], ['name' => 'mytickets', 'count' => $mytickets]]); + $depend = collect([['name' => 'unassigned', 'count' => $unassigned], ['name' => 'mytickets', 'count' => $mytickets]]); $collection = $statuses->merge($depend); - $result = ['departments' => $department, 'sla' => $sla, 'staffs' => $staff, 'teams' => $team, - 'priorities' => $priority, 'helptopics' => $helptopic, - 'status' => $status, - 'sources' => $source, - 'tickets_count' => $collection]; + $result = ['departments' => $department, 'sla' => $sla, 'staffs' => $staff, 'teams' => $team, + 'priorities' => $priority, 'helptopics' => $helptopic, + 'status' => $status, + 'sources' => $source, + 'tickets_count' => $collection, ]; return response()->json(compact('result')); // $result = ['departments' => $department, 'sla' => $sla, 'staffs' => $staff, 'teams' => $team, // 'priorities' => $priority, 'helptopics' => $helptopic, 'status' => $status, 'sources' => $source,]; return response()->json(compact('result')); - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); } @@ -1720,19 +1483,15 @@ class ApiController extends Controller public function differenciateHelpTopic($query) { $ticket = $query->first(); - $check = 'department'; - if ($ticket) - { - if ($ticket->dept_id && $ticket->help_topic_id) - { + $check = 'department'; + if ($ticket) { + if ($ticket->dept_id && $ticket->help_topic_id) { return $this->getSystem($check, $query); } - if (!$ticket->dept_id && $ticket->help_topic_id) - { + if (!$ticket->dept_id && $ticket->help_topic_id) { return $query->select('tickets.help_topic_id'); } - if ($ticket->dept_id && !$ticket->help_topic_id) - { + if ($ticket->dept_id && !$ticket->help_topic_id) { return $query->select('tickets.dept_id'); } } @@ -1742,8 +1501,7 @@ class ApiController extends Controller public function getSystem($check, $query) { - switch ($check) - { + switch ($check) { case 'department': return $query->select('tickets.dept_id'); case 'helpTopic': @@ -1762,38 +1520,33 @@ class ApiController extends Controller */ public function register(Request $request) { - try - { + try { $v = \Validator::make($request->all(), [ 'email' => 'required|email|unique:users', 'password' => 'required|min:6', ]); - if ($v->fails()) - { + if ($v->fails()) { $error = $v->errors(); return response()->json(compact('error')); } - $auth = $this->user; - $email = $request->input('email'); + $auth = $this->user; + $email = $request->input('email'); $username = $request->input('email'); $password = \Hash::make($request->input('password')); - $role = $request->input('role'); - if ($auth->role == 'agent') - { + $role = $request->input('role'); + if ($auth->role == 'agent') { $role = 'user'; } - $user = new User(); - $user->password = $password; + $user = new User(); + $user->password = $password; $user->user_name = $username; - $user->email = $email; - $user->role = $role; + $user->email = $email; + $user->role = $role; $user->save(); return response()->json(compact('user')); - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); return response()->json(compact('error')); @@ -1802,54 +1555,46 @@ class ApiController extends Controller public function createUser() { - try - { + try { $v = \Validator::make( $this->request->all(), [ 'username' => 'required|unique:users,user_name', 'first_name' => 'required', ] ); - if ($v->fails()) - { + if ($v->fails()) { $error = $v->messages(); + return response()->json(compact('error')); } - $str = str_random(8); - $array = ['password' => $str, 'password_confirmation' => $str, 'email' => $this->request->input('email'), 'full_name' => $this->request->input('first_name')]; - $all = $this->request->input(); - $merged = $array + $all; + $str = str_random(8); + $array = ['password' => $str, 'password_confirmation' => $str, 'email' => $this->request->input('email'), 'full_name' => $this->request->input('first_name')]; + $all = $this->request->input(); + $merged = $array + $all; $request = new \App\Http\Requests\helpdesk\RegisterRequest(); $request->replace($merged); - if ($request->has('username')) - { + if ($request->has('username')) { $request->merge(['user_name' => $request->get('username')]); } \Route::dispatch($request); - $auth = new \App\Http\Controllers\Auth\AuthController(); - $user = new User(); + $auth = new \App\Http\Controllers\Auth\AuthController(); + $user = new User(); $register = $auth->postRegister($user, $request, true); - if ($register) - { + if ($register) { return response()->json(compact('register')); } - } - catch (\Exception $e) - { + } catch (\Exception $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); - } - catch (Tymon\JWTAuth\Exceptions\TokenExpiredException $e) - { + } catch (Tymon\JWTAuth\Exceptions\TokenExpiredException $e) { $error = $e->getMessage(); - $line = $e->getLine(); - $file = $e->getFile(); + $line = $e->getLine(); + $file = $e->getFile(); return response()->json(compact('error', 'file', 'line')); } } - } diff --git a/app/Http/Controllers/Api/v1/TicketController.php b/app/Http/Controllers/Api/v1/TicketController.php index 24c5281f5..510c44857 100644 --- a/app/Http/Controllers/Api/v1/TicketController.php +++ b/app/Http/Controllers/Api/v1/TicketController.php @@ -32,7 +32,6 @@ use Mail; */ class TicketController extends Controller { - /** * Create a new controller instance. * @@ -40,7 +39,7 @@ class TicketController extends Controller */ public function __construct() { - $PhpMailController = new PhpMailController(); + $PhpMailController = new PhpMailController(); $this->PhpMailController = $PhpMailController; } @@ -58,51 +57,42 @@ class TicketController extends Controller */ public function createTicket($user_id, $subject, $body, $helptopic, $sla, $priority, $source, $headers, $dept, $assignto, $form_data, $attach = '') { - try - { + try { //return $headers; $max_number = Tickets::whereRaw('id = (select max(`id`) from tickets)')->first(); //dd($max_number); - if ($max_number == null) - { + if ($max_number == null) { $ticket_number = 'AAAA-9999-9999999'; - } - else - { - foreach ($max_number as $number) - { + } else { + foreach ($max_number as $number) { $ticket_number = $max_number->ticket_number; } } - $ticket = new Tickets(); + $ticket = new Tickets(); $ticket->ticket_number = $this->ticketNumber($ticket_number); //dd($this->ticketNumber($ticket_number)); - $ticket->user_id = $user_id; - $ticket->dept_id = $dept; + $ticket->user_id = $user_id; + $ticket->dept_id = $dept; $ticket->help_topic_id = $helptopic; - $ticket->sla = $sla; - $ticket->assigned_to = $assignto; - $ticket->status = '1'; - $ticket->priority_id = $priority; - $ticket->source = $source; + $ticket->sla = $sla; + $ticket->assigned_to = $assignto; + $ticket->status = '1'; + $ticket->priority_id = $priority; + $ticket->source = $source; $ticket->save(); //dd($ticket); - $ticket_number = $ticket->ticket_number; - $id = $ticket->id; - if ($form_data != null) - { + $ticket_number = $ticket->ticket_number; + $id = $ticket->id; + if ($form_data != null) { $help_topic = Help_topic::where('id', '=', $helptopic)->first(); - $forms = Fields::where('forms_id', '=', $help_topic->custom_form)->get(); - foreach ($form_data as $key => $form_details) - { - foreach ($forms as $from) - { - if ($from->name == $key) - { - $form_value = new Ticket_Form_Data(); + $forms = Fields::where('forms_id', '=', $help_topic->custom_form)->get(); + foreach ($form_data as $key => $form_details) { + foreach ($forms as $from) { + if ($from->name == $key) { + $form_value = new Ticket_Form_Data(); $form_value->ticket_id = $id; - $form_value->title = $from->label; - $form_value->content = $form_details; + $form_value->title = $from->label; + $form_value->content = $form_details; $form_value->save(); } } @@ -112,15 +102,12 @@ class TicketController extends Controller $this->storeCollaborators($headers, $id); $thread = $this->ticketThread($subject, $body, $id, $user_id); - if (!empty($attach)) - { + if (!empty($attach)) { $this->attach($thread, $attach); } return $thread; - } - catch (\Exception $e) - { + } catch (\Exception $e) { return $e->getMessage(); } } @@ -134,52 +121,44 @@ class TicketController extends Controller */ public function storeCollaborators($headers, $id) { - try - { + try { //return $headers; $company = $this->company(); - if (isset($headers)) - { - foreach ($headers as $email) - { - $name = $email; + if (isset($headers)) { + foreach ($headers as $email) { + $name = $email; $email = $email; - if ($this->checkEmail($email) == false) - { - $create_user = new User(); + if ($this->checkEmail($email) == false) { + $create_user = new User(); $create_user->user_name = $name; - $create_user->email = $email; - $create_user->active = 1; - $create_user->role = 'user'; - $password = $this->generateRandomString(); - $create_user->password = Hash::make($password); + $create_user->email = $email; + $create_user->active = 1; + $create_user->role = 'user'; + $password = $this->generateRandomString(); + $create_user->password = Hash::make($password); $create_user->save(); - $user_id = $create_user->id; + $user_id = $create_user->id; // Mail::send('emails.pass', ['password' => $password, 'name' => $name, 'from' => $company, 'emailadd' => $email], function ($message) use ($email, $name) { // $message->to($email, $name)->subject('password'); // }); - $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]); - } - else - { - $user = $this->checkEmail($email); + $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => 'password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $name, 'email_address' => $email, 'user_password' => $password]); + } else { + $user = $this->checkEmail($email); $user_id = $user->id; } //return $user_id; - $collaborator_store = new Ticket_Collaborator(); - $collaborator_store->isactive = 1; + $collaborator_store = new Ticket_Collaborator(); + $collaborator_store->isactive = 1; $collaborator_store->ticket_id = $id; - $collaborator_store->user_id = $user_id; - $collaborator_store->role = 'ccc'; + $collaborator_store->user_id = $user_id; + $collaborator_store->role = 'ccc'; $collaborator_store->save(); } } return true; - } - catch (\Exception $e) - { + } catch (\Exception $e) { return $e->getMessage(); } } @@ -196,20 +175,17 @@ class TicketController extends Controller */ public function ticketThread($subject, $body, $id, $user_id) { - try - { - $thread = new Ticket_Thread(); - $thread->user_id = $user_id; + try { + $thread = new Ticket_Thread(); + $thread->user_id = $user_id; $thread->ticket_id = $id; - $thread->poster = 'client'; - $thread->title = $subject; - $thread->body = $body; + $thread->poster = 'client'; + $thread->title = $subject; + $thread->body = $body; $thread->save(); return $thread->id; - } - catch (\Exception $e) - { + } catch (\Exception $e) { return $e->getMessage(); } } @@ -223,24 +199,20 @@ class TicketController extends Controller */ public function ticketNumber($ticket_number) { - try - { + try { //dd($ticket_number); - $number = $ticket_number; - $number = explode('-', $number); + $number = $ticket_number; + $number = explode('-', $number); $number1 = $number[0]; - if ($number1 == 'ZZZZ') - { + if ($number1 == 'ZZZZ') { $number1 = 'AAAA'; } $number2 = $number[1]; - if ($number2 == '9999') - { + if ($number2 == '9999') { $number2 = '0000'; } $number3 = $number[2]; - if ($number3 == '9999999') - { + if ($number3 == '9999999') { $number3 = '0000000'; } $number1++; @@ -248,13 +220,11 @@ class TicketController extends Controller $number3++; $number2 = sprintf('%04s', $number2); $number3 = sprintf('%07s', $number3); - $array = [$number1, $number2, $number3]; - $number = implode('-', $array); + $array = [$number1, $number2, $number3]; + $number = implode('-', $array); return $number; - } - catch (\Exception $e) - { + } catch (\Exception $e) { dd($e); return $e->getMessage(); @@ -270,20 +240,16 @@ class TicketController extends Controller */ public function generateRandomString($length = 10) { - try - { - $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + try { + $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); - $randomString = ''; - for ($i = 0; $i < $length; $i++) - { + $randomString = ''; + for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, $charactersLength - 1)]; } return $randomString; - } - catch (\Exception $e) - { + } catch (\Exception $e) { return $e->getMessage(); } } @@ -298,71 +264,64 @@ class TicketController extends Controller */ public function reply($thread, $request, $ta, $attach = '') { - try - { + try { $check_attachment = null; - $eventthread = $thread->where('ticket_id', $request->input('ticket_ID'))->first(); + $eventthread = $thread->where('ticket_id', $request->input('ticket_ID'))->first(); //dd($request->input('ticket_ID')); //dd($eventthread); - $eventuserid = $eventthread->user_id; - $emailadd = User::where('id', $eventuserid)->first()->email; + $eventuserid = $eventthread->user_id; + $emailadd = User::where('id', $eventuserid)->first()->email; //dd($emailadd); - $source = $eventthread->source; + $source = $eventthread->source; - $form_data = $request->except('reply_content', 'ticket_ID', 'attachment'); + $form_data = $request->except('reply_content', 'ticket_ID', 'attachment'); \Event::fire(new \App\Events\ClientTicketFormPost($form_data, $emailadd, $source)); //dd('yes'); - $reply_content = $request->input('reply_content'); - $thread->ticket_id = $request->input('ticket_ID'); - $thread->poster = 'support'; - $thread->body = $request->input('reply_content'); - $thread->user_id = Auth::user()->id; - $ticket_id = $request->input('ticket_ID'); - $tickets = Tickets::where('id', '=', $ticket_id)->first(); + $reply_content = $request->input('reply_content'); + $thread->ticket_id = $request->input('ticket_ID'); + $thread->poster = 'support'; + $thread->body = $request->input('reply_content'); + $thread->user_id = Auth::user()->id; + $ticket_id = $request->input('ticket_ID'); + $tickets = Tickets::where('id', '=', $ticket_id)->first(); $tickets->isanswered = '1'; $tickets->save(); $ticket_user = User::where('id', '=', $tickets->user_id)->first(); - if ($tickets->assigned_to == 0) - { + if ($tickets->assigned_to == 0) { $tickets->assigned_to = Auth::user()->id; $tickets->save(); - $thread2 = new Ticket_Thread(); - $thread2->ticket_id = $thread->ticket_id; - $thread2->user_id = Auth::user()->id; + $thread2 = new Ticket_Thread(); + $thread2->ticket_id = $thread->ticket_id; + $thread2->user_id = Auth::user()->id; $thread2->is_internal = 1; - $thread2->body = 'This Ticket have been assigned to ' . Auth::user()->first_name . ' ' . Auth::user()->last_name; + $thread2->body = 'This Ticket have been assigned to '.Auth::user()->first_name.' '.Auth::user()->last_name; $thread2->save(); } - if ($tickets->status > 1) - { - $tickets->status = '1'; + if ($tickets->status > 1) { + $tickets->status = '1'; $tickets->isanswered = '1'; $tickets->save(); } $thread->save(); - if (!empty($attach)) - { + if (!empty($attach)) { $check_attachment = $this->attach($thread->id, $attach); } - $thread1 = Ticket_Thread::where('ticket_id', '=', $ticket_id)->first(); + $thread1 = Ticket_Thread::where('ticket_id', '=', $ticket_id)->first(); $ticket_subject = $thread1->title; - $user_id = $tickets->user_id; - $user = User::where('id', '=', $user_id)->first(); - $email = $user->email; - $user_name = $user->user_name; - $ticket_number = $tickets->ticket_number; - $company = $this->company(); - $username = $ticket_user->user_name; - if (!empty(Auth::user()->agent_sign)) - { + $user_id = $tickets->user_id; + $user = User::where('id', '=', $user_id)->first(); + $email = $user->email; + $user_name = $user->user_name; + $ticket_number = $tickets->ticket_number; + $company = $this->company(); + $username = $ticket_user->user_name; + if (!empty(Auth::user()->agent_sign)) { $agentsign = Auth::user()->agent_sign; - } - else - { + } else { $agentsign = null; } \Event::fire(new \App\Events\FaveoAfterReply($reply_content, $user->phone_number, $request, $tickets)); @@ -370,67 +329,54 @@ class TicketController extends Controller // Mail::send(array('html' => 'emails.ticket_re-reply'), ['content' => $reply_content, 'ticket_number' => $ticket_number, 'From' => $company, 'name' => $username, 'Agent_Signature' => $agentsign], function ($message) use ($email, $user_name, $ticket_number, $ticket_subject, $check_attachment) { // $message->to($email, $user_name)->subject($ticket_subject . '[#' . $ticket_number . ']'); // // if(isset($attachments)){ -// // if ($check_attachment == 1) { -// // $size = count($attach); -// // for ($i = 0; $i < $size; $i++) { -// // $message->attach($attachments[$i]->getRealPath(), ['as' => $attachments[$i]->getClientOriginalName(), 'mime' => $attachments[$i]->getClientOriginalExtension()]); -// // } -// // } + // // if ($check_attachment == 1) { + // // $size = count($attach); + // // for ($i = 0; $i < $size; $i++) { + // // $message->attach($attachments[$i]->getRealPath(), ['as' => $attachments[$i]->getClientOriginalName(), 'mime' => $attachments[$i]->getClientOriginalExtension()]); + // // } + // // } // }, true); //dd('reply'); /* * Getting the subject of the thread */ //dd($eventthread); - try - { - $re = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $tickets->dept_id), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => $eventthread->title, 'scenario' => 'create-ticket-by-agent', 'body' => $thread->body], $template_variables = ['agent_sign' => Auth::user()->agent_sign, 'ticket_number' => $tickets->number]); + try { + $re = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $tickets->dept_id), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => $eventthread->title, 'scenario' => 'create-ticket-by-agent', 'body' => $thread->body], $template_variables = ['agent_sign' => Auth::user()->agent_sign, 'ticket_number' => $tickets->number]); //dd($re); - } - catch (\Exception $e) - { + } catch (\Exception $e) { //throw new \Exception($e->getMessage()); } $collaborators = Ticket_Collaborator::where('ticket_id', '=', $ticket_id)->get(); - foreach ($collaborators as $collaborator) - { + foreach ($collaborators as $collaborator) { //mail to collaborators $collab_user_id = $collaborator->user_id; $user_id_collab = User::where('id', '=', $collab_user_id)->first(); - $collab_email = $user_id_collab->email; - if ($user_id_collab->role == 'user') - { + $collab_email = $user_id_collab->email; + if ($user_id_collab->role == 'user') { $collab_user_name = $user_id_collab->user_name; - } - else - { - $collab_user_name = $user_id_collab->first_name . ' ' . $user_id_collab->last_name; + } else { + $collab_user_name = $user_id_collab->first_name.' '.$user_id_collab->last_name; } // Mail::send('emails.ticket_re-reply', ['content' => $reply_content, 'ticket_number' => $ticket_number, 'From' => $company, 'name' => $collab_user_name, 'Agent_Signature' => $agentsign], function ($message) use ($collab_email, $collab_user_name, $ticket_number, $ticket_subject, $check_attachment) { // $message->to($collab_email, $collab_user_name)->subject($ticket_subject . '[#' . $ticket_number . ']'); -// // if ($check_attachment == 1) { -// // $size = sizeOf($attachments); -// // for ($i = 0; $i < $size; $i++) { -// // $message->attach($attachments[$i]->getRealPath(), ['as' => $attachments[$i]->getClientOriginalName(), 'mime' => $attachments[$i]->getClientOriginalExtension()]); -// // } -// // } + // // if ($check_attachment == 1) { + // // $size = sizeOf($attachments); + // // for ($i = 0; $i < $size; $i++) { + // // $message->attach($attachments[$i]->getRealPath(), ['as' => $attachments[$i]->getClientOriginalName(), 'mime' => $attachments[$i]->getClientOriginalExtension()]); + // // } + // // } // }, true); - try - { - $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['user' => $admin_user, 'email' => $admin_email], $message = ['subject' => $updated_subject, 'body' => $body, 'scenario' => $mail], $template_variables = ['ticket_agent_name' => $admin_user, 'ticket_client_name' => $username, 'ticket_client_email' => $emailadd, 'user' => $admin_user, 'ticket_number' => $ticket_number2, 'email_address' => $emailadd, 'name' => $ticket_creator]); - } - catch (\Exception $e) - { - + try { + $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticketdata->dept_id), $to = ['user' => $admin_user, 'email' => $admin_email], $message = ['subject' => $updated_subject, 'body' => $body, 'scenario' => $mail], $template_variables = ['ticket_agent_name' => $admin_user, 'ticket_client_name' => $username, 'ticket_client_email' => $emailadd, 'user' => $admin_user, 'ticket_number' => $ticket_number2, 'email_address' => $emailadd, 'name' => $ticket_creator]); + } catch (\Exception $e) { } } return $thread; - } - catch (\Exception $e) - { + } catch (\Exception $e) { //dd($e); return $e->getMessage(); } @@ -443,22 +389,16 @@ class TicketController extends Controller */ public function company() { - try - { + try { $company = Company::Where('id', '=', '1')->first(); - if ($company->company_name == null) - { + if ($company->company_name == null) { $company = 'Support Center'; - } - else - { + } else { $company = $company->company_name; } return $company; - } - catch (\Exception $e) - { + } catch (\Exception $e) { return $e->getMessage(); } } @@ -473,27 +413,26 @@ class TicketController extends Controller */ public function ticketEditPost($ticket_id, $thread, $ticket) { - try - { + try { $ticket = $ticket->where('id', '=', $ticket_id)->first(); - $ticket->sla = Input::get('sla_plan'); + $ticket->sla = Input::get('sla_plan'); $ticket->help_topic_id = Input::get('help_topic'); - $ticket->source = Input::get('ticket_source'); - $ticket->priority_id = Input::get('ticket_priority'); - $ticket->status = Input::get('status'); + $ticket->source = Input::get('ticket_source'); + $ticket->priority_id = Input::get('ticket_priority'); + $ticket->status = Input::get('status'); $ticket->save(); - $threads = $thread->where('ticket_id', '=', $ticket_id)->first(); + $threads = $thread->where('ticket_id', '=', $ticket_id)->first(); $threads->title = Input::get('subject'); $threads->save(); - } - catch (\Exception $ex) - { + } catch (\Exception $ex) { $result = $ex->getMessage(); + return response()->json(compact('result'), 500); } - $result = ["success" => "Edited successfully"]; + $result = ['success' => 'Edited successfully']; + return response()->json(compact('result')); } @@ -506,66 +445,56 @@ class TicketController extends Controller */ public function assign($id) { - try - { + try { $UserEmail = Input::get('user'); //dd($UserEmail); // $UserEmail = 'sujitprasad12@yahoo.in'; - $user = User::where('email', '=', $UserEmail)->first(); - if (!$user) - { + $user = User::where('email', '=', $UserEmail)->first(); + if (!$user) { return ['error' => 'No agent not found']; } $user_id = $user->id; - $ticket = Tickets::where('id', '=', $id)->first(); - if (!$ticket) - { + $ticket = Tickets::where('id', '=', $id)->first(); + if (!$ticket) { return ['error' => 'No ticket not found']; } - $ticket_number = $ticket->ticket_number; + $ticket_number = $ticket->ticket_number; $ticket->assigned_to = $user_id; $ticket->save(); - $ticket_thread = Ticket_Thread::where('ticket_id', '=', $id)->first(); - if (!$ticket_thread) - { + $ticket_thread = Ticket_Thread::where('ticket_id', '=', $id)->first(); + if (!$ticket_thread) { return ['error' => 'No thread not found']; } - $ticket_subject = $ticket_thread->title; - $thread = new Ticket_Thread(); - $thread->ticket_id = $ticket->id; - $thread->user_id = Auth::user()->id; + $ticket_subject = $ticket_thread->title; + $thread = new Ticket_Thread(); + $thread->ticket_id = $ticket->id; + $thread->user_id = Auth::user()->id; $thread->is_internal = 1; - $thread->body = 'This Ticket has been assigned to ' . $user->first_name . ' ' . $user->last_name; + $thread->body = 'This Ticket has been assigned to '.$user->first_name.' '.$user->last_name; $thread->save(); $company = $this->company(); - $system = $this->system(); + $system = $this->system(); - $agent = $user->first_name; + $agent = $user->first_name; $agent_email = $user->email; - $master = Auth::user()->first_name . ' ' . Auth::user()->last_name; - if (Alert::first()->internal_status == 1 || Alert::first()->internal_assigned_agent == 1) - { + $master = Auth::user()->first_name.' '.Auth::user()->last_name; + if (Alert::first()->internal_status == 1 || Alert::first()->internal_assigned_agent == 1) { // // ticket assigned send mail // Mail::send('emails.Ticket_assign', ['agent' => $agent, 'ticket_number' => $ticket_number, 'from' => $company, 'master' => $master, 'system' => $system], function ($message) use ($agent_email, $agent, $ticket_number, $ticket_subject) { // $message->to($agent_email, $agent)->subject($ticket_subject . '[#' . $ticket_number . ']'); // }); - try - { - $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticket->dept_id), $to = ['name' => $agent, 'email' => $agent_email], $message = ['subject' => $ticket_subject . '[#' . $ticket_number . ']', 'scenario' => 'assign-ticket'], $template_variables = ['ticket_agent_name' => $agent, 'ticket_number' => $ticket_number, 'ticket_assigner' => $master]); - } - catch (\Exception $e) - { + try { + $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $ticket->dept_id), $to = ['name' => $agent, 'email' => $agent_email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'assign-ticket'], $template_variables = ['ticket_agent_name' => $agent, 'ticket_number' => $ticket_number, 'ticket_assigner' => $master]); + } catch (\Exception $e) { return 0; } } return 1; - } - catch (\Exception $e) - { + } catch (\Exception $e) { return $e->getMessage(); } } @@ -580,63 +509,47 @@ class TicketController extends Controller */ public function delete($ids, $ticket) { - try - { - foreach ($ids as $id) - { + try { + foreach ($ids as $id) { $ticket_delete = $ticket->where('id', '=', $id)->first(); - if ($ticket_delete) - { - if ($ticket_delete->status == 5) - { + if ($ticket_delete) { + if ($ticket_delete->status == 5) { $ticket_delete->delete(); $ticket_threads = Ticket_Thread::where('ticket_id', '=', $id)->get(); - if ($ticket_threads) - { - foreach ($ticket_threads as $ticket_thread) - { - if ($ticket_thread) - { + if ($ticket_threads) { + foreach ($ticket_threads as $ticket_thread) { + if ($ticket_thread) { $ticket_thread->delete(); } } } $ticket_attachments = Ticket_attachments::where('thread_id', '=', $id)->get(); - if ($ticket_attachments) - { - foreach ($ticket_attachments as $ticket_attachment) - { - if ($ticket_attachment) - { + if ($ticket_attachments) { + foreach ($ticket_attachments as $ticket_attachment) { + if ($ticket_attachment) { $ticket_attachment->delete(); } } } - } - else - { + } else { $ticket_delete->is_deleted = 0; - $ticket_delete->status = 5; + $ticket_delete->status = 5; $ticket_delete->save(); - $ticket_status_message = Ticket_Status::where('id', '=', $ticket_delete->status)->first(); - $thread = new Ticket_Thread(); - $thread->ticket_id = $ticket_delete->id; - $thread->user_id = Auth::user()->id; - $thread->is_internal = 1; - $thread->body = $ticket_status_message->message . ' ' . Auth::user()->first_name . ' ' . Auth::user()->last_name; + $ticket_status_message = Ticket_Status::where('id', '=', $ticket_delete->status)->first(); + $thread = new Ticket_Thread(); + $thread->ticket_id = $ticket_delete->id; + $thread->user_id = Auth::user()->id; + $thread->is_internal = 1; + $thread->body = $ticket_status_message->message.' '.Auth::user()->first_name.' '.Auth::user()->last_name; $thread->save(); } - } - else - { + } else { return 'ticket not found'; } } return 'your tickets has been deleted'; - } - catch (\Exception $e) - { + } catch (\Exception $e) { return $e->getMessage(); } } @@ -650,20 +563,14 @@ class TicketController extends Controller */ public function checkEmail($email) { - try - { + try { $check = User::where('email', '=', $email)->first(); - if ($check) - { + if ($check) { return $check; - } - else - { + } else { return false; } - } - catch (\Exception $e) - { + } catch (\Exception $e) { return $e->getMessage(); } } @@ -675,22 +582,16 @@ class TicketController extends Controller */ public function system() { - try - { + try { $system = System::Where('id', '=', '1')->first(); - if ($system->name == null) - { + if ($system->name == null) { $system = 'Support Center'; - } - else - { + } else { $system = $system->name; } return $system; - } - catch (\Exception $e) - { + } catch (\Exception $e) { return $e->getMessage(); } } @@ -705,19 +606,15 @@ class TicketController extends Controller */ public function attach($thread, $attach) { - try - { + try { $ta = new Ticket_attachments(); - foreach ($attach as $file) - { + foreach ($attach as $file) { $ta->create(['thread_id' => $thread, 'name' => $file['name'], 'size' => $file['size'], 'type' => $file['type'], 'file' => $file['file'], 'poster' => 'ATTACHMENT']); } $ta->create(['thread_id' => $thread, 'name' => $name, 'size' => $size, 'type' => $type, 'file' => $file, 'poster' => 'ATTACHMENT']); return 1; - } - catch (\Exception $e) - { + } catch (\Exception $e) { return $e->getMessage(); } } @@ -730,7 +627,7 @@ class TicketController extends Controller public function autosearch() { $term = \Input::get('term'); - $user = \App\User::where('email', 'LIKE', '%' . $term . '%')->orWhere('first_name', 'LIKE', '%' . $term . '%')->orWhere('last_name', 'LIKE', '%' . $term . '%')->orWhere('user_name', 'LIKE', '%' . $term . '%')->lists('email'); + $user = \App\User::where('email', 'LIKE', '%'.$term.'%')->orWhere('first_name', 'LIKE', '%'.$term.'%')->orWhere('last_name', 'LIKE', '%'.$term.'%')->orWhere('user_name', 'LIKE', '%'.$term.'%')->lists('email'); return $user; } @@ -744,27 +641,26 @@ class TicketController extends Controller */ public function useradd() { - $email = Input::get('email'); - $ticket_id = Input::get('ticket_id'); - $company = $this->company(); - $user = new User(); + $email = Input::get('email'); + $ticket_id = Input::get('ticket_id'); + $company = $this->company(); + $user = new User(); $user->user_name = $email; - $user->email = $email; - $password = $this->generateRandomString(); - $user->password = \Hash::make($password); - $user->role = 'user'; - $user->active = 1; - if ($user->save()) - { - $user_id = $user->id; - $php_mailer = new PhpMailController(); - $php_mailer->sendmail($from = $php_mailer->mailfrom('1', '0'), $to = ['name' => $email, 'email' => $email], $message = ['subject' => 'Password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $email, 'email_address' => $email, 'user_password' => $password]); + $user->email = $email; + $password = $this->generateRandomString(); + $user->password = \Hash::make($password); + $user->role = 'user'; + $user->active = 1; + if ($user->save()) { + $user_id = $user->id; + $php_mailer = new PhpMailController(); + $php_mailer->sendmail($from = $php_mailer->mailfrom('1', '0'), $to = ['name' => $email, 'email' => $email], $message = ['subject' => 'Password', 'scenario' => 'registration-notification'], $template_variables = ['user' => $email, 'email_address' => $email, 'user_password' => $password]); } - $ticket_collaborator = new Ticket_Collaborator(); - $ticket_collaborator->isactive = 1; + $ticket_collaborator = new Ticket_Collaborator(); + $ticket_collaborator->isactive = 1; $ticket_collaborator->ticket_id = $ticket_id; - $ticket_collaborator->user_id = $user->id; - $ticket_collaborator->role = 'ccc'; + $ticket_collaborator->user_id = $user->id; + $ticket_collaborator->role = 'ccc'; $ticket_collaborator->save(); $result = [$user->user_name => $user->email]; @@ -779,84 +675,67 @@ class TicketController extends Controller */ public function userremove() { - $email = Input::get('email'); - $ticketid = Input::get('ticketid'); - $user = new User(); - $user = $user->where('email', $email)->first(); + $email = Input::get('email'); + $ticketid = Input::get('ticketid'); + $user = new User(); + $user = $user->where('email', $email)->first(); $ticket_collaborator = Ticket_Collaborator::where('ticket_id', '=', $ticketid) ->where('user_id', $user->id) ->first(); - if ($ticket_collaborator) - { + if ($ticket_collaborator) { $ticket_collaborator->delete(); return 'deleted successfully'; - } - else - { + } else { return 'not found'; } } public function getCollaboratorForTicket() { - try - { + try { $ticketid = Input::get('ticket_id'); $ticket_collaborator = \DB::table('users') - ->join('ticket_collaborator', function ($join) use ($ticketid) - { + ->join('ticket_collaborator', function ($join) use ($ticketid) { $join->on('users.id', '=', 'ticket_collaborator.user_id') ->where('ticket_collaborator.ticket_id', '=', $ticketid); }) ->select('users.email', 'users.user_name') ->get(); - if (count($ticket_collaborator) > 0) - { - foreach ($ticket_collaborator as $key => $collaborator) - { - $collab[$key]['email'] = $collaborator->email; + if (count($ticket_collaborator) > 0) { + foreach ($ticket_collaborator as $key => $collaborator) { + $collab[$key]['email'] = $collaborator->email; $collab[$key]['user_name'] = $collaborator->user_name; - $collab[$key]['avatar'] = $this->avatarUrl($collaborator->email); + $collab[$key]['avatar'] = $this->avatarUrl($collaborator->email); } - } - else - { + } else { $collab = $ticket_collaborator; } return $collab; - } - catch (\Exception $ex) - { + } catch (\Exception $ex) { return $ex->getMessage(); + throw new \Exception('get collaborator for ticket fails'); } } public function avatarUrl($email) { - try - { + try { $user = new User(); $user = $user->where('email', $email)->first(); - if ($user->profile_pic) - { - $url = url('uploads/profilepic/' . $user->profile_pic); - } - else - { + if ($user->profile_pic) { + $url = url('uploads/profilepic/'.$user->profile_pic); + } else { $url = \Gravatar::src($email); } return $url; - } - catch (\Exception $ex) - { + } catch (\Exception $ex) { //return $ex->getMessage(); throw new \Exception($ex->getMessage()); } } - } diff --git a/app/Http/Controllers/Api/v1/TokenAuthController.php b/app/Http/Controllers/Api/v1/TokenAuthController.php index f5c38b722..3edead411 100644 --- a/app/Http/Controllers/Api/v1/TokenAuthController.php +++ b/app/Http/Controllers/Api/v1/TokenAuthController.php @@ -47,7 +47,7 @@ class TokenAuthController extends Controller $password = $request->input('password'); $field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name'; -//$credentials = $request->only('email', 'password'); + //$credentials = $request->only('email', 'password'); try { if (!$token = JWTAuth::attempt([$field => $usernameinput, 'password' => $password, 'active'=>1])) { @@ -62,7 +62,7 @@ class TokenAuthController extends Controller } $user_id = \Auth::user(); -// if no errors are encountered we can return a JWT + // if no errors are encountered we can return a JWT return response()->json(compact('token', 'user_id')); } @@ -89,7 +89,7 @@ class TokenAuthController extends Controller return response()->json(compact('error')); } -//dd($user); + //dd($user); return response()->json(compact('user')); } @@ -172,7 +172,7 @@ class TokenAuthController extends Controller $password_reset_table = \DB::table('password_resets')->where('email', '=', $user->email)->first(); if (isset($password_reset_table)) { $password_reset_table = \DB::table('password_resets')->where('email', '=', $user->email)->update(['token' => $code, 'created_at' => $date]); - // $password_reset_table->token = $code; + // $password_reset_table->token = $code; // $password_reset_table->update(['token' => $code]); } else { $create_password_reset = \DB::table('password_resets')->insert(['email' => $user->email, 'token' => $code, 'created_at' => $date]); diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php index cbba80e92..61cc14b67 100644 --- a/app/Http/Controllers/Auth/AuthController.php +++ b/app/Http/Controllers/Auth/AuthController.php @@ -38,17 +38,16 @@ use Socialite; */ class AuthController extends Controller { - use AuthenticatesAndRegistersUsers; /* to redirect after login */ // if auth is agent - protected $redirectTo = '/dashboard'; + protected $redirectTo = '/dashboard'; // if auth is user - protected $redirectToUser = '/profile'; + protected $redirectToUser = '/profile'; /* Direct After Logout */ protected $redirectAfterLogout = '/'; - protected $loginPath = '/auth/login'; + protected $loginPath = '/auth/login'; protected $social; /** @@ -69,8 +68,7 @@ class AuthController extends Controller public function redirectToProvider($provider, $redirect = '') { - if ($redirect !== '') - { + if ($redirect !== '') { $this->setSession($provider, $redirect); } //dd(\Config::get('services')); @@ -81,23 +79,19 @@ class AuthController extends Controller public function handleProviderCallback($provider) { - try - { + try { //notice we are not doing any validation, you should do it $this->changeRedirect(); $user = Socialite::driver($provider)->user(); - if ($user) - { + if ($user) { // stroing data to our use table and logging them in - $username = $user->getEmail(); + $username = $user->getEmail(); $first_name = $user->getName(); - if ($user->nickname) - { + if ($user->nickname) { $username = $user->nickname; } - if (!$first_name) - { + if (!$first_name) { $first_name = $username; } $data = [ @@ -108,21 +102,17 @@ class AuthController extends Controller 'active' => 1, ]; $user = User::where('email', $data['email'])->first(); - if (!$user) - { + if (!$user) { $user = User::where('user_name', $data['user_name'])->first(); } - if (!$user) - { + if (!$user) { $user = User::firstOrCreate($data); } Auth::login($user); } //after login redirecting to home page return redirect('/'); - } - catch (\Exception $ex) - { + } catch (\Exception $ex) { return redirect()->back()->with('fails', $ex->getMessage()); } } @@ -135,23 +125,17 @@ class AuthController extends Controller public function getRegister(CommonSettings $settings) { // Event for login - $settings = $settings->select('status')->where('option_name', '=', 'send_otp')->first(); + $settings = $settings->select('status')->where('option_name', '=', 'send_otp')->first(); $email_mandatory = $settings->select('status')->where('option_name', '=', 'email_mandatory')->first(); //dd($settings->status); \Event::fire(new \App\Events\FormRegisterEvent()); - if (Auth::user()) - { - if (Auth::user()->role == 'admin' || Auth::user()->role == 'agent') - { + if (Auth::user()) { + if (Auth::user()->role == 'admin' || Auth::user()->role == 'agent') { return \Redirect::route('dashboard'); - } - elseif (Auth::user()->role == 'user') - { + } elseif (Auth::user()->role == 'user') { // return view('auth.register'); } - } - else - { + } else { return view('auth.register', compact('settings', 'email_mandatory')); } } @@ -167,99 +151,71 @@ class AuthController extends Controller public function postRegister(User $user, RegisterRequest $request, $api = false) { //dd($request->all()); - try - { - $request_array = $request->input(); - $password = Hash::make($request->input('password')); - $user->password = $password; - $name = $request->input('full_name'); + try { + $request_array = $request->input(); + $password = Hash::make($request->input('password')); + $user->password = $password; + $name = $request->input('full_name'); $user->first_name = $name; - if ($request_array['email'] == '') - { + if ($request_array['email'] == '') { $user->email = null; - } - else - { + } else { $user->email = $request->input('email'); } - if (!checkArray('mobile', $request_array)) - { + if (!checkArray('mobile', $request_array)) { $user->mobile = null; - } - else - { + } else { $user->mobile = $request->input('mobile'); } - if (!checkArray('code', $request_array)) - { + if (!checkArray('code', $request_array)) { $user->country_code = 0; - } - else - { + } else { $user->country_code = $request->input('code'); } - if (checkArray('username', $request_array)) - { + if (checkArray('username', $request_array)) { $user->user_name = checkArray('username', $request_array); - } - else - { + } else { $user->user_name = $request->input('email'); } - $user->role = 'user'; - $code = str_random(60); + $user->role = 'user'; + $code = str_random(60); $user->remember_token = $code; $user->save(); - $message12 = ''; - $settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first(); - $sms = Plugin::select('status')->where('name', '=', 'SMS')->first(); + $message12 = ''; + $settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first(); + $sms = Plugin::select('status')->where('name', '=', 'SMS')->first(); // Event for login \Event::fire(new \App\Events\LoginEvent($request)); - if ($request->input('email') !== '') - { - $var = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $request->input('email')], $message = ['subject' => null, 'scenario' => 'registration'], $template_variables = ['user' => $name, 'email_address' => $request->input('email'), 'password_reset_link' => url('account/activate/' . $code)]); + if ($request->input('email') !== '') { + $var = $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $request->input('email')], $message = ['subject' => null, 'scenario' => 'registration'], $template_variables = ['user' => $name, 'email_address' => $request->input('email'), 'password_reset_link' => url('account/activate/'.$code)]); } - if ($settings->status == 1 || $settings->status == '1') - { - if (count($sms) > 0) - { - if ($sms->status == 1 || $sms->status == '1') - { + if ($settings->status == 1 || $settings->status == '1') { + if (count($sms) > 0) { + if ($sms->status == 1 || $sms->status == '1') { $message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail_and_moble'); - } - else - { + } else { $message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail_sms_plugin_inactive_or_not_setup'); } - } - else - { - if ($request->input('email') !== '') - { + } else { + if ($request->input('email') !== '') { $message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail'); - } - else - { + } else { $message12 = Lang::get('lang.account-created-contact-admin-as-we-were-not-able-to-send-opt'); } } - } - else - { + } else { $message12 = Lang::get('lang.activate_your_account_click_on_Link_that_send_to_your_mail'); } - if ($api == true) - { + if ($api == true) { return ['message' => $message12, 'user' => $user->toArray()]; } + return redirect('home')->with('success', $message12); - } - catch (\Exception $e) - { - if ($api == true) - { - throw new \Exception($e->getMessage()); + } catch (\Exception $e) { + if ($api == true) { + throw new \Exception($e->getMessage()); } + return redirect()->back()->with('fails', $e->getMessage()); } } @@ -274,17 +230,14 @@ class AuthController extends Controller public function accountActivate($token) { $user = User::where('remember_token', '=', $token)->first(); - if ($user) - { - $user->active = 1; + if ($user) { + $user->active = 1; $user->remember_token = null; $user->save(); $this->openTicketAfterVerification($user->id); return redirect('/auth/login')->with('status', 'Acount activated. Login to start'); - } - else - { + } else { return redirect('/auth/login')->with('fails', 'Invalid Token'); } } @@ -300,15 +253,12 @@ class AuthController extends Controller public function getMail($token, User $user) { $user = $user->where('remember_token', $token)->where('active', 0)->first(); - if ($user) - { + if ($user) { $user->active = 1; $user->save(); return redirect('auth/login'); - } - else - { + } else { return redirect('auth/login'); } } @@ -321,26 +271,17 @@ class AuthController extends Controller public function getLogin() { $directory = base_path(); - if (file_exists($directory . DIRECTORY_SEPARATOR . '.env')) - { - if (Auth::user()) - { - if (Auth::user()->role == 'admin' || Auth::user()->role == 'agent') - { + if (file_exists($directory.DIRECTORY_SEPARATOR.'.env')) { + if (Auth::user()) { + if (Auth::user()->role == 'admin' || Auth::user()->role == 'agent') { return \Redirect::route('dashboard'); - } - elseif (Auth::user()->role == 'user') - { + } elseif (Auth::user()->role == 'user') { return \Redirect::route('home'); } - } - else - { + } else { return view('auth.login'); } - } - else - { + } else { return Redirect::route('licence'); } } @@ -354,153 +295,119 @@ class AuthController extends Controller */ public function postLogin(LoginRequest $request) { - try - { + try { // dd($request->input()); \Event::fire('auth.login.event', []); //added 5/5/2016 // Set login attempts and login time - $value = $_SERVER['REMOTE_ADDR']; + $value = $_SERVER['REMOTE_ADDR']; $usernameinput = $request->input('email'); - $password = $request->input('password'); - if ($request->input('referer')) - { + $password = $request->input('password'); + if ($request->input('referer')) { $referer = 'form'; - } - else - { + } else { $referer = '/'; } - $field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name'; + $field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name'; $result = $this->confirmIPAddress($value, $usernameinput); // If attempts > 3 and time < 30 minutes $security = Security::whereId('1')->first(); - if ($result == 1) - { + if ($result == 1) { return redirect()->back()->withErrors('email', 'Incorrect details')->with(['error' => $security->lockout_message, 'referer' => $referer]); } $check_active = User::where('email', '=', $request->input('email'))->orwhere('user_name', '=', $request->input('email'))->first(); - if (!$check_active) - { //check if user exists or not + if (!$check_active) { //check if user exists or not //if user deos not exist then return back with error that user is not registered return redirect()->back() ->withInput($request->only('email', 'remember')) ->withErrors([ - 'email' => $this->getFailedLoginMessage(), - 'password' => $this->getFailedLoginMessage(), + 'email' => $this->getFailedLoginMessage(), + 'password' => $this->getFailedLoginMessage(), ])->with(['error' => Lang::get('lang.not-registered'), - 'referer' => $referer,]); + 'referer' => $referer, ]); } //if user exists $settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first(); - if ($settings->status == '1' || $settings->status == 1) - { // check for otp verification setting + if ($settings->status == '1' || $settings->status == 1) { // check for otp verification setting // setting is enabled $sms = Plugin::select('status')->where('name', '=', 'SMS')->first(); - if ($sms) - { //check sms plugin installed or not + if ($sms) { //check sms plugin installed or not // plugin is installed - if ($sms->status == 1 || $sms->status === '1') - { //check plugin is active or not + if ($sms->status == 1 || $sms->status === '1') { //check plugin is active or not // plugin is active - if (!$check_active->active) - { //check account is active or not + if (!$check_active->active) { //check account is active or not // account is not active show verify otp window - if ($check_active->mobile) - { //check user has mobile or not + if ($check_active->mobile) { //check user has mobile or not // user has mobile number return verify OTP screen return \Redirect::route('otp-verification') ->withInput($request->input()) ->with(['values' => $request->input(), - 'referer' => $referer, - 'name' => $check_active->first_name, - 'number' => $check_active->mobile, - 'code' => $check_active->country_code,]); - } - else - { + 'referer' => $referer, + 'name' => $check_active->first_name, + 'number' => $check_active->mobile, + 'code' => $check_active->country_code, ]); + } else { goto a; //attenmpt login (be careful while using goto statements) } - } - else - { + } else { goto a; //attenmpt login (be careful while using goto statements) } - } - else - { + } else { goto a; //attenmpt login (be careful while using goto statements) } - } - else - { + } else { goto a; //attenmpt login (be careful while using goto statements) } - } - else - { + } else { // setting is disabled - a: if (!$check_active->active) - { //check account is active or not + a: if (!$check_active->active) { //check account is active or not // if accoutn is not active return back with error message that account is inactive return redirect()->back() ->withInput($request->only('email', 'remember')) ->withErrors([ - 'email' => $this->getFailedLoginMessage(), - 'password' => $this->getFailedLoginMessage(), + 'email' => $this->getFailedLoginMessage(), + 'password' => $this->getFailedLoginMessage(), ])->with(['error' => Lang::get('lang.this_account_is_currently_inactive'), - 'referer' => $referer,]); - } - else - { + 'referer' => $referer, ]); + } else { // try login $loginAttempts = 1; // If session has login attempts, retrieve attempts counter and attempts time - if (\Session::has('loginAttempts')) - { - $loginAttempts = \Session::get('loginAttempts'); + if (\Session::has('loginAttempts')) { + $loginAttempts = \Session::get('loginAttempts'); $loginAttemptTime = \Session::get('loginAttemptTime'); $this->addLoginAttempt($value, $usernameinput); // $credentials = $request->only('email', 'password'); - $usernameinput = $request->input('email'); - $password = $request->input('password'); - $field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name'; + $usernameinput = $request->input('email'); + $password = $request->input('password'); + $field = filter_var($usernameinput, FILTER_VALIDATE_EMAIL) ? 'email' : 'user_name'; // If attempts > 3 and time < 10 minutes - if ($loginAttempts > $security->backlist_threshold && (time() - $loginAttemptTime <= ($security->lockout_period * 60))) - { + if ($loginAttempts > $security->backlist_threshold && (time() - $loginAttemptTime <= ($security->lockout_period * 60))) { return redirect()->back()->withErrors('email', 'incorrect email')->with('error', $security->lockout_message); } // If time > 10 minutes, reset attempts counter and time in session - if (time() - $loginAttemptTime > ($security->lockout_period * 60)) - { + if (time() - $loginAttemptTime > ($security->lockout_period * 60)) { \Session::put('loginAttempts', 1); \Session::put('loginAttemptTime', time()); } - } - else - { // If no login attempts stored, init login attempts and time + } else { // If no login attempts stored, init login attempts and time \Session::put('loginAttempts', $loginAttempts); \Session::put('loginAttemptTime', time()); $this->clearLoginAttempts($value, $usernameinput); } // If auth ok, redirect to restricted area \Session::put('loginAttempts', $loginAttempts + 1); - if (Auth::Attempt([$field => $usernameinput, 'password' => $password], $request->has('remember'))) - { - if (Auth::user()->role == 'user') - { - if ($request->input('referer')) - { + if (Auth::Attempt([$field => $usernameinput, 'password' => $password], $request->has('remember'))) { + if (Auth::user()->role == 'user') { + if ($request->input('referer')) { return \Redirect::route($request->input('referer')); } return \Redirect::route('/'); - } - else - { + } else { return redirect()->intended($this->redirectPath()); } } @@ -510,14 +417,12 @@ class AuthController extends Controller return redirect()->back() ->withInput($request->only('email', 'remember')) ->withErrors([ - 'email' => $this->getFailedLoginMessage(), - 'password' => $this->getFailedLoginMessage(), + 'email' => $this->getFailedLoginMessage(), + 'password' => $this->getFailedLoginMessage(), ])->with(['error' => Lang::get('lang.invalid'), - 'referer' => $referer,]); + 'referer' => $referer, ]); // Increment login attempts - } - catch (\Exception $e) - { + } catch (\Exception $e) { return redirect()->back()->with('fails', $e->getMessage()); } } @@ -531,26 +436,20 @@ class AuthController extends Controller */ public function addLoginAttempt($value, $field) { - $result = DB::table('login_attempts')->where('IP', '=', $value)->first(); - $data = $result; + $result = DB::table('login_attempts')->where('IP', '=', $value)->first(); + $data = $result; $security = Security::whereId('1')->first(); - $apt = $security->backlist_threshold; - if ($data) - { + $apt = $security->backlist_threshold; + if ($data) { $attempts = $data->Attempts + 1; - if ($attempts == $apt) - { + if ($attempts == $apt) { // $result = DB::select('UPDATE login_attempts SET Attempts='.$attempts.", LastLogin=NOW() WHERE IP = '$value' OR User = '$field'"); $result = DB::table('login_attempts')->where('IP', '=', $value)->orWhere('User', '=', $field)->update(['Attempts' => $attempts, 'LastLogin' => date('Y-m-d H:i:s')]); - } - else - { + } else { $result = DB::table('login_attempts')->where('IP', '=', $value)->orWhere('User', '=', $field)->update(['Attempts' => $attempts]); // $result = DB::select("UPDATE login_attempts SET Attempts=".$attempts." WHERE IP = '$value' OR User = '$field'"); } - } - else - { + } else { // $result = DB::select("INSERT INTO login_attempts (Attempts,User,IP,LastLogin) values (1,'$field','$value', NOW())"); $result = DB::table('login_attempts')->update(['Attempts' => 1, 'User' => $field, 'IP' => $value, 'LastLogin' => date('Y-m-d H:i:s')]); } @@ -579,26 +478,21 @@ class AuthController extends Controller */ public function confirmIPAddress($value, $field) { - $security = Security::whereId('1')->first(); - $time = $security->lockout_period; + $security = Security::whereId('1')->first(); + $time = $security->lockout_period; $max_attempts = $security->backlist_threshold; - $table = 'login_attempts'; - $result = DB::select('SELECT Attempts, (CASE when LastLogin is not NULL and DATE_ADD(LastLogin, INTERVAL ' . $time . ' MINUTE)>NOW() then 1 else 0 end) as Denied ' . - ' FROM ' . $table . " WHERE IP = '$value' OR User = '$field'"); - $data = $result; + $table = 'login_attempts'; + $result = DB::select('SELECT Attempts, (CASE when LastLogin is not NULL and DATE_ADD(LastLogin, INTERVAL '.$time.' MINUTE)>NOW() then 1 else 0 end) as Denied '. + ' FROM '.$table." WHERE IP = '$value' OR User = '$field'"); + $data = $result; //Verify that at least one login attempt is in database - if (!$data) - { + if (!$data) { return 0; } - if ($data[0]->Attempts >= $max_attempts) - { - if ($data[0]->Denied == 1) - { + if ($data[0]->Attempts >= $max_attempts) { + if ($data[0]->Denied == 1) { return 1; - } - else - { + } else { $this->clearLoginAttempts($value, $field); return 0; @@ -627,12 +521,9 @@ class AuthController extends Controller */ public function getVerifyOTP() { - if (\Session::has('values')) - { + if (\Session::has('values')) { return view('auth.otp-verify'); - } - else - { + } else { return redirect('auth/login'); } } @@ -646,35 +537,26 @@ class AuthController extends Controller */ public function verifyOTP(LoginRequest $request) { - $user = User::select('id', 'mobile', 'user_name')->where('email', '=', $request->input('email')) + $user = User::select('id', 'mobile', 'user_name')->where('email', '=', $request->input('email')) ->orWhere('user_name', '=', $request->input('email'))->first(); $otp_length = strlen($request->input('otp')); - if (!\Schema::hasTable('user_verification')) - { + if (!\Schema::hasTable('user_verification')) { $message = Lang::get('lang.opt-can-not-be-verified'); - } - else - { + } else { $otp = Otp::select('otp', 'updated_at')->where('user_id', '=', $user->id) ->first(); - if ($otp != null) - { - if (($otp_length == 6 && !preg_match('/[a-z]/i', $request->input('otp')))) - { - $otp2 = Hash::make($request->input('otp')); - $date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa'); - $date2 = date('Y-m-d h:i:sa'); - $time1 = new DateTime($date2); - $time2 = new DateTime($date1); + if ($otp != null) { + if (($otp_length == 6 && !preg_match('/[a-z]/i', $request->input('otp')))) { + $otp2 = Hash::make($request->input('otp')); + $date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa'); + $date2 = date('Y-m-d h:i:sa'); + $time1 = new DateTime($date2); + $time2 = new DateTime($date1); $interval = $time1->diff($time2); - if ($interval->i > 30 || $interval->h > 0) - { + if ($interval->i > 30 || $interval->h > 0) { $message = Lang::get('lang.otp-expired'); - } - else - { - if (Hash::check($request->input('otp'), $otp->otp)) - { + } else { + if (Hash::check($request->input('otp'), $otp->otp)) { Otp::where('user_id', '=', $user->id) ->update(['otp' => '']); User::where('id', '=', $user->id) @@ -682,20 +564,14 @@ class AuthController extends Controller $this->openTicketAfterVerification($user->id); return $this->postLogin($request); - } - else - { + } else { $message = Lang::get('lang.otp-not-matched'); } } - } - else - { + } else { $message = Lang::get('lang.otp-invalid'); } - } - else - { + } else { $message = Lang::get('lang.otp-not-matched'); } } @@ -703,30 +579,24 @@ class AuthController extends Controller return \Redirect::route('otp-verification') ->withInput($request->input()) ->with(['values' => $request->input(), - 'number' => $user->mobile, - 'name' => $user->user_name, - 'fails' => $message,]); + 'number' => $user->mobile, + 'name' => $user->user_name, + 'fails' => $message, ]); } public function resendOTP(OtpVerifyRequest $request) { - if (!\Schema::hasTable('user_verification') || !\Schema::hasTable('sms')) - { + if (!\Schema::hasTable('user_verification') || !\Schema::hasTable('sms')) { $message = Lang::get('lang.opt-can-not-be-verified'); return $message; - } - else - { + } else { $sms = DB::table('sms')->get(); - if (count($sms) > 0) - { + if (count($sms) > 0) { \Event::fire(new \App\Events\LoginEvent($request)); return 1; - } - else - { + } else { $message = Lang::get('lang.opt-can-not-be-verified'); return $message; @@ -751,10 +621,8 @@ class AuthController extends Controller ->get(); Tickets::where(['user_id' => $id, 'status' => 6]) ->update(['status' => 1]); - if ($ticket != null) - { - foreach ($ticket as $value) - { + if ($ticket != null) { + foreach ($ticket as $value) { $ticket_id = $value->id; Ticket_Thread::where('ticket_id', '=', $ticket_id) ->update(['updated_at' => date('Y-m-d H:i:s')]); @@ -765,7 +633,7 @@ class AuthController extends Controller public function changeRedirect() { $provider = \Session::get('provider'); - $url = \Session::get($provider . 'redirect'); + $url = \Session::get($provider.'redirect'); \Config::set("services.$provider.redirect", $url); } @@ -773,8 +641,7 @@ class AuthController extends Controller { $url = url($redirect); \Session::set('provider', $provider); - \Session::set($provider . 'redirect', $url); + \Session::set($provider.'redirect', $url); $this->changeRedirect(); } - } diff --git a/app/Http/Controllers/Auth/PasswordController.php b/app/Http/Controllers/Auth/PasswordController.php index 978a41401..52e8dfe9d 100644 --- a/app/Http/Controllers/Auth/PasswordController.php +++ b/app/Http/Controllers/Auth/PasswordController.php @@ -57,12 +57,12 @@ class PasswordController extends Controller $user = User::where('email', '=', $request->only('email'))->orWhere('mobile', '=', $request->only('email'))->first(); if (isset($user)) { $user1 = $user->email; - //gen new code and pass - $code = str_random(60); + //gen new code and pass + $code = str_random(60); $password_reset_table = \DB::table('password_resets')->where('email', '=', $user->email)->first(); if (isset($password_reset_table)) { $password_reset_table = \DB::table('password_resets')->where('email', '=', $user->email)->update(['token' => $code, 'created_at' => $date]); - // $password_reset_table->token = $code; + // $password_reset_table->token = $code; // $password_reset_table->update(['token' => $code]); } else { $create_password_reset = \DB::table('password_resets')->insert(['email' => $user->email, 'token' => $code, 'created_at' => $date]); @@ -107,7 +107,7 @@ class PasswordController extends Controller $this->getResetValidationCustomAttributes() ); $credentials = $this->getResetCredentials($request); - // dd($credentials); + // dd($credentials); $email = $credentials['email']; $password = $credentials['password']; $token = $credentials['token']; diff --git a/app/Http/Controllers/Client/helpdesk/ClientTicketController.php b/app/Http/Controllers/Client/helpdesk/ClientTicketController.php index 05a262173..d39ee57e9 100644 --- a/app/Http/Controllers/Client/helpdesk/ClientTicketController.php +++ b/app/Http/Controllers/Client/helpdesk/ClientTicketController.php @@ -32,7 +32,7 @@ class ClientTicketController extends Controller $this->TicketWorkflowController = $TicketWorkflowController; // $this->middleware('auth'); // $this->middleware('role.user'); - $this->middleware('board'); + $this->middleware('board'); } /** diff --git a/app/Http/Controllers/Client/helpdesk/GuestController.php b/app/Http/Controllers/Client/helpdesk/GuestController.php index ae50f1c92..cdd03f0e6 100644 --- a/app/Http/Controllers/Client/helpdesk/GuestController.php +++ b/app/Http/Controllers/Client/helpdesk/GuestController.php @@ -98,13 +98,13 @@ class GuestController extends Controller if (Input::file('profile_pic')) { // fetching picture name $name = Input::file('profile_pic')->getClientOriginalName(); - // fetching upload destination path + // fetching upload destination path $destinationPath = 'uploads/profilepic'; - // adding a random value to profile picture filename + // adding a random value to profile picture filename $fileName = rand(0000, 9999).'.'.str_replace(' ', '_', $name); - // moving the picture to a destination folder + // moving the picture to a destination folder Input::file('profile_pic')->move($destinationPath, $fileName); - // saving filename to database + // saving filename to database $user->profile_pic = $fileName; } if ($request->get('mobile')) { @@ -237,6 +237,7 @@ class GuestController extends Controller //echo $user->password; if (Hash::check($request->input('old_password'), $user->getAuthPassword())) { $user->password = Hash::make($request->input('new_password')); + try { $user->save(); diff --git a/app/Http/Controllers/Client/helpdesk/UnAuthController.php b/app/Http/Controllers/Client/helpdesk/UnAuthController.php index 9af08b639..c41538b62 100644 --- a/app/Http/Controllers/Client/helpdesk/UnAuthController.php +++ b/app/Http/Controllers/Client/helpdesk/UnAuthController.php @@ -94,6 +94,7 @@ class UnAuthController extends Controller $ticket_token->token = $hashed_token; $ticket_token->save(); } + try { $this->PhpMailController->sendmail( $from = $this->PhpMailController->mailfrom('1', '0'), $to = ['name' => $username, 'email' => $user_details->email], $message = ['subject' => 'Ticket link Request ['.$ticket_number.']', 'scenario' => 'check-ticket'], $template_variables = ['user' => $username, 'ticket_link_with_number' => url('show-ticket/'.$ticket->id.'/'.$token)] @@ -270,6 +271,7 @@ class UnAuthController extends Controller } else { $from_email = $sending_emails->id; } + try { $this->PhpMailController->sendmail($from = $this->PhpMailController->mailfrom('0', $tickets->dept_id), $to = ['name' => $user_name, 'email' => $email], $message = ['subject' => $ticket_subject.'[#'.$ticket_number.']', 'scenario' => 'close-ticket'], $template_variables = ['ticket_number' => $ticket_number]); } catch (\Exception $e) { @@ -347,11 +349,11 @@ class UnAuthController extends Controller } // Follow up tickets - public function followup() - { - $followup = Followup::whereId('1')->first(); - $condition = $followup->condition; - // dd($condition); + public function followup() + { + $followup = Followup::whereId('1')->first(); + $condition = $followup->condition; + // dd($condition); switch ($condition) { case 'everyMinute': @@ -383,34 +385,34 @@ class UnAuthController extends Controller break; } - if ($followup->status = 1) { - $tickets = Tickets::where('id', '>=', 1)->where('status', '!=', 5)->get(); - // dd( $tickets); - // $tickets=Tickets::where('id', '>=', 1)->where('status', '!=', 5)->pluck('id'); - // dd( $tickets); - // $id=1; - foreach ($tickets as $ticket) { + if ($followup->status = 1) { + $tickets = Tickets::where('id', '>=', 1)->where('status', '!=', 5)->get(); + // dd( $tickets); + // $tickets=Tickets::where('id', '>=', 1)->where('status', '!=', 5)->pluck('id'); + // dd( $tickets); // $id=1; - // $id++; - // $ticket=Tickets::where('status', '!=', 5)->get(); + foreach ($tickets as $ticket) { + // $id=1; + // $id++; + // $ticket=Tickets::where('status', '!=', 5)->get(); - // dd($ticket); - // if($ticket != null){ + // dd($ticket); + // if($ticket != null){ // dd('here'); - $ck = date('Y-m-d H:i:s', strtotime($ticket->updated_at.$followup_set)); - // dd($ck); - $current_time = date('Y-m-d H:i:s'); - if ($current_time > $ck) { - $ticket->follow_up = 1; - $ticket->save(); - // Tickets::where('id', '=',$id) + $ck = date('Y-m-d H:i:s', strtotime($ticket->updated_at.$followup_set)); + // dd($ck); + $current_time = date('Y-m-d H:i:s'); + if ($current_time > $ck) { + $ticket->follow_up = 1; + $ticket->save(); + // Tickets::where('id', '=',$id) // ->update(['follow_up' => 1]); // } - } - // if($id=2) + } + // if($id=2) // {dd($ticket);} + } } - } - } + } } diff --git a/app/Http/Controllers/Common/ApiSettings.php b/app/Http/Controllers/Common/ApiSettings.php index ddc844401..2276963b7 100644 --- a/app/Http/Controllers/Common/ApiSettings.php +++ b/app/Http/Controllers/Common/ApiSettings.php @@ -51,6 +51,7 @@ class ApiSettings extends Controller $this->validate($request, [ 'ticket_detail' => 'url', ]); + try { // dd($request->input()); DB::table('settings_system') @@ -91,6 +92,7 @@ class ApiSettings extends Controller $this->postHook($data); } catch (Exception $ex) { dd($ex); + throw new Exception($ex->getMessage()); } } @@ -106,6 +108,7 @@ class ApiSettings extends Controller } } catch (Exception $ex) { dd($ex); + throw new Exception($ex->getMessage()); } } diff --git a/app/Http/Controllers/Common/PhpMailController.php b/app/Http/Controllers/Common/PhpMailController.php index 3432c50f5..b90c22138 100644 --- a/app/Http/Controllers/Common/PhpMailController.php +++ b/app/Http/Controllers/Common/PhpMailController.php @@ -234,15 +234,15 @@ class PhpMailController extends Controller if ($cc != null) { foreach ($cc as $collaborator) { //mail to collaborators - $collab_user_id = $collaborator->user_id; + $collab_user_id = $collaborator->user_id; $user_id_collab = User::where('id', '=', $collab_user_id)->first(); $collab_email = $user_id_collab->email; $m->cc($collab_email); } } - // $mail->addBCC($bc); - $size = count($attach); + // $mail->addBCC($bc); + $size = count($attach); if ($size > 0) { for ($i = 0; $i < $size; $i++) { if (is_array($attach) && array_key_exists($i, $attach)) { diff --git a/app/Http/Controllers/Common/SettingsController.php b/app/Http/Controllers/Common/SettingsController.php index f71ebe2a8..4771d2e39 100644 --- a/app/Http/Controllers/Common/SettingsController.php +++ b/app/Http/Controllers/Common/SettingsController.php @@ -120,6 +120,7 @@ class SettingsController extends Controller $widget = $widgets->where('id', '=', $id)->first(); $widget->title = $request->title; $widget->value = $request->content; + try { $widget->save(); @@ -198,6 +199,7 @@ class SettingsController extends Controller $widget = $widgets->where('id', '=', $id)->first(); $widget->title = $request->title; $widget->value = $request->content; + try { $widget->save(); @@ -234,6 +236,7 @@ class SettingsController extends Controller $data->name = $request->input('name'); $data->email = $request->input('email'); $data->password = Crypt::encrypt($request->input('password')); + try { $data->save(); @@ -257,6 +260,7 @@ class SettingsController extends Controller $pass = $request->input('password'); $password = Crypt::encrypt($pass); $settings->password = $password; + try { $settings->save(); } catch (Exception $e) { @@ -270,6 +274,7 @@ class SettingsController extends Controller $settings->logo = $fileName; $settings->save(); } + try { $settings->fill($request->except('logo', 'password'))->save(); @@ -364,6 +369,7 @@ class SettingsController extends Controller public function PostPlugins(Request $request) { $this->validate($request, ['plugin' => 'required|mimes:application/zip,zip,Zip']); + try { if (!extension_loaded('zip')) { throw new Exception('Please enable zip extension in your php'); diff --git a/app/Http/Controllers/Installer/helpdesk/InstallController.php b/app/Http/Controllers/Installer/helpdesk/InstallController.php index b77173fbf..c1fe9ed05 100644 --- a/app/Http/Controllers/Installer/helpdesk/InstallController.php +++ b/app/Http/Controllers/Installer/helpdesk/InstallController.php @@ -364,7 +364,7 @@ class InstallController extends Controller $datacontent = File::get($install); $datacontent = str_replace('%0%', $value, $datacontent); File::put($install, $datacontent); -// setting email settings in route + // setting email settings in route $smtpfilepath = "\App\Http\Controllers\Common\SettingsController::smtp()"; $link = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; @@ -375,6 +375,7 @@ class InstallController extends Controller $datacontent2 = str_replace('http://localhost', $link, $datacontent2); File::put($app_url, $datacontent2); $language = Cache::get('language'); + try { Cache::flush(); diff --git a/app/Http/Controllers/Job/MailController.php b/app/Http/Controllers/Job/MailController.php index 0801c26ac..bab160754 100644 --- a/app/Http/Controllers/Job/MailController.php +++ b/app/Http/Controllers/Job/MailController.php @@ -43,6 +43,7 @@ class MailController extends Controller public function getServiceForm($short_name) { $form = ''; + try { switch ($short_name) { case 'smtp': diff --git a/app/Http/Middleware/CheckUpdate.php b/app/Http/Middleware/CheckUpdate.php index a37e617e0..59fdfc97f 100644 --- a/app/Http/Middleware/CheckUpdate.php +++ b/app/Http/Middleware/CheckUpdate.php @@ -49,8 +49,8 @@ class CheckUpdate $notify = new BarNotification(); if (!\Schema::hasTable('bar_notifications')) { $url = url('database-upgrade'); - //$string = "Your Database is outdated please upgrade Now !"; - echo view('themes.default1.update.database', compact('url')); + //$string = "Your Database is outdated please upgrade Now !"; + echo view('themes.default1.update.database', compact('url')); exit; } $not = $notify->get(); diff --git a/app/Http/Requests/helpdesk/TicketRequest.php b/app/Http/Requests/helpdesk/TicketRequest.php index 3dd05d61e..de5d0e79c 100644 --- a/app/Http/Requests/helpdesk/TicketRequest.php +++ b/app/Http/Requests/helpdesk/TicketRequest.php @@ -29,6 +29,7 @@ class TicketRequest extends Request public function rules() { $error = ''; + try { $size = $this->size(); if ($size > 800 || $size == 0) { diff --git a/app/Http/routes.php b/app/Http/routes.php index 304be246f..880581963 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -28,7 +28,7 @@ Route::group(['middleware' => ['web']], function () { | Here is defining entire routes for the Admin Panel | */ - Route::get('password/email/{one?}/{two?}/{three?}/{four?}/{five?}', ['as' => 'password.email', 'uses' => 'Auth\PasswordController@getEmail']); + Route::get('password/email/{one?}/{two?}/{three?}/{four?}/{five?}', ['as' => 'password.email', 'uses' => 'Auth\PasswordController@getEmail']); Breadcrumbs::register('password.email', function ($breadcrumbs) { $breadcrumbs->parent('/'); $breadcrumbs->push('Login', url('auth/login')); @@ -36,15 +36,15 @@ Route::group(['middleware' => ['web']], function () { }); // register page - Route::get('auth/register/{one?}/{two?}/{three?}/{four?}/{five?}', ['as' => 'auth.register', 'uses' => 'Auth\AuthController@getRegister']); + Route::get('auth/register/{one?}/{two?}/{three?}/{four?}/{five?}', ['as' => 'auth.register', 'uses' => 'Auth\AuthController@getRegister']); Breadcrumbs::register('auth.register', function ($breadcrumbs) { $breadcrumbs->parent('/'); $breadcrumbs->push('Login', url('auth/login')); $breadcrumbs->push('Create Account', url('auth/register')); }); - // Auth login - Route::get('auth/login/{one?}/{two?}/{three?}/{four?}/{five?}', ['as' => 'auth.login', 'uses' => 'Auth\AuthController@getLogin']); + // Auth login + Route::get('auth/login/{one?}/{two?}/{three?}/{four?}/{five?}', ['as' => 'auth.login', 'uses' => 'Auth\AuthController@getLogin']); Breadcrumbs::register('auth.login', function ($breadcrumbs) { $breadcrumbs->parent('/'); $breadcrumbs->push('Create Account', url('auth/register')); @@ -83,10 +83,10 @@ Route::group(['middleware' => ['web']], function () { Route::resource('teams', 'Admin\helpdesk\TeamController'); // in teams module, for CRUD Route::get('/teams/show/{id}', ['as' => 'teams.show', 'uses' => 'Admin\helpdesk\TeamController@show']); /* Get Team View */ - Breadcrumbs::register('teams.show', function ($breadcrumbs) { - $breadcrumbs->parent('teams.index'); - $breadcrumbs->push(Lang::get('lang.show'), url('teams/{teams}/show')); - }); + Breadcrumbs::register('teams.show', function ($breadcrumbs) { + $breadcrumbs->parent('teams.index'); + $breadcrumbs->push(Lang::get('lang.show'), url('teams/{teams}/show')); + }); Route::get('getshow/{id}', ['as' => 'teams.getshow.list', 'uses' => 'Admin\helpdesk\TeamController@getshow']); Route::resource('agents', 'Admin\helpdesk\AgentController'); // in agents module, for CRUD @@ -428,7 +428,7 @@ Route::group(['middleware' => ['web']], function () { // route to get the data on change Route::post('help-topic-report/{date1}/{date2}/{id}', ['as' => 'report.helptopic', 'uses' => 'Agent\helpdesk\ReportController@chartdataHelptopic']); /* To show dashboard pages */ Route::post('help-topic-pdf', ['as' => 'help.topic.pdf', 'uses' => 'Agent\helpdesk\ReportController@helptopicPdf']); - // Route to get details of agents + // Route to get details of agents Route::post('get-agents', ['as' => 'get-agents', 'uses' => 'Agent\helpdesk\UserController@getAgentDetails']); /* @@ -446,12 +446,12 @@ Route::group(['middleware' => ['web']], function () { Route::get('get-tag', ['as'=>'tag.get', 'uses'=>'Agent\helpdesk\Filter\TagController@getTag']); }); - /* - * Followup tickets - */ - Route::get('/ticket/followup', ['as' => 'followup.ticket', 'uses' => 'Agent\helpdesk\TicketController@followupTicketList']); // Get Closed Ticket / + /* + * Followup tickets + */ + Route::get('/ticket/followup', ['as' => 'followup.ticket', 'uses' => 'Agent\helpdesk\TicketController@followupTicketList']); // Get Closed Ticket / - Route::get('/ticket/get-followup', ['as' => 'get.followup.ticket', 'uses' => 'Agent\helpdesk\TicketController@getFollowup']); // Get tickets in datatable / + Route::get('/ticket/get-followup', ['as' => 'get.followup.ticket', 'uses' => 'Agent\helpdesk\TicketController@getFollowup']); // Get tickets in datatable / Route::get('/ticket/close/get-approval/{id}', ['as' => 'get.close.approval.ticket', 'uses' => 'Agent\helpdesk\TicketController@getCloseapproval']); // Get tickets in datatable / /* |------------------------------------------------------------------ @@ -494,11 +494,11 @@ Route::group(['middleware' => ['web']], function () { Route::get('check_ticket/{id}', ['as' => 'check_ticket', 'uses' => 'Client\helpdesk\GuestController@get_ticket_email']); //detail ticket information -// show ticket via have a ticket + // show ticket via have a ticket Route::get('show-ticket/{id}/{code}', ['as' => 'show.ticket', 'uses' => 'Client\helpdesk\UnAuthController@showTicketCode']); //detail ticket information //testing ckeditor -//=================================================================================== + //=================================================================================== Route::group(['middleware' => 'role.user', 'middleware' => 'auth'], function () { Route::get('client-profile', ['as' => 'client.profile', 'uses' => 'Client\helpdesk\GuestController@getProfile']); /* User profile get */ @@ -511,7 +511,7 @@ Route::group(['middleware' => ['web']], function () { Route::post('verify-client-number2', ['as' => 'post-client-verify-number', 'uses' => 'Client\helpdesk\GuestController@verifyOTP']); }); -//==================================================================================== + //==================================================================================== Route::get('checkticket', 'Client\helpdesk\ClientTicketController@getCheckTicket'); /* Check your Ticket */ Route::get('myticket', ['as' => 'ticket', 'uses' => 'Client\helpdesk\GuestController@getMyticket']); /* Get my tickets */ Route::get('myticket/{id}', ['as' => 'ticket', 'uses' => 'Client\helpdesk\GuestController@thread']); /* Get my tickets */ @@ -705,7 +705,7 @@ Route::group(['middleware' => ['web']], function () { * @author Vijay Sebastian * @name Faveo */ - Route::group(['prefix' => 'api/v1'], function () { + Route::group(['prefix' => 'api/v1'], function () { Route::post('authenticate', 'Api\v1\TokenAuthController@authenticate'); Route::get('authenticate/user', 'Api\v1\TokenAuthController@getAuthenticatedUser'); Route::get('/database-config', ['as' => 'database-config', 'uses' => 'Api\v1\InstallerApiController@config_database']); @@ -816,8 +816,8 @@ Route::group(['middleware' => ['web']], function () { Route::post('ticket/priority/edit1', ['as' => 'priority.edit1', 'uses' => 'Admin\helpdesk\PriorityController@priorityEdit1']); Route::get('ticket/priority/{ticket_priority}/edit', ['as' => 'priority.edit', 'uses' => 'Admin\helpdesk\PriorityController@priorityEdit']); Route::get('ticket/priority/{ticket_priority}/destroy', ['as' => 'priority.destroy', 'uses' => 'Admin\helpdesk\PriorityController@destroy']); - // user---arindam - Route::post('rolechangeadmin/{id}', ['as' => 'user.post.rolechangeadmin', 'uses' =>'Agent\helpdesk\UserController@changeRoleAdmin']); + // user---arindam + Route::post('rolechangeadmin/{id}', ['as' => 'user.post.rolechangeadmin', 'uses' =>'Agent\helpdesk\UserController@changeRoleAdmin']); Route::post('rolechangeagent/{id}', ['as' => 'user.post.rolechangeagent', 'uses' =>'Agent\helpdesk\UserController@changeRoleAgent']); Route::post('rolechangeuser/{id}', ['as' => 'user.post.rolechangeuser', 'uses' =>'Agent\helpdesk\UserController@changeRoleUser']); Route::get('password', ['as' => 'user.changepassword', 'uses' =>'Agent\helpdesk\UserController@randomPassword']); @@ -825,15 +825,15 @@ Route::group(['middleware' => ['web']], function () { Route::post('delete/{id}', ['as' => 'user.post.delete', 'uses' =>'Agent\helpdesk\UserController@deleteAgent']); // deleted user list - Route::get('deleted/user', ['as' => 'user.deleted', 'uses' => 'Agent\helpdesk\UserController@deletedUser']); + Route::get('deleted/user', ['as' => 'user.deleted', 'uses' => 'Agent\helpdesk\UserController@deletedUser']); Route::post('restore/{id}', ['as' => 'user.restore', 'uses' => 'Agent\helpdesk\UserController@restoreUser']); - //due today ticket - Route::get('duetoday', ['as' => 'ticket.duetoday', 'uses' =>'Agent\helpdesk\TicketController@dueTodayTicketlist']); + //due today ticket + Route::get('duetoday', ['as' => 'ticket.duetoday', 'uses' =>'Agent\helpdesk\TicketController@dueTodayTicketlist']); - // Route::post('duetoday/list/ticket', ['as' => 'ticket.post.duetoday', 'uses' =>'Agent\helpdesk\TicketController@getDueToday']); - Route::get('duetoday/list/ticket', ['as' => 'ticket.post.duetoday', 'uses' =>'Agent\helpdesk\TicketController@getDueToday']); /* Get Open Ticket */ + // Route::post('duetoday/list/ticket', ['as' => 'ticket.post.duetoday', 'uses' =>'Agent\helpdesk\TicketController@getDueToday']); + Route::get('duetoday/list/ticket', ['as' => 'ticket.post.duetoday', 'uses' =>'Agent\helpdesk\TicketController@getDueToday']); /* Get Open Ticket */ // Breadcrumbs::register('open.ticket', function ($breadcrumbs) { // $breadcrumbs->parent('dashboard'); // $breadcrumbs->push(Lang::get('lang.tickets') . '  >  ' . Lang::get('lang.open'), route('open.ticket')); diff --git a/app/Model/helpdesk/Notification/Notification.php b/app/Model/helpdesk/Notification/Notification.php index 0dd581268..3345ef092 100644 --- a/app/Model/helpdesk/Notification/Notification.php +++ b/app/Model/helpdesk/Notification/Notification.php @@ -59,7 +59,7 @@ class Notification extends BaseModel public function delete() { $this->deleteUserNotification(); - // $this->dummyDelete(); + // $this->dummyDelete(); parent::delete(); } } diff --git a/config/app.php b/config/app.php index 73e432c26..6c74a4407 100644 --- a/config/app.php +++ b/config/app.php @@ -187,8 +187,6 @@ return [ App\FaveoLog\LaravelLogViewerServiceProvider::class, App\FaveoStorage\StorageServiceProvider::class, Yajra\Datatables\DatatablesServiceProvider::class, - - ], /* diff --git a/database/migrations/2016_04_18_115852_create_workflow_name_table.php b/database/migrations/2016_04_18_115852_create_workflow_name_table.php index 06db5cd4a..8b8db67cf 100644 --- a/database/migrations/2016_04_18_115852_create_workflow_name_table.php +++ b/database/migrations/2016_04_18_115852_create_workflow_name_table.php @@ -23,13 +23,13 @@ class CreateWorkflowNameTable extends Migration }); } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('workflow_name'); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('workflow_name'); + } } diff --git a/database/migrations/2016_04_18_115900_create_workflow_rule_table.php b/database/migrations/2016_04_18_115900_create_workflow_rule_table.php index 008d897bd..61c21b7e0 100644 --- a/database/migrations/2016_04_18_115900_create_workflow_rule_table.php +++ b/database/migrations/2016_04_18_115900_create_workflow_rule_table.php @@ -27,16 +27,16 @@ class CreateWorkflowRuleTable extends Migration }); } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('workflow_rules', function (Blueprint $table) { - $table->dropForeign('workflow_rules_1'); - }); - Schema::drop('workflow_rules'); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('workflow_rules', function (Blueprint $table) { + $table->dropForeign('workflow_rules_1'); + }); + Schema::drop('workflow_rules'); + } } diff --git a/database/migrations/2016_04_18_115908_create_workflow_action_table.php b/database/migrations/2016_04_18_115908_create_workflow_action_table.php index 24b8471aa..5fc03fb97 100644 --- a/database/migrations/2016_04_18_115908_create_workflow_action_table.php +++ b/database/migrations/2016_04_18_115908_create_workflow_action_table.php @@ -24,16 +24,16 @@ class CreateWorkflowActionTable extends Migration }); } - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('workflow_action'); - Schema::table('workflow_action', function (Blueprint $table) { - $table->dropForeign('workflow_action_idfk_1'); - }); - } + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::drop('workflow_action'); + Schema::table('workflow_action', function (Blueprint $table) { + $table->dropForeign('workflow_action_idfk_1'); + }); + } } diff --git a/database/migrations/2016_05_10_102604_create_bar_notifications_table.php b/database/migrations/2016_05_10_102604_create_bar_notifications_table.php index c11bffd1a..7885818ee 100644 --- a/database/migrations/2016_05_10_102604_create_bar_notifications_table.php +++ b/database/migrations/2016_05_10_102604_create_bar_notifications_table.php @@ -20,7 +20,7 @@ class CreateBarNotificationsTable extends Migration }); $version = \Config::get('app.version'); $date = date('Y-m-d H:i:s'); - //\DB::table('bar_notifications')->insert(['key'=>'new-install','value'=>"Congrates ! You have installed $version",'created_at'=>$date]); + //\DB::table('bar_notifications')->insert(['key'=>'new-install','value'=>"Congrates ! You have installed $version",'created_at'=>$date]); } /** diff --git a/public/ckeditor/samples/old/assets/posteddata.php b/public/ckeditor/samples/old/assets/posteddata.php index 2baa84ed6..70b4952f2 100644 --- a/public/ckeditor/samples/old/assets/posteddata.php +++ b/public/ckeditor/samples/old/assets/posteddata.php @@ -41,7 +41,6 @@ if (!empty($_POST)) {
    From 1f63d38a911fe664b7d72508746a55c1986c3e60 Mon Sep 17 00:00:00 2001 From: Manish Verma Date: Mon, 4 Sep 2017 15:30:05 +0530 Subject: [PATCH 11/46] updates Added link to contribution guidelines in Readme.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 366ce887b..893b7dd1b 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ We are following Laravel loc Contributing -------------------------- -Create your own fork of Faveo master repositoray and use git-flow to create a new feature. Once the feature is published in your fork, send a pull request to begin the conversation of integrating your new feature into Faveo. +Create your own fork of Faveo master repositoray and use git-flow to create a new feature. Once the feature is published in your fork, send a pull request to begin the conversation of integrating your new feature into Faveo. Please see the contributing guidelines before sending pull requests. Help -------------------------- From 465fc84884a11e40d28908b0f944f2042e3b6eda Mon Sep 17 00:00:00 2001 From: donlimo <2481452+donlimo@users.noreply.github.com> Date: Sat, 7 Oct 2017 00:32:54 +0200 Subject: [PATCH 12/46] improved italian translation --- resources/lang/it/lang.php | 1826 +++++++++++++++++++----------- resources/lang/it/pagination.php | 2 +- resources/lang/it/passwords.php | 8 +- resources/lang/it/validation.php | 124 +- 4 files changed, 1215 insertions(+), 745 deletions(-) diff --git a/resources/lang/it/lang.php b/resources/lang/it/lang.php index 087f45769..75f065d43 100644 --- a/resources/lang/it/lang.php +++ b/resources/lang/it/lang.php @@ -17,62 +17,99 @@ return [ | Error |-------------------------------------- */ - - 'success' => 'Successo', - 'fails' => 'Fallito', - 'alert' => 'Allerta', - 'required-error' => 'Per favore inserire i campi richiesti', - 'invalid' => 'Id Utente o Password sbagliate', + 'success' => 'Successo', + 'fails' => 'Fallito', + 'alert' => 'Avviso', + 'warning' => 'Attenzione', + 'required-error' => 'Per favore compila tutti i campi richiesti', + 'invalid' => 'ID utente o password sbagliate', + 'sorry_something_went_wrong' => 'Ci dispiace, qualcosa è andato storto', + 'were_working_on_it_and_well_get_it_fixed_as_soon_as_we_can' => "Ci stiamo lavorando e risolveremo il problema quanto prima.", + 'we_are_sorry_but_the_page_you_are_looking_for_can_not_be_found' => 'Ci dispiace, la pagina che stai cercando non esiste.', + 'go_back' => 'Torna indietro', + 'the_board_is_offline' => 'Il sistema è offline', + 'error_establishing_connection_to_database' => 'Impossibile stabilire la connessione al database', + 'unauthorized_access' => 'Accesso non autorizzato', + 'not-autherised' => 'Non sei autorizzato', + 'otp-not-matched' => 'Oops! Il codice OTP che hai inserito non corrisponde a quello che ti abbiamo spedito.', + 'otp-invalid' => 'Il codice OTP deve essere un numero a 6 cifre.', + 'otp-input-title' => 'Inserisci il codice OTP di 6 cifre.', + 'otp-expired' => 'Il tuo codice OTP è scaduto.
    Clicca su "Ricevi OTP" per ricevere un nuovo codice OTP sul tuo cellulare.', + 'resend-otp-title' => 'Clicca qui per reinviare il codice OTP', /* |-------------------------------------- | Login Page |-------------------------------------- */ - 'Login_to_start_your_session' => 'Login per incominciare la tua sessione', - 'login' => 'Login', - 'remember' => 'Ricordami', - 'signmein' => 'Segnami', - 'iforgot' => 'Ho dimenticato la Password', - 'email_address' => 'Indirizzo E-Mail', - 'password' => 'Password', - 'woops' => 'Whoops!', - 'theirisproblem' => 'Ci sono problemi con ciò che hai inserito.', - 'login' => 'Login', - 'e-mail' => 'E-mail', - 'reg_new_member' => 'Registra una nuova associazione', + 'login_to_start_your_session' => 'Collegati per cominciare la tua sessione', + 'login' => 'Accedi', + 'remember' => 'Ricordami', + 'signmein' => 'Iscrivimi', + 'iforgot' => 'Ho dimenticato la password', + 'email_address' => 'Indirizzo email', + 'password' => 'Password', + 'password_confirmation' => 'Conferma password', + 'woops' => 'Whoops!', + 'theirisproblem' => 'Ci sono problemi con ciò che hai inserito.', + 'login' => 'Accedi', + 'e-mail' => 'E-mail', + 'reg_new_member' => 'Registra un nuovo membro', + 'this_account_is_currently_inactive' => 'Questo account non è attualmente attivo!', + 'not-registered' => 'Email/utente non registrati', + 'verify' => 'Verifica', + 'enter-otp' => 'Inserisci OTP', + 'did-not-recive-code' => 'Non hai ricevuto il codice?', + 'resend_otp' => 'Ricevi OTP', + 'verify-screen-msg' => 'Il tuo account non è attualmente attivo.
    Per attivarlo, per favore inserisci il codice OTP che abbiamo inviato', + 'otp-sent' => 'Abbiamo un inviato un codice OTP al tuo numero.', + 'verify-number' => 'Verifica numero', + 'get-verify-message' => 'Inserisci il codice OTP che abbiamo inviato al tuo numero.', + 'number-verification-sussessfull' => 'Il tuo numero è stato verificato correttamente, per favore attendi. Stiamo aggiornando il tuo profilo.', + 'enter_your_email_here' => 'Inserisci la tua mail', /* |-------------------------------------- | Register Page |-------------------------------------- */ - 'registration' => 'Registrazione', - 'full_name' => 'Nome completo', - 'firstname' => 'Nome', - 'lastname' => 'Cognome', - 'profilepicture' => 'Foto del Profilo', - 'oldpassword' => 'Vecchia Password', - 'newpassword' => 'Nuova Password', - 'retype_password' => 'Reinserisci Password', - 'i_agree_to_the' => 'Concordo con', - 'terms' => 'termini', - 'register' => 'Registra', - 'i_already_have_a_membership' => 'Sono già associato', + 'registration' => 'Registrazione', + 'full_name' => 'Nome completo', + 'firstname' => 'Nome', + 'lastname' => 'Cognome', + 'profilepicture' => 'Foto del profilo', + 'oldpassword' => 'Vecchia password', + 'newpassword' => 'Nuova password', + 'retype_password' => 'Reinserisci password', + 'i_agree_to_the' => 'Concordo con', + 'terms' => 'termini', + 'register' => 'Registrati', + 'i_already_have_a_membership' => 'Sono già registrato', + 'see-profile1' => 'Clicca qui per vedere il profilo di ', + 'see-profile2' => '', + 'activate_your_account_click_on_Link_that_send_to_your_mail' => 'Attiva il tuo account! Clicca sul link che abbiamo spedito alla tua email', + 'activate_your_account_click_on_Link_that_send_to_your_mail_and_moble' => 'Attiva il tuo account! Clicca sul link che abbiamo spedito alla tua email o collegati con il tuo account ed inserisci il codice OTP che abbiamo inviato sul tuo cellulare', + 'activate_your_account_click_on_Link_that_send_to_your_mail_sms_plugin_inactive_or_not_setup' => 'Account creato, per favore contatta l\'amministratore poichè non siamo riusciti a spedire il codice OTP sul tuo cellulare e la mail al tuo indirizzo.', + 'this_field_do_not_match_our_records' => 'Questo campo non corrisponde ai nostri archivi.', + 'we_have_e-mailed_your_password_reset_link' => 'Abbiamo spedito per email il link di reset password!', + "we_can't_find_a_user_with_that_e-mail_address" => "Non riusciamo a trovare un utente con quell\'indirizzo email.", /* |-------------------------------------- | Reset Password Page |-------------------------------------- */ - 'reset_password' => 'Resetta la Password', + 'reset_password' => 'Resetta la password', + 'password-reset-successfully' => 'La tua password è stata resettata. Collegati con la nuova password', + 'password-can-not-reset' => 'Non è stato possibile resettare la password, per favore riprova più tardi.', /* |-------------------------------------- | Forgot Password Page |-------------------------------------- */ 'i_know_my_password' => 'Conosco la mia password', - 'recover_passord' => 'Recupera Password', - 'send_password_reset_link' => 'Invia Link per il Reset della password', - 'enter_email_to_reset_password' => 'Inserisci E-mail per il reset della password', + 'recover_passord' => 'Recupera password', + 'send_password_reset_link' => 'Invia link per il reset della password', + 'enter_email_to_reset_password' => 'Inserisci email per il reset della password', 'link' => 'Link', + 'email_or_mobile' => 'Email o cellulare', /* |---------------------------------------------------------------------------------------- | Emails Pages [English(en)] @@ -83,69 +120,94 @@ return [ | customize your views to better match your application. | */ - 'admin_panel' => 'Panello Amministrativo', + 'admin_panel' => 'Panello amministrativo', /* |-------------------------------------- | Emails Create Page |-------------------------------------- */ - 'emails' => 'Emails', - 'incoming_emails' => 'Emails In Arrivo', - 'reuired_authentication' => 'Autenticazione Richiesta', - 'fetching_email_via_imap' => 'Caricamento Email via IMAP', - 'create_email' => 'Crea Email', - 'email_address' => 'Indirizzo Email', - 'email_name' => 'Nome Email', - 'help_topic' => 'Argomento della Guida', - 'auto_response' => 'Auto Risposta', - 'host_name' => 'Nome Host', - 'port_number' => 'Numero Porta', - 'mail_box_protocol' => 'Protocollo di Casella Mail', - 'authentication_required' => 'Autenticazione Richiesta', - 'yes' => 'Si', - 'no' => 'No', - 'header_spoofing' => 'Header Spoofing', - 'allow_for_this_email' => 'Permetti per questa Email', - 'imap_config' => 'Configurazione IMAP', - 'email_information_and_settings' => 'Informazioni e settaggi Email', - 'incoming_email_information' => 'Informazioni Email in entrata', - 'outgoing_email_information' => 'Informazioni Email in uscita', - 'new_ticket_settings' => 'Settaggi Nuovo Ticket', - 'protocol' => 'Protocollo', - 'fetching_protocol' => 'Caricando Protocol', - 'transfer_protocol' => 'Trasferendo Protocol', - 'from_name' => 'Da Nome', - 'add_an_email' => 'Aggiungi una Email', - 'edit_an_email' => 'Modifica una Email', - 'disable_for_this_email_address' => 'Disabilita per questo indirizzo Email ', + 'emails' => 'Lista email', + 'incoming_emails' => 'Email in arrivo', + 'reuired_authentication' => 'Autenticazione richiesta', + 'fetching_email_via_imap' => 'Caricamento email via IMAP', + 'create_email' => 'Crea email', + 'email_address' => 'Indirizzo email', + 'email_name' => 'Nome email', + 'help_topic' => 'Area di supporto', + 'auto_response' => 'Auto risponditore', + 'host_name' => 'Host', + 'port_number' => 'Porta', + 'mail_box_protocol' => 'Protocollo casella Mail', + 'authentication_required' => 'Autenticazione richiesta', + 'yes' => 'Si', + 'no' => 'No', + 'header_spoofing' => 'Header Spoofing', + 'allow_for_this_email' => 'Permetti per questa email', + 'imap_config' => 'Configurazione IMAP', + 'email_information_and_settings' => 'Informazioni e parametri email', + 'incoming_email_information' => 'Parametri posta in entrata', + 'outgoing_email_information' => 'Parametri posta in uscita', + 'new_ticket_settings' => 'Settaggi Nuovo Ticket', + 'protocol' => 'Protocollo', + 'fetching_protocol' => 'Protocollo', + 'transfer_protocol' => 'Protocollo', + 'from_name' => 'Nome mittente', + 'add_an_email' => 'Aggiungi email', + 'edit_an_email' => 'Modifica email', + 'disable_for_this_email_address' => 'Disabilita per questo indirizzo email ', + 'validate_certificates_from_tls_or_ssl_server' => 'Valida certificato TLS/SSL', + 'authentication' => 'Autenticazione', + 'incoming_email_connection_failed_please_check_email_credentials_or_imap_settings' => 'Connessione posta in entrata fallita! Per favore controlla credenziali e parametri', + 'outgoing_email_connection_failed' => 'Connessione posta in uscita fallita! Per favore controlla credenziali e parametri', + 'you_cannot_delete_system_default_email' => 'Non puoi cancellare l\'email di default di sistema', + 'email_deleted_sucessfully' => 'Email cancellata', + 'email_can_not_delete' => 'Impossibile cancellare email', + 'outgoing_email_failed' => 'Invio email fallito', + 'system-email-not-configured' => 'Non è possibile processare la richiesta mail in quanto il sistema non ha email configurate per l\'invio. Per favore contatta l\'amministratore di sistema.', /* |-------------------------------------- | Ban Emails Create Page |-------------------------------------- */ - 'ban_lists' => 'Lista Ban', - 'ban_email' => 'Email Ban', - 'banlists' => 'Liste Ban', - 'ban_status' => 'Status Ban', + 'ban_lists' => 'Lista ban', + 'ban_email' => 'Banna email', + 'banlists' => 'Liste ban', + 'ban_status' => 'Stato ban', + 'list_of_banned_emails' => 'Lista email bannate', + 'edit_banned_email' => 'Modifica email bannata', + 'create_a_banned_email' => 'Crea ban email', + 'email_banned_sucessfully' => 'Email bannata con successo', + 'email_can_not_ban' => 'Non è stato possibile bannare l\'email', + 'banned_email_updated_sucessfully' => 'Ban email aggiornato', + 'banned_email_not_updated' => 'Ban email non aggiornato', + 'banned_removed_sucessfully' => 'Ban rimosso con successo', /* |-------------------------------------- | Templates Index Page |-------------------------------------- */ - 'templates' => 'Templates', - 'template_set' => 'Template Sets', - 'create_template' => 'Crea Template', - 'edit_template' => 'Modifica Template', - 'in_use' => 'In Uso', + 'templates' => 'Modelli', + 'template_set' => 'Set modelli', + 'create_template' => 'Crea modello', + 'edit_template' => 'Modifica modello', + 'list_of_templates_sets' => 'Lista modelli', + 'create_set' => 'Crea set', + 'template_name' => 'Nome modello', + 'template_saved_successfully' => 'Modello salvato con successo', + 'template_updated_successfully' => 'Modello aggiornato con successo', + 'in_use' => 'In uso', + 'you_have_created_a_new_template_set' => 'Hai creato un nuovo set di modelli', + 'you_have_successfully_activated_this_set' => 'Hai attivato con successo questo set di modelli', + 'template_set_deleted_successfully' => 'Set di modelli cancellato con successo', //Template Description - 'Create ticket agent' => 'Email di notifica che è inviata a Agente e Admin quando il ticket è creato', + 'Create ticket agent' => 'Email di notifica che viene inviata ad agente ed amministratore quando il ticket viene creato', 'Assign ticket' => 'Ticket assegnato ad un agente', 'Create ticket' => 'Mail inviata al cliente per conferma creazione ticket', - 'Check ticket' => 'Se un cliente vuole controllare attraverso il portale clienti un link verrà inviato al cliente.Questo link è per il cliente per vedere i dettagli del ticket co il suo numero senza loggarsi nel sistema', + 'Check ticket' => 'Se un cliente vuole controllare attraverso il portale clienti un link verrà inviato al cliente. Questo link è per il cliente per vedere i dettagli del ticket co il suo numero senza loggarsi nel sistema', 'Ticket reply agent' => 'Una notifica è inviata ad un agente una volta che il cliente risponde al ticket', - 'Registration notification' => 'Password e nome utente sono inviati in email alla prima registrazione', - 'Reset password' => 'Email con il link per il reset della Password', - 'Error report' => 'Report Errori', + 'Registration notification' => 'Password e nome utente sono inviati per email alla prima registrazione', + 'Reset password' => 'Email con il link per il reset della password', + 'Error report' => 'Report errori', 'Ticket creation' => 'Prima notifica inviata dal sistema sulla creazione del ticket al cliente', 'Ticket reply' => 'Una risposta fatta da un agente sul ticket,una notifica è inviata al cliente e ai collaboratori', 'Close ticket' => 'Mail inviata al cliente per la chiusura di un ticket', @@ -155,19 +217,25 @@ return [ | Templates Create Page |-------------------------------------- */ - 'template_set_to_clone' => 'Template set da clonare', + 'template_set_to_clone' => 'Set modelli da clonare', 'language' => 'Lingua', /* |-------------------------------------- | Diagnostics Page |-------------------------------------- */ - 'diagnostics' => 'Diagnostici', - 'from' => 'Da', - 'to' => 'A', - 'subject' => 'Soggetto', - 'message' => 'Messaggio', - 'send' => 'Invia', + 'diagnostics' => 'Diagnostica', + 'from' => 'Da', + 'to' => 'A', + 'subject' => 'Oggetto', + 'message' => 'Messaggio', + 'send' => 'Invia', + 'choose_an_email' => 'Scegli email', + 'email_diagnostic' => 'Diagnostica email', + 'send-mail-to-diagnos' => 'Spedisci una mail per controllare i parametri in uscita', + 'message_has_been_sent' => 'Messaggio spedito', + 'message_sent_from_php_mail' => 'Messaggio spedito da PHP-Mail', + 'mailer_error' => 'Errore Mailer', /* |---------------------------------------------------------------------------------------- | Settings Pages [English(en)] @@ -184,172 +252,267 @@ return [ | Company Settings Page |-------------------------------------- */ - 'company' => 'Compagnia', - 'website' => 'Sito Web', - 'phone' => 'Telefono', - 'address' => 'Indirizzo', - 'landing' => 'Landing Page', - 'offline' => 'Offline Page', - 'thank' => 'Thank Page', - 'logo' => 'Logo', - 'save' => 'Salva', + 'country-code' => 'INT', + 'company' => 'Azienda', + 'company_settings' => 'Impostazioni azienda', + 'website' => 'Sito Web', + 'phone' => 'Telefono', + 'address' => 'Indirizzo', + 'landing' => 'Pagina di destinazione', + 'offline' => 'Pagina offline', + 'thank' => 'Pagina di ringraziamento', + 'logo' => 'Logo', + 'save' => 'Salva', + 'delete-logo' => 'Cancella logo', + 'click-delete' => 'Clicca per cancellare', + 'use_logo' => 'Usa logo', + 'company_updated_successfully' => 'Azienda aggiornata correttamente', + 'company_can_not_updated' => 'Impossibile aggiornare dati azienda', + 'enter-country-phone-code' => 'Inserisci il codice telefonico del paese', + 'country-code-required-error' => 'Il codice paese è obbligatorio con i numeri telefonici.', + 'incorrect-country-code-error' => 'Codice paese errato.', /* |-------------------------------------- | System Settings Page |-------------------------------------- */ - 'system' => 'Sistema', - 'online' => 'Online', - 'offline' => 'Offline', - 'name/title' => 'Nome/Titolo', - 'pagesize' => 'Grandezza Pagina', - 'url' => 'URL', - 'default_department' => 'Dipartimento di Default', - 'loglevel' => 'Livello Log', - 'purglog' => 'Ripulisci Logs', - 'nameformat' => 'Formattazione nome', - 'timeformat' => 'Formato Ora', - 'date' => 'Data', - 'dateformat' => 'Formato Data', - 'date_time' => 'Formato Data e Ora', - 'day_date_time' => 'Formato Giorno,Data e Ora', - 'timezone' => 'Fuso orario di default', - 'api' => 'Api', - 'api_key' => 'Chiave Api', - 'api_key_mandatory' => 'Chiave Api obbligatoria', - 'api_configurations' => 'Configurazioni Api', - 'generate_key' => 'Genera chiave', + 'system' => 'Sistema', + 'online' => 'Online', + 'offline' => 'Manutenzione', + 'name/title' => 'Nome/Titolo', + 'pagesize' => 'Grandezza pagina', + 'url' => 'URL', + 'default_department' => 'Dipartimento di default', + 'loglevel' => 'Livello log', + 'purglog' => 'Ripulisci logs', + 'nameformat' => 'Formattazione nome', + 'timeformat' => 'Formato ora', + 'date' => 'Data', + 'dateformat' => 'Formato data', + 'date_time' => 'Formato data ed ora', + 'day_date_time' => 'Formato giorno, data ed ora', + 'timezone' => 'Fuso orario di default', + 'Ticket-created-successfully' => 'Ticket creato con successo!', + 'Ticket-created-successfully2' => 'Il ticket è stato creato ma non verificato. Verrà mostrato non appena l\'utente verificherà il proprio account.', + 'system_updated_successfully' => 'Sistema aggiornato correttamente', + 'system_can_not_updated' => 'Il sistema non può essere aggiornato', + 'ticket_updated_successfully' => 'Ticket aggiornato con successo', + 'ticket_can_not_updated' => 'Impossibile aggiornare il ticket', + 'email_updated_successfully' => 'Email aggiornata con successo', + 'email_can_not_updated' => 'Impossibile aggiornare email', + 'select_a_time_zone' => 'Seleziona un fuso orario', + 'select_a_date_time_format' => 'Seleziona un formato data e ora', + 'Ticket-has-been-created-successfully-your-ticket-number-is' => 'Ticket creato con successo, il numero ticket è', + 'Please-save-this-for-future-reference' => 'Per favore conserva questo numero per riferimenti futuri', + 'email-moble-already-taken' => 'Email o cellulare già presente nel sistema', + 'mobile-has-been-taken' => 'Cellulare già presente nel sistema', + 'failed-to-create-user-tcket-as-mobile-has-been-taken' => 'Impossibile creare un nuovo ticket poichè il cellulare inserito è associato con un utente già esistente. Verifica i dettagli inseriti o crea un nuovo utente', + 'rtl' => 'RTL (Da destra a sinistra)', + 'the_rtl_support_is_only_applicable_to_the_outgoing_mails' => 'Il supporto RTL è applicabile solamente alle mail in uscita', + 'user_set_ticket_status' => 'Consenti agli utenti di impostare lo stato del ticket', + 'send_otp_for_account_verfication' => 'Invia codice OTP per la verifica degli utenti', + 'otp_usage_info' => 'Se disabilitato invieremo una mail di verifica ed un codice OTP agli utenti. Se la mail non è obbligatoria gli utenti riceveranno le credenziali di accesso sul cellulare. [NOTA: gli SMS verranno spediti usando il plugin Faveo SMS].', + 'send_otp_title_message' => 'Send OTP for user account verification, reset password and mobile number verification', + 'allow_unverified_users_to_create_ticket' => 'Consenti agli utenti non verificati di creare ticket', + 'make-email-mandatroy' => 'Rendi l\'email obbligatoria per la creazione utente/ticket', + 'email_man_info' => 'Se disabilitato gli utenti saranno in grado di registrarsi senza indirizzo email. Si raccomanda di disabilitare la possibilità di creare ticket da parte di utenti non verificati. Così facendo gli utenti potranno ricevere notifiche e collegarsi col proprio cellulare con nome utente e password ricevuti.', /* |-------------------------------------- | Email Settings Page |-------------------------------------- */ 'email' => 'Email', - 'default_template' => 'Template Set di Default:', - 'default_system_email' => 'Sistema Email di Default:', - 'default_alert_email' => 'Allerta Email di Default:', - 'admin_email' => 'indirizzo Email Amministratori:', - 'email_fetch' => 'Caricamento Email:', - 'enable' => 'Attiva', - 'default_MTA' => 'MTA di Default', + 'email-settings' => 'Impostazioni email', + 'default_template' => 'Modello di default:', + 'default_system_email' => 'Sistema email di default:', + 'default_alert_email' => 'Allerta email di default:', + 'admin_email' => 'Indirizzo email amministratori:', + 'email_fetch' => 'Caricamento email:', + 'enable' => 'Attivo', + 'default_MTA' => 'MTA di default', 'fetch_auto-corn' => 'Carica con auto-cron', - 'strip_quoted_reply' => 'Rimuovi Citazioni nella Risposta', - 'reply_separator' => 'Tag Separatore nella Risposta', - 'accept_all_email' => 'Accetta Tutte le Emails', + 'strip_quoted_reply' => 'Rimuovi citazioni nella risposta', + 'reply_separator' => 'Tag separatore nella risposta', + 'accept_all_email' => 'Accetta tutte le emails', 'accept_email_unknown' => 'Accetta email da utenti sconosciuti', - 'accept_email_collab' => 'Accetta Email Da Collaboratori', + 'accept_email_collab' => 'Accetta email da collaboratori', 'automatically_and_collab_from_email' => 'Aggiungi automaticamente collaboratori dai campi email', - 'default_alert_email' => 'Allerta Email di Default', + 'default_alert_email' => 'Allerta email di default', 'attachments' => 'Allegati', - 'email_attahment_user' => 'Email attachments to the user', - 'cron_notification' => 'Attiva Notifica cron', + 'email_attahment_user' => 'Allegati email per l\'utente', + 'cron_notification' => 'Attiva notifica cron', + 'cron' => 'Schedulatore cron', + 'cron-jobs' => 'Cron jobs', + 'crone-url-message' => "Questi sono i cron job di Faveo per il tuo sistema.", + 'clipboard-copy-message' => 'Copiato negli appunti.', + 'click' => 'Clicca qui', + 'check-cron-set' => 'per vedere come impostare cron jobs sul tuo server.', + 'notification-email' => 'Rapporto giornaliero', + 'click-url-copy' => 'Clicca qui per copiare URL', + 'job-scheduler-error' => 'Impossibile aggiornare schedulatore cron job.', + 'job-scheduler-success' => 'Schedulatore cron aggiornato con successo.', /* |-------------------------------------- | Ticket Settings Page |-------------------------------------- */ 'ticket' => 'Ticket', - 'default_ticket_number_format' => 'Default Ticket Number Format', - 'default_ticket_number_sequence' => 'Default Ticket Number Sequence', - 'default_status' => 'Default Status', - 'default_priority' => 'Default Priority', - 'default_sla' => 'Default SLA', - 'default_help_topic' => 'Default Help Topic', - 'maximum_open_tickets' => 'Maximum Open Tickets', - 'agent_collision_avoidance_duration' => 'Agent Collision Avoidance Duration', - 'human_verification' => 'Human Verification', - 'claim_on_response' => 'Claim on Response', - 'assigned_tickets' => 'Assigned Tickets', - 'answered_tickets' => 'Answered Tickets', - 'agent_identity_masking' => 'Agent Identity Masking', - 'enable_HTML_ticket_thread' => 'Enable HTML Ticket Thread', - 'allow_client_updates' => 'Allow Client Updates', + 'ticket-setting' => 'Impostazioni ticket', + 'default_ticket_number_format' => 'Formato numero ticket di default', + 'default_ticket_number_sequence' => 'Formato sequenza numero ticket di default', + 'default_status' => 'Stato di default', + 'default_priority' => 'Priorità di default', + 'default_sla' => 'SLA di default', + 'default_help_topic' => 'Area di supporto di default', + 'maximum_open_tickets' => 'Massimo numero ticket aperti', + 'agent_collision_avoidance_duration' => 'Periodo prevenzione collisione agenti', + 'human_verification' => 'Verifica umano', + 'claim_on_response' => 'Richiesta di risposta', + 'assigned_tickets' => 'Ticket assegnati', + 'answered_tickets' => 'Ticket risposti', + 'agent_identity_masking' => 'Maschera identità degli agenti', + 'enable_HTML_ticket_thread' => 'Abilita HTML su discussione ticket', + 'allow_client_updates' => 'Consenti aggiornamenti cliente', + 'lock_ticket_frequency' => 'Blocco ticket', + 'only-once' => 'Solo una volta', + 'frequently' => 'Frequentemente', + 'reload-now' => 'Ricarica adesso', + 'ticket-lock-inactive' => 'Sei stato inattivo per un po\', per favore ricarica la pagina.', + 'make-system-default-mail' => 'Rendi questa mail predefinita per il sistema', + 'thread' => 'Thread', + 'labels' => 'Etichette', /* |-------------------------------------- | Access Settings Page |-------------------------------------- */ 'access' => 'Accesso', - 'expiration_policy' => 'Policy Scadenza Password', - 'allow_password_resets' => 'Permetti Password Reset', - 'reset_token_expiration' => 'Resetta Scadenza Token', - 'agent_session_timeout' => 'Timeout Sessione Agente', - 'bind_agent_session_IP' => 'Lega Sessione Agente a IP', - 'registration_required' => 'Registrazione Richiesta', - 'require_registration_and_login_to_create_tickets' => 'Richiede registrazione e login per creare tickets', - 'registration_method' => 'metodo di Registrazione', - 'user_session_timeout' => 'Timeout Sessione Utente', - 'client_quick_access' => 'Accesso Rapido per Cliente', + 'expiration_policy' => 'Politica scadenza password', + 'allow_password_resets' => 'Permetti reset della password', + 'reset_token_expiration' => 'Resetta scadenza token', + 'agent_session_timeout' => 'Timeout sessione agente', + 'bind_agent_session_IP' => 'Lega sessione agente ad IP', + 'registration_required' => 'Registrazione richiesta', + 'require_registration_and_login_to_create_tickets' => 'Richiede registrazione e login per creare ticket', + 'registration_method' => 'Metodo di registrazione', + 'user_session_timeout' => 'Timeout sessione ttente', + 'client_quick_access' => 'Accesso rapido cliente', + 'cron' => 'Cron', + 'cron_settings' => 'Impostazioni Cron', + 'system-settings' => 'Impostazioni di sistema', + 'settings-2' => 'Impostazioni', /* |-------------------------------------- | Auto-Response Settings Page |-------------------------------------- */ - 'auto_responce' => 'Auto Risposta', - 'new_ticket' => 'Nuovo Ticket', - 'new_ticket_by_agent' => 'Nuovo Ticket per Agente', - 'new_message' => 'Nuovo Messaggio', - 'submitter' => 'Inviato da : ', - 'send_receipt_confirmation' => 'Invia ricevuta Conferma', - 'participants' => 'Partecipanti : ', - 'send_new_activity_notice' => 'Invia nuova notifica attività', - 'overlimit_notice' => 'Overlimit Notice', - 'email_attachments_to_the_user' => 'Invia in email allegati ad utente', + 'auto_responce' => 'Auto risponditore', + 'auto_responce-settings' => 'Impostazioni auto risponditore', + 'new_ticket' => 'Nuovo ticket', + 'new_ticket_by_agent' => 'Nuovo ticket per agente', + 'new_message' => 'Nuovo messaggio', + 'submitter' => 'Inviato da: ', + 'send_receipt_confirmation' => 'Invia conferma di ricevuta', + 'participants' => 'Partecipanti: ', + 'send_new_activity_notice' => 'Invia nuova notifica attività', + 'overlimit_notice' => 'Notifica di sorpasso limite', + 'email_attachments_to_the_user' => 'Invia allegati email ad utente', + 'auto_response_updated_successfully' => 'Auto risponditore aggiornato con successo', + 'auto_response_can_not_updated' => 'Impossibile aggiornare auto risponditore', + /* |-------------------------------------- | Alert & Notice Settings Page |-------------------------------------- */ - 'disable' => 'Disabilita', - 'admin_email_2' => 'Email Amministratore', - 'alert_notices' => 'Allerte & Notifiche', - 'new_ticket_alert' => 'Allerta Nuovo Ticket', - 'department_manager' => 'Manager Dipartimento', - 'department_members' => 'Componenti del Dipartimento', - 'organization_account_manager' => 'Account Manager Organizzazione', - 'new_message_alert' => 'Allerta Nuovo Messaggio', - 'last_respondent' => 'Ultimo a Rispondere', - 'assigned_agent_team' => 'Agente / Team Assegnato', - 'new_internal_note_alert' => 'Allerta Nuova Nota Interna', - 'ticket_assignment_alert' => 'Allerta Assegnamento Ticket', - 'team_lead' => 'Leader del Team', - 'team_members' => 'Componenti del Team', - 'ticket_transfer_alert' => 'Allerta Trasferimento Ticket', - 'overdue_ticket_alert' => 'Overdue Ticket Alert ', - 'system_alerts' => 'Allerta di Sistema', - 'system_errors' => 'Errori di Sistema', + 'disable' => 'Disattivo', + 'admin_email_2' => 'Amministratore', + 'alert_notices' => 'Avvisi e notifiche', + 'alert_notices_setitngs' => 'Impostazioni avvisi e notifiche', + 'new_ticket_alert' => 'Avviso nuovo ticket', + 'department_manager' => 'Manager di dipartimento', + 'department_members' => 'Componenti del dipartimento', + 'organization_account_manager' => 'Account Manager dell\'organizzazione', + 'new_message_alert' => 'Avviso nuovo messaggio', + 'last_respondent' => 'Ultimo a rispondere', + 'assigned_agent_team' => 'Agente / Team assegnato', + 'new_internal_note_alert' => 'Avviso nuova nota interna', + 'ticket_assignment_alert' => 'Avviso assegnamento ticket', + 'team_lead' => 'Leader del team', + 'team_members' => 'Componenti del team', + 'ticket_transfer_alert' => 'Avviso trasferimento Ticket', + 'overdue_ticket_alert' => 'Avviso ritardo Ticket ', + 'system_alerts' => 'Avviso di sistema', + 'system_errors' => 'Errori di sistema', 'SQL_errors' => 'Errori SQL', - 'excessive_failed_login_attempts' => 'Tentativi di login falliti eccessivi', - 'system_error_reports' => 'Rapporti di errori Sistema', - 'Send_app_crash_reports_to_help_Ladybird_improve_Faveo' => 'Invia segnalazioni di crash per aiutare Ladybird per migliorare Faveo', + 'excessive_failed_login_attempts' => 'Eccessivi tentativi di login falliti', + 'system_error_reports' => 'Rapporto errori di sistema', + 'Send_app_crash_reports_to_help_Ladybird_improve_Faveo' => 'Invia rapporti di crash per aiutare Ladybird a migliorare Faveo', + 'alert_&_notices_updated_successfully' => 'Alert and notices updated successfully', + 'alert_&_notices_can_not_updated' => 'Alert and notices can not be updated', + + /* + |----------------------------------------------- + | Ratings Settings + |----------------------------------------------- + */ + 'current_ratings' => 'Valutazioni correnti', + 'edit_ratings' => 'Modifica Valutazioni', + + /* + |------------------------------------------------- + |Social login + |-------------------------------------------------- + */ + 'social-login' => 'Accesso con i Social', + /* |------------------------------------------------ - |Language page + | Language page |------------------------------------------------ */ - 'default' => 'default', - 'iso-code' => 'ISO-CODE', + 'default' => 'Default', + 'language-settings' => 'Impostazioni lingua', + 'iso-code' => 'Codice ISO', 'download' => 'Scarica', - 'upload_file' => 'Carica un File', - 'enter_iso-code' => 'Inserisci ISO-CODE', + 'upload_file' => 'Carica un file', + 'enter_iso-code' => 'Inserisci codice ISO', 'eg.' => 'Esempio', - 'for' => 'per', - 'english' => 'English', + 'for' => 'Per', + 'english' => 'Inglese', 'language-name' => 'Nome lingua', 'file' => 'File', - 'read-more' => 'Leggi di più.', - 'enable_lang' => 'Attivalo.', + 'read-more' => 'Continua.', + 'enable_lang' => 'Attiva.', 'add-lang-package' => 'Aggiungi nuovo pacchetto lingua', 'package_exist' => 'Pacchetto già esistente.', - 'iso-code-error' => 'Errore nel codice iso. inserire codice corretto.', - 'zipp-error' => 'Errore nel file zip. Lo zip deve contenere solo file lingua php.', + 'iso-code-error' => 'Errore nel codice iso, inserire codice corretto.', + 'zipp-error' => 'Errore nel file zip, l\'archivio deve contenere solo files php.', 'upload-success' => 'Caricato con successo.', - 'file-error' => 'Errore nel file file non valido.', - 'delete-success' => 'Pacchetto Lingua cancellato con successo.', - 'lang-doesnot-exist' => 'Pacchetto Lingua non esistente.', - 'active-lang-error' => 'Pacchetto Lingua non cancellabile quando attivo.', - 'language-error' => 'Pacchetto Lingua non trovabile nella cartella lingua.', - 'lang-fallback-lang' => 'Cannot delete system\'s defualt fallback language', + 'file-error' => 'Errore nel file, file non valido.', + 'delete-success' => 'Pacchetto lingua cancellato con successo.', + 'lang-doesnot-exist' => 'Pacchetto lingua non esistente.', + 'active-lang-error' => 'Pacchetto lingua non cancellabile se attivo.', + 'language-error' => 'Pacchetto lingua mancante.', + 'lang-fallback-lang' => 'Impossibile cancellare la lingua di ripiego di defualt', + + /* + |-------------------------------------- + | Plugin Settings + |-------------------------------------- + */ + 'add_plugin' => 'Aggiungi plugin', + 'plugins' => 'Plugins', + 'upload' => 'Carica', + 'plugins-list' => 'Lista plugins', + 'plugin-exists' => 'Il plugin esiste già', + 'plugin-installed' => 'Plugin installato correttamente.', + 'plugin-path-missing' => 'Il percorso del plugin non esiste', + 'no-plugin-file' => 'Manca ', + 'plugin-config-missing' => 'Manca file config.php o ServiceProvider.php', + 'plugin-info' => 'Sei uno sviluppatore? Ti incoraggiamo a sviluppare i tuoi plugin ed a condividerli con la comunità.', + 'plugin-info-pro' => ' per acquistare plugin disponibili nella versione Pro.', + 'click-here' => 'Clicca qui', /* |---------------------------------------------------------------------------------------- | Manage Pages [English(en)] @@ -360,53 +523,123 @@ return [ | customize your views to better match your application. | */ - 'manage' => 'gestione', + 'manage' => 'Gestione', /* |-------------------------------------- | Help Topic index Page |-------------------------------------- */ - 'help_topics' => 'Help Topics', - 'topic' => 'Argomento', + 'help_topics' => 'Aree di supporto', + 'topic' => 'Area', 'type' => 'Tipo', 'priority' => 'Priorità', 'last_updated' => 'Ultimo aggiornamento', - 'create_help_topic' => 'Crea Argomento Guida', + 'create_help_topic' => 'Crea area di supporto', 'action' => 'Azione', /* |-------------------------------------- | Help Topic Create Page |-------------------------------------- */ - 'active' => 'Attivo', - 'disabled' => 'Disabilitato', - 'public' => 'Pubblico', - 'private' => 'Privato', - 'parent_topic' => 'Argomento principale', - 'Custom_form' => 'Form Personalizzato', - 'SLA_plan' => 'SLA Plan', - 'auto_assign' => 'Auto assegna', - 'auto_respons' => 'Auto Risposta', - 'ticket_number_format' => 'Formato numero Ticket', - 'system_default' => 'Default di Sistema', - 'custom' => 'Personalizzato', - 'internal_notes' => 'Note Interne', + 'active' => 'Attivo', + 'disabled' => 'Disabilitato', + 'public' => 'Pubblico', + 'private' => 'Privato', + 'parent_topic' => 'Area principale', + 'Custom_form' => 'Modulo personalizzato', + 'SLA_plan' => 'Piano SLA', + 'sla-plans' => 'Piani SLA', + 'auto_assign' => 'Auto assegna', + 'auto_respons' => 'Auto risponditore', + 'ticket_number_format' => 'Formato numero ticket', + 'system_default' => 'Default di sistema', + 'custom' => 'Personalizzato', + 'internal_notes' => 'Note interne', + 'select_a_parent_topic' => 'Seleziona area di supporto', + 'custom_form' => 'Modulo personalizzato', + 'select_a_form' => 'Seleziona un modulo', + 'select_a_department' => 'Seleziona un dipartimento', + 'departments' => 'Dipartimenti', + 'select_a_priority' => 'Seleziona una priorità', + 'priorities' => 'Priorità', + 'select_a_sla_plan' => 'Seleziona un piano SLA', + 'sla_plans' => 'Piani SLA', + 'select_an_agent' => 'Seleziona un agente', + 'helptopic_created_successfully' => 'Area di supporto creata correttamente', + 'helptopic_can_not_create' => 'Impossibile creare l\'area di supporto', + 'helptopic_updated_successfully' => 'Area di supporto aggiornata correttamente', + 'helptopic_can_not_update' => 'Impossibile aggiornare area di supporto', + 'you_cannot_delete_default_department' => 'Non puoi cancellare il dipartimento predefinito', + 'have_been_moved_to_default_help_topic' => 'è stato spostato versa l\'area di supporto predefinita', + 'helptopic_deleted_successfully' => 'Area di supporto cancellata con successo', + 'make-default-helptopic' => 'Rendi l\'area di supporto predefinita', /* |-------------------------------------- | SLA plan Index Page |-------------------------------------- */ - 'sla_plans' => 'SLA Plans', - 'create_SLA' => 'Create a SLA', - 'grace_period' => 'Grace Period', - 'added_date' => 'Data Aggiunta', + 'sla_plans' => 'Piani SLA', + 'create_SLA' => 'Crea SLA', + 'grace_period' => 'Periodo di validità', + 'added_date' => 'Data aggiunta', /* |-------------------------------------- | SLA plan Create Page |-------------------------------------- */ - 'transient' => 'Transient', - 'ticket_overdue_alert' => 'Ticket Overdue Alerts', + 'transient' => 'Transitorio', + 'ticket_overdue_alert' => 'Avvisi ritardo Ticket', + 'sla_plan_created_successfully' => 'Piano SLA creato con successo', + 'sla_plan_can_not_create' => 'Impossibile creare il piano SLA', + 'sla_plan_updated_successfully' => 'Piano SLAaggoprmatp con successo', + 'sla_plan_can_not_update' => 'Impossibile aggiornare il piano SLA', + 'have_been_moved_to_default_sla' => 'è stato spostato verso il piano SLA predefinito', + 'associated_department_have_been_moved_to_default_sla' => 'Il dipartimento associato è stato assegnato il piano SLA predefinito', + 'associated_help_topic_have_been_moved_to_default_sla' => 'All\'area di supporto associata è stato assegnato il piano SLA predefinito', + 'sla_plan_deleted_successfully' => 'Piano SLA cancellato con successo', + 'sla_plan_can_not_delete' => 'Impossibile cancellare il piano SLA', + 'make-default-sla' => 'Rendi il piano SLA predefinito', + /* + |-------------------------------------- + | Work Flow + |-------------------------------------- + */ + 'workflow' => 'Workflow', + 'ticket_workflow' => 'Ticket workflow', + 'create_workflow' => 'Crea workflow', + 'edit_workflow' => 'Modifica workflow', + 'updated' => 'Aggiornato', + 'target' => 'Obbiettivo', + 'target_channel' => 'Canale obbiettivo', + 'execution_order' => 'Ordine di esecuzione', + 'workflow_rules' => 'Regole workflow', + 'workflow_action' => 'Azione workflow', + 'rules' => 'Regole', + 'order' => 'Ordine', + 'condition' => 'Condizione', + 'statement' => 'Istruzione', + 'select_a_channel' => 'Seleziona un canale', + 'body' => 'Corpo', + 'select_one' => 'Seleziona', + 'equal_to' => 'Uguale a', + 'not_equal_to' => 'Non uguale a', + 'contains' => 'Contiene', + 'does_not_contain' => 'Non contiene', + 'starts_with' => 'Comincia con', + 'ends_with' => 'Finisce con', + 'select_an_action' => 'Seleziona un\'azione', + 'reject_ticket' => 'Respingi ticket', + 'set_department' => 'Imposta dipartimento', + 'set_priority' => 'Imposta priorità', + 'set_sla_plan' => 'Imposta piano SLA', + 'assign_team' => 'Assegna team', + 'assign_agent' => 'Assegna agente', + 'set_help_topic' => 'Imposta area di supporto', + 'set_ticket_status' => 'Imposta stato del ticket', + 'workflow_created_successfully' => 'Workflow creato correttamente', + 'workflow_updated_successfully' => 'Workflow aggiornato correttamente', + 'workflow_deleted_successfully' => 'Workflow cancellato correttamente', + /* |-------------------------------------- | Form Create Page @@ -417,27 +650,52 @@ return [ 'label' => 'Etichetta', 'visibility' => 'Visibilità', 'variable' => 'Variabile', - 'create_form' => 'Crea Form', - 'forms' => 'Forms', - 'form_name' => 'Nome del Form', - 'view_this_form' => 'Vedi questo Form', - 'delete_from' => 'Cancella Form', - 'are_you_sure_you_want_to_delete' => 'Sicuro di voler Cancellare', - 'close' => 'Chiudi', + 'create_form' => 'Crea modulo', + 'forms' => 'Moduli', + 'form_name' => 'Nome del modulo', + 'view_this_form' => 'Vedi questo modulo', + 'delete_from' => 'Cancella modulo', + 'are_you_sure_you_want_to_delete' => 'Sicuro di voler cancellare', + 'close' => 'Chiuso', 'instructions' => 'Istruzioni', - 'instructions_on_creating_form' => "Seleziona il tipo di campo che vuoi aggiungere al form sottostante e clicca sul menu a cascata 'Tipo'. Non dimenticare di settare le opzioni del campo se il tipo è selezionato,checkbox radio...Separate ogni opzione con una virgola . Dopo aver finito di creare il form, potete salvare il form cliccando il pulsante Salva Form", - 'form_properties' => 'Proprietà Form', - 'adding_fields' => 'Aggiungendo Campi', - 'click_add_fields_button_to_add_fields' => "Clicca il pulsante 'Aggiungi Campi' per aggiungere campi", - 'add_fields' => 'Aggiungi Campi', - 'save_form' => 'Salva Form', + 'instructions_on_creating_form' => "Seleziona il tipo di campo che vuoi aggiungere al modulo sottostante e clicca sul menu a cascata 'Tipo'. Non dimenticare di settare le opzioni del campo se il tipo è selezionato,checkbox, radio... Separate ogni opzione con una virgola. Dopo aver creato il modulo, potete salvarlo cliccando il pulsante \"Salva modulo\"", + 'form_properties' => 'Proprietà modulo', + 'adding_fields' => 'Aggiungi campi', + 'click_add_fields_button_to_add_fields' => "Clicca il pulsante 'Aggiungi campi' per aggiungere campi", + 'add_fields' => 'Aggiungi campo', + 'save_form' => 'Salva modulo', 'label' => 'Etichetta', 'name' => 'Nome', 'type' => 'Tipo', - 'values(selected_fields)' => 'Valori(Campi Selezionati)', + 'values(selected_fields)' => 'Valori(campi selezionati)', 'required' => 'Richiesto', 'Action' => 'Azione', 'remove' => 'Rimuovi', + 'form_deleted_successfully' => 'Modulo cancellato con successo', + 'successfully_created_form' => 'Modulo creato con successo', + 'please_fill_form_name' => 'Per favore compila il nome del modulo', + 'category_inserted_successfully' => 'Categoria inserta correttamente', + 'category_not_inserted' => 'Categoria non inserta', + 'category_updated_successfully' => 'Categoria aggiornata correttamente', + 'category_not_updated' => 'Categoria non aggiornata', + 'category_deleted_successfully' => 'Categoria cancellata correttamente', + 'category_not_deleted' => 'Categoria non cancellata', + 'article_inserted_successfully' => 'Articolo inserito correttamente', + 'article_not_inserted' => 'Articolo non inserto', + 'article_updated_successfully' => 'Articolo aggiornato correttamente', + 'article_not_updated' => 'Articolo non aggiornato', + 'article_deleted_successfully' => 'Articolo cancellato correttamente', + 'article_not_deleted' => 'Articolo non cancellato', + 'article_can_not_deleted' => 'Impossibile cancellare l\'articolo', + 'page_created_successfully' => 'Pagina creata con successo', + 'your_page_updated_successfully' => 'Pagina aggiornata con successo', + 'page_deleted_successfully' => 'Pagina cancellata con successo', + 'settings_updated_successfully' => 'Impostazioni aggiornate correttamente', + 'settings_can_not_updated' => 'Impossibile aggiornare le impostazioni', + 'can_not_process' => 'Impossibile elaborare', + 'comment_published' => 'Commento pubblicato', + 'comment_deleted' => 'Commento cancellato', + 'publish_time' => 'Data di pubblicazione', /* |---------------------------------------------------------------------------------------- | Theme Pages [English(en)] @@ -459,19 +717,18 @@ return [ 'footer2' => 'Footer2', 'footer3' => 'Footer3', 'footer4' => 'Footer4', - /* + /* |-------------------------------------- | Custom alert box |-------------------------------------- */ - 'ok' => 'Ok', - 'cancel' => 'Cancella', - 'select-ticket' => 'Per favore seleziona tickets.', - 'confirm' => 'Sei sicuro?', - 'delete-tickets' => 'Cancella Tickets', - 'close-tickets' => 'Chiudi Tickets', - 'open-tickets' => 'Apri Tickets', - + 'ok' => 'Ok', + 'cancel' => 'Annulla', + 'select-ticket' => 'Per favore seleziona i ticket', + 'confirm' => 'Sei sicuro?', + 'delete-tickets' => 'Cancella ticket', + 'close-tickets' => 'Chiudi ticket', + 'open-tickets' => 'Apri ticket', /* |---------------------------------------------------------------------------------------- | Staff Pages [English(en)] @@ -482,96 +739,151 @@ return [ | customize your views to better match your application. | */ - 'are_you_sure' => 'Are you sure', - 'staffs' => 'Staffs', - 'name' => 'Nome', - 'user_name' => 'Nome Utente', - 'status' => 'Status', - 'group' => 'Gruppo', - 'department' => 'Dipartimento', - 'created' => 'Creato', - 'lastlogin' => 'Ultimo Login', - 'createagent' => 'Crea Un Agente', - 'delete' => 'Cancella', - 'agents' => 'Agenti', - 'create' => 'Crea', - 'edit' => 'modifica', - 'departments' => 'Dipartimenti', - 'groups' => 'Gruppi', + 'are_you_sure' => 'Sei sicuro', + 'staffs' => 'Organico', + 'name' => 'Nome', + 'user_name' => 'Nome utente', + 'status' => 'Stato', + 'group' => 'Gruppo', + 'department' => 'Dipartimento', + 'created' => 'aperti', + 'lastlogin' => 'Ultimo accesso', + 'createagent' => 'Crea agente', + 'delete' => 'Cancella', + 'agents' => 'Agenti', + 'create' => 'Crea', + 'edit' => 'Modifica', + 'departments' => 'Dipartimenti', + 'groups' => 'Gruppi', + 'select_a_time_zone' => 'Seleziona un fuso orario', + 'time_zones' => 'Fusi orari', /* |-------------------------------------- | Staff Create Page |-------------------------------------- */ - 'create_agent' => 'Crea Agente', - 'first_name' => 'Nome', - 'last_name' => 'Cognome', - 'mobile_number' => 'Numero Mobile', - 'agent_signature' => 'Firma Agente', - 'account_status_setting' => 'Status Account & Settaggi', - 'account_type' => 'Tipo Account', - 'admin' => 'Admin', - 'agent' => 'Agente', - 'account_status' => 'Status Account', - 'locked' => 'Bloccato', - 'assigned_group' => 'Gruppo Assegnato', - 'primary_department' => 'Dipartimento Principale', - 'agent_time_zone' => 'Agent Time Zone', - 'day_light_saving' => 'Day Light Saving', - 'limit_access' => 'Limita Accesso', - 'directory_listing' => 'Directory Listing', - 'vocation_mode' => 'Vocation Mode', - 'assigned_team' => 'Team Assegnato', + 'create_agent' => 'Crea agente', + 'first_name' => 'Nome', + 'last_name' => 'Cognome', + 'mobile_number' => 'Cellulare', + 'agent_signature' => 'Firma agente', + 'account_status_setting' => 'Stato account ed impostazioni', + 'account_type' => 'Tipo account', + 'admin' => 'Amministratore', + 'agent' => 'Agente', + 'account_status' => 'Stato account', + 'locked' => 'Bloccato', + 'assigned_group' => 'Gruppo assegnato', + 'primary_department' => 'Dipartimento principale', + 'agent_time_zone' => 'Fuso orario agente', + 'day_light_saving' => 'Ora legale', + 'limit_access' => 'Limita accesso', + 'directory_listing' => 'Elenco directory', + 'vocation_mode' => 'Vacanza', + 'assigned_team' => 'Team assegnato', + 'agent_send_mail_error_on_agent_creation' => 'Si sono verificati errori nell\'invio della mail all\'agente. Per favore controlla le impostazioni email e riprova', + 'agent_creation_success' => 'Agente creato con successo', + 'failed_to_create_agent' => 'Impossibile creare l\'agente', + 'failed_to_edit_agent' => 'Impossibile modificare l\'agente', + 'agent_updated_sucessfully' => 'Agente aggiornato correttamente', + 'unable_to_update_agent' => 'Impossibile aggiornare l\'agente', + 'agent_deleted_sucessfully' => 'Agente cancellato con successo', + 'this_staff_is_related_to_some_tickets' => 'Questo membro è collegato a qualche ticket', + 'list_of_agents' => 'Lista agenti', + 'create_an_agent' => 'Crea agente', + 'edit_an_agent' => 'Modifica agente', + /* |-------------------------------------- | Department Create Page |-------------------------------------- */ - 'create_department' => 'Crea Dipartimento', + 'create_department' => 'Crea dipartimento', 'manager' => 'Manager', - 'ticket_assignment' => 'Assegnamento Ticket ', - 'restrict_ticket_assignment_to_department_members' => 'Restrict ticket assignment to department members', + 'ticket_assignment' => 'Assegnamento ticket ', + 'restrict_ticket_assignment_to_department_members' => 'Limita assegnamento ticket a membri del dipartimento', 'outgoing_emails' => 'Emails in uscita', - 'outgoing_email' => 'Email in uscita', - 'template_set' => 'Template Set', - 'auto_responding_settings' => 'Settaggi Auto-Risposta', + 'outgoing_email' => 'Email da usare', + 'template_set' => 'Set modelli', + 'auto_responding_settings' => 'Impostazioni auto-risposta', 'disable_for_this_department' => 'Disattiva per questo dipartimento', - 'auto_response_email' => 'Email Auto-Risposta', - 'recipient' => 'Recipient', - 'group_access' => 'Accesso Gruppo', - 'department_signature' => 'Firma Dipartimento', + 'auto_response_email' => 'Email auto-risposta', + 'recipient' => 'Destinatario', + 'group_access' => 'Accesso gruppo', + 'department_signature' => 'Firma dipartimento', + 'list_of_departments' => 'Lista dipartimenti', + 'create_a_department' => 'Crea dipartimento', + 'outgoing_email_settings' => 'Impostazioni email in uscita', + 'edit_department' => 'Modifica dipartimento', + 'select_a_sla' => 'Seleziona piano SLA', + 'select_a_manager' => 'Seleziona un manager', + 'department_created_sucessfully' => 'Dipartimento creato con successo', + 'failed_to_create_department' => 'Impossibile creare il dipartimento', + 'department_updated_sucessfully' => 'Dipartimento aggiornato correttamente', + 'department_not_updated' => 'Dipartimento non aggiornato', + 'you_cannot_delete_default_department' => 'Non puoi cancellare il dipartimento predefinito', + 'have_been_moved_to_default_department' => 'è stato assegnato al dipartimento predefinito', + 'the_associated_helptopic_has_been_deactivated' => 'L\'area di supporto associata è stata disattivata', + 'department_deleted_sucessfully' => 'Dipartimento cancellato con successo', + 'department_can_not_delete' => 'Impossibile cancellare dipartimento', + 'select_a_department' => 'Seleziona un dipartimento', + 'make-default-department' => 'Rendi il dipartimento predefinito', /* |-------------------------------------- | Team Create Page |-------------------------------------- */ - 'create_team' => 'Crea Team', - 'team_lead' => 'Team Lead', - 'assignment_alert' => 'Allerta Assegnamento', - 'disable_for_this_team' => 'Disattiva per questo team', - 'teams' => 'Teams', + 'create_team' => 'Crea team', + 'team_lead' => 'Team leader', + 'assignment_alert' => 'Avviso assegnamento', + 'disable_for_this_team' => 'Disattiva per questo team', + 'teams' => 'Teams', + 'list_of_teams' => 'Lista teams', + 'create_a_team' => 'Crea team', + 'edit_a_team' => 'Modifica team', + 'teams_created_successfully' => 'Team creato con successo', + 'teams_can_not_create' => 'Impossibile creare il team', + 'teams_updated_successfully' => 'Team aggiornato con successo', + 'teams_can_not_update' => 'Impossibile aggiornare il team', + 'teams_deleted_successfully' => 'Team cancell con successo', + 'teams_can_not_delete' => 'Impossibile cancellare il teams', + 'select_a_team' => 'Seleziona un team', + 'select_a_team_lead' => 'Seleziona un team leader', + 'members' => 'Membri', /* |-------------------------------------- | Group Create Page |-------------------------------------- */ - 'create_group' => 'Crea Gruppo', - 'goups' => 'Gruppi', - 'can_create_ticket' => 'Può creare ticket', - 'can_edit_ticket' => 'Può editare ticket', - 'can_post_ticket' => 'Può postare Ticket', - 'can_close_ticket' => 'Può chiudere un ticket ', - 'can_assign_ticket' => 'Può assegnare ticket', - 'can_transfer_ticket' => 'Può trasferire ticket', - 'can_delete_ticket' => 'Può cancellare ticket', - 'can_ban_emails' => 'Può bannare le email', - 'can_manage_premade' => 'Può Manage premade', - 'can_manage_FAQ' => 'Può gestire le FAQ', - 'can_view_agent_stats' => 'Può visualizzare le stats per agente', - 'department_access' => 'Accesso Dipartimenti ', - 'admin_notes' => 'Note Admin', - 'group_members' => 'Componenti del Gruppo', - 'group_name' => 'Nome Gruppo', + 'create_group' => 'Crea gruppo', + 'goups' => 'Gruppi', + 'can_create_ticket' => 'Può creare ticket', + 'can_edit_ticket' => 'Può editare ticket', + 'can_post_ticket' => 'Può postare Ticket', + 'can_close_ticket' => 'Può chiudere un ticket ', + 'can_assign_ticket' => 'Può assegnare ticket', + 'can_transfer_ticket' => 'Può trasferire ticket', + 'can_delete_ticket' => 'Può cancellare ticket', + 'can_ban_emails' => 'Può bannare le email', + 'can_manage_premade' => 'Può gestire premade', + 'can_manage_FAQ' => 'Può gestire le FAQ', + 'can_view_agent_stats' => 'Può visualizzare le statistiche per agente', + 'department_access' => 'Accesso dipartimenti ', + 'admin_notes' => 'Note amministratore', + 'group_members' => 'Componenti del gruppo', + 'group_name' => 'Nome gruppo', + 'select_a_group' => 'Seleziona un gruppo', + 'create_a_group' => 'Crea gruppo', + 'edit_a_group' => 'Modificagruppo', + 'group_created_successfully' => 'Gruppo creato correttamente', + 'group_can_not_create' => 'Impossibile creare il gruppo', + 'group_updated_successfully' => 'Gruppo aggiornato con successo', + 'group_can_not_update' => 'Impossibile aggiornare il gruppo', + 'there_are_agents_assigned_to_this_group_please_unassign_them_from_this_group_to_delete' => 'Esistono agenti assegnati a questo gruppo, rimuovili per poterlo cancellare', + 'group_cannot_delete' => 'Impossibile cancellare il gruppo', + 'group_deleted_successfully' => 'Gruppo cancellato correttamente', + 'group_cannot_delete' => 'Impossibile cancellare il gruppo', + 'failed_to_load_the_page' => 'Impossibile caricare la pagina', /* |-------------------------------------- | SMTP Page @@ -581,7 +893,7 @@ return [ 'smtp' => 'SMTP', 'host' => 'Host', 'port' => 'Porta', - 'encryption' => 'Criptazione', + 'encryption' => 'Cifratura', /* |---------------------------------------------------------------------------------------- | Agent Panel [English(en)] @@ -592,180 +904,256 @@ return [ | customize your views to better match your application. | */ - 'agent_panel' => 'Pannello Agente', - 'profile' => 'Profilo', - 'change_password' => 'Cambia Password', - 'sign_out' => 'Esci', - 'Tickets' => 'TICKETS', - 'inbox' => 'Inbox', - 'my_tickets' => 'Miei Tickets', - 'unassigned' => 'Non Assegnati', - 'trash' => 'Cestino', - 'Updates' => 'AGGIORNAMENTI', - 'no_new_updates' => 'Nessun nuovo aggiornamento', - 'check_for_updates' => 'Controlla aggiornamenti', - 'open' => 'Apri', - 'inprogress' => 'In elaborazione', - 'closed' => 'chiuso', - 'Departments' => 'DIPARTIMENTI', - 'tools' => 'Strumenti', - 'canned' => 'Canned', - 'knowledge_base' => 'Knowledge Base', - 'loading' => 'Caricando', - 'ratings' => 'Ratings', - 'please_rate' => 'Per favore rate:', - 'ticket_ratings' => 'TICKET RATING', + 'agent_panel' => 'Pannello agente', + 'profile' => 'Profilo', + 'change_password' => 'Cambia password', + 'sign_out' => 'Esci', + 'Tickets' => 'TICKET', + 'ticket-details' => 'Ticket details', + 'inbox' => 'Inbox', + 'my_tickets' => 'Miei ticket', + 'unassigned' => 'Non assegnati', + 'trash' => 'Cestino', + 'Updates' => 'AGGIORNAMENTI', + 'no_new_updates' => 'Nessun nuovo aggiornamento', + 'check_for_updates' => 'Controlla aggiornamenti', + 'update-version' => 'Versione aggiornamento', + 'open' => 'Apri', + 'inprogress' => 'In corso', + 'inprogress_tickets' => 'Ticket in corso', + 'closed' => 'Chiuso', + 'Departments' => 'DIPARTIMENTI', + 'tools' => 'Strumenti', + 'canned' => 'Predefinita', + 'knowledge_base' => 'Knowledge Base', + 'kb-settings' => 'Impostazioni Knowledge base', + 'loading' => 'Caricamento', + 'ratings' => 'Valutazioni', + 'please_rate' => 'Valuta:', + 'ticket_ratings' => 'VALUTAZIONE TICKET', + /* + |----------------------------------------------- + | Ticket + |----------------------------------------------- + */ + 'ticket_created_successfully' => 'Il ticket è stato creato correttamente', + 'failed_to_create_a_new_ticket' => 'Impossibile creare il nuovo ticket', + 'your_ticket_have_been_closed' => 'Il ticket è stato chiuso', + 'your_ticket_have_been_resolved' => 'Il ticket è stato risolto', + 'your_ticket_have_been_opened' => 'Il ticket è stato aperto', + 'your_ticket_have_been_moved_to_trash' => 'Il ticket è stato spostato nel cestino', + 'this_email_have_been_banned' => 'Questa mail è stata bannata', + 'ticket_updated_successfully' => 'Ticket aggiornato correttamente', + 'you_have_successfully_replied_to_your_ticket' => 'Hai risposto al tuo ticket con successo', + 'for_some_reason_your_message_was_not_posted_please_try_again_later' => 'Per qualche ragione il tuo messaggio non è stato pubblicato, per favore prova più tardi', + 'for_some_reason_your_reply_was_not_posted_please_try_again_later' => 'Per qualche ragione la tua risposta non è stata pubblicata, per favore prova più tardi', + 'you_have_unassigned_your_ticket' => 'Hai rimosso l\'assegnazione al tuo ticket', + 'for_some_reason_your_request_failed' => 'Per qualche ragione la tua richiesta è fallita', + 'trash-delete-ticket' => 'Cancella i ticket in modo permanente', + 'trash-delete-title-msg' => 'Clicca qui per cancellare permanentemente i ticket.', + 'moved_to_trash' => 'Ticket selezionati spostati nel cestino.', + 'tickets_have_been_closed' => 'I ticket selezionati sono stati chiusi.', + 'tickets_have_been_opened' => 'I ticket selezionati sono stati aperti.', + 'unable_to_fetch_emails' => 'Impossible caricale le emails', + 'reply_content_is_a_required_field' => 'Il contenuto della risposta è un campo richiesto', + 'internal_content_is_a_required_field' => 'Il contenuto interno è un campo richiesto', + /* |----------------------------------------------- | Profile |----------------------------------------------- */ - 'user_information' => 'informazioni utente', - 'time_zone' => 'Time-zone', - 'phone_number' => 'Numero di Telefono', - 'contact_information' => 'infomazioni Contatto', + 'view-profile' => 'Visualizza profilo', + 'edit-profile' => 'Modifica profilo', + 'user_information' => 'Informazioni utente', + 'time_zone' => 'Fuso orario', + 'phone_number' => 'Numero di telefono', + 'contact_information' => 'Infomazioni di contatto', + 'Profile-Updated-sucessfully' => 'Profilo aggiornato correttamente.', + 'User-profile-Updated-Successfully' => 'Profilo utente aggiornato correttamente.', + 'User-Created-Successfully' => 'Utente creato correttamente.', /* |----------------------------------------------- | Dashboard |----------------------------------------------- */ - 'dashboard' => 'Cruscotto', - 'line_chart' => 'Tabella lineare', - 'statistics' => 'Statistiche', - 'opened' => 'Aperto', - 'resolved' => 'Risolto', - 'closed' => 'Chiuso', - 'deleted' => 'Cancellato', + 'dashboard' => 'Cruscotto', + 'line_chart' => 'Grafico lineare', + 'statistics' => 'Statistiche', + 'opened' => 'Aperti', + 'resolved' => 'Risolto', + 'closed' => 'Chiusi', + 'deleted' => 'Cancellato', + 'start_date' => 'Data inizio', + 'end_date' => 'Data fine', + 'filter' => 'Filtra', + 'report' => 'Resoconto', + 'Legend' => 'LEGENDA', + 'total' => 'Totale', + 'dashboard_reports' => 'Cruscotto', /* |------------------------------------------------ |User Page |------------------------------------------------ */ - 'user_directory' => 'User Directory', - 'ban' => 'Banna', - 'user' => 'Utente', - 'users' => 'Utenti', - 'create_user' => 'Crea Utente', - 'full_name' => 'Nome Completo', - 'mobile' => 'Mobile', - 'last_login' => 'Ultimo Login', - 'user_profile' => 'Profilo Utente', - 'assign' => 'Assegna', - 'open_tickets' => 'Tickets', - 'closed_tickets' => 'Ticket Chiusi', - 'deleted_tickets' => 'Cancella Tickets', + 'user_credentials' => 'Credenziali utente', + 'user_directory' => 'Lista utenti', + 'ban' => 'Ban', + 'user' => 'Utente', + 'users' => 'Utenti', + 'create_user' => 'Crea utente', + 'edit_user' => 'Modifica utente', + 'full_name' => 'Nome completo', + 'mobile' => 'Cellulare', + 'last_login' => 'Ultimo accesso', + 'user_profile' => 'Profilo utente', + 'assign' => 'Assegna', + 'open_tickets' => 'Ticket aperti', + 'closed_tickets' => 'Ticket chiusi', + 'deleted_tickets' => 'Ticket cancellati', + 'user_created_successfully' => 'Utente creato correttamente', + 'user_updated_successfully' => 'Utente aggiornato correttamente', + 'profile_updated_sucessfully' => 'Profilo aggiornato correttamente', + 'password_updated_sucessfully' => 'Password aggiornata con successo', + 'password_was_not_updated_incorrect_old_password' => 'Password non aggiornata. Vecchia password errata', + 'the_user_has_been_removed_from_this_organization' => 'L\'utente è stato rimosso da questa organizzazione', + 'user_report' => 'Resoconto utente', + 'send_password_via_email' => 'Invia password per email', + 'user_send_mail_error_on_user_creation' => 'E\' avvenuto un errore durante l\'invio della mail all\'utente. Per favore controlla le impostazioni email e riprova', + 'country_code' => 'Codice paese', /* |------------------------------------------------ |Organization Page |------------------------------------------------ */ - 'organizations' => 'Organizzazioni', - 'organization' => 'Organizzazione', - 'create_organization' => 'Crea Organizzazione', - 'account_manager' => 'Account Manager', - 'update' => 'Aggiorna', - 'please_select_an_organization' => 'Per favore seleziona una Organizzazione', - 'please_select_an_user' => 'Per favore seleziona un utente', - 'organization_profile' => 'Profilo Organizzazione', - 'organization-s_head' => "Organization's Head", - 'select_department_manager' => 'Seleziona Managere Dipartimento', - 'users_of' => 'Utenti di', + 'organizations' => 'Organizzazioni', + 'organization' => 'Organizzazione', + 'organization_list' => 'Lista organizzazioni', + 'view_organization_profile' => 'Visualizza profilo organizzazione', + 'create_organization' => 'Crea organizzazione', + 'account_manager' => 'Account manager', + 'update' => 'Aggiorna', + 'please_select_an_organization' => 'Per favore seleziona un\'organizzazione', + 'please_select_an_user' => 'Per favore seleziona un utente', + 'organization_profile' => 'Profilo organizzazione', + 'organization-s_head' => "Capo dell'organizzazione", + 'select_department_manager' => 'Seleziona manager del dipartimento', + 'select_organization_manager' => 'Seleziona un manager dell\'organizzazione', + 'users_of' => 'Utenti di', + 'organization_created_successfully' => 'Organizzazione creata con successo', + 'organization_can_not_create' => 'Impossibile creare l\'organizzazione', + 'organization_updated_successfully' => 'Organizzazione aggiornata correttamente', + 'organization_can_not_update' => 'Impossibile aggiornare l\'organizzazione', + 'organization_deleted_successfully' => 'Organizzazione cancellata con successo', + 'report_of' => 'Resoconto di', + 'ticket_of' => 'Ticket di', /* |---------------------------------------------- | Ticket page |---------------------------------------------- */ - 'subject' => 'Soggetto', - 'ticket_id' => 'Ticket ID', - 'priority' => 'Priorità', - 'from' => 'Da', - 'last_replier' => 'Ultimo a Rispondere', - 'assigned_to' => 'Assegnato A', - 'last_activity' => 'Ultima Attività', - 'answered' => 'Risposto', - 'assigned' => 'Assegnato', - 'create_ticket' => 'Crea Ticket', - 'tickets' => 'Tickets', - 'open' => 'Apri', - 'Ticket_Information' => 'INFORMAZIONE TICKET', - 'Ticket_Id' => 'ID TICKET', - 'User' => 'UTENTE', - 'Unassigned' => 'NON ASSEGNATO', - 'generate_pdf' => 'Genera PDF', - 'change_status' => 'Cambia Status', - 'more' => 'Più', - 'delete_ticket' => 'Cancella Ticket', - 'emergency' => 'Emergenza', - 'high' => 'Alta', - 'medium' => 'Media', - 'low' => 'Bassa', - 'sla_plan' => 'SLA Plan', - 'created_date' => 'Data Creata', - 'due_date' => 'Data di Scadenza', - 'last_response' => 'Ultima Risposta', - 'source' => 'Sorgente', - 'last_message' => 'Ultimo Messaggio', - 'reply' => 'Risposta', - 'response' => 'Resposta', - 'reply_content' => 'Contenuto Riposta', - 'attachment' => 'Allegato', - 'internal_note' => 'Nota Interna', - 'this_ticket_is_under_banned_user' => 'Questo ticket è di un utente bannato', - 'ticket_source' => 'Sorgente Ticket', - 'are_you_sure_to_ban' => 'Sicuro di voler bannare', - 'whome_do_you_want_to_assign_ticket' => 'A chi vuoi assegnare il ticket', - 'are_you_sure_you_want_to_surrender_this_ticket' => 'Are you sure you want to surrender this Ticket', - 'add_collaborator' => 'Aggiungi Collaboratore', - 'search_existing_users' => 'Cerca utenti esistenti', - 'add_new_user' => 'Aggiungi nuovo Utente', - 'search_existing_users_or_add_new_users' => 'Cerca utenti esistenti o aggiungi nuovi utenti', - 'search_by_email' => 'Cerca per Email', - 'list_of_collaborators_of_this_ticket' => 'Lista dei Collaboratori di questo Ticket', - 'submit' => 'Invia', - 'max' => 'Max', - 'add_cc' => 'Aggiungi CC', - 'recepients' => 'Riceventi', - 'select_a_canned_response' => 'Seleziona una Canned Response', - 'assign_to' => 'Assegna A', - 'detail' => 'Dettaglio', - 'user_details' => 'Dettagli Utente', - 'ticket_option' => 'Opzioni Ticket', - 'ticket_detail' => 'Dettagli Ticket', - 'Assigned_To' => 'ASSEGNATO A', - 'locked-ticket' => 'Allerta! Questo ticket è etato bloccato da un altro utente ed è al momento in risposta.', - 'access-ticket' => 'Allerta! Questo ticket è etato bloccato da te per ', - 'minutes' => ' minuti', - 'in_minutes' => 'In minuti', - 'add_another_owner' => 'Aggiungi un altro possessore', - 'user-not-found' => 'Utente non trovato.Prova ancora o aggiungi un nuovo utente.', - 'change-success' => 'Successo! Il possessore di questo ticket è stato cambiato.', - 'user-exists' => 'Utente già esistente. Prova a cercare questo stesso utente.', - 'valid-email' => 'Inserisci un indirizzo email valido.', - 'search_user' => 'Cerca utente', - 'merge-ticket' => 'Unisci ticket', - 'title' => 'Titolo', - 'merge' => 'Unisci', - 'select_tickets' => 'Seleziona ticket da unire', - 'select-pparent-ticket' => 'Seleziona un ticket padre', - 'merge-reason' => 'Motivazione unione', - 'get_merge_message' => 'Questo ticket è stato unito con il ticket', - 'ticket_merged' => ' è stato unito con il ticket.', - 'no-tickets-to-merge' => 'Non ci sono altri ticket di prorietà del possessore di questo ticket.', - 'merge-error' => 'Richiesta non processabile riprova in seguito.', - 'merge-success' => 'Tickets uniti con successo.', - 'merge-error2' => 'Per favore selzeziona un ticket da unire.', - 'select-tickets-to merge' => 'seleziona due o più ticket da unire', - 'different-users' => 'Tickte da utenti diversi', + 'subject' => 'Oggetto', + 'ticket_id' => 'Ticket ID', + 'priority' => 'Priorità', + 'from' => 'Da', + 'last_replier' => 'Ultimo a rispondere', + 'assigned_to' => 'Assegnato a', + 'last_activity' => 'Ultima attività', + 'answered' => 'Risposti', + 'assigned' => 'Assegnati', + 'create_ticket' => 'Crea Ticket', + 'tickets' => 'Ticket', + 'open' => 'Aperti', + 'Ticket_Information' => 'INFORMAZIONE TICKET', + 'Ticket_Id' => 'ID TICKET', + 'User' => 'UTENTE', + 'Unassigned' => 'NON ASSEGNATO', + 'unassigned-tickets' => 'Ticket non assegnati', + 'generate_pdf' => 'Genera PDF', + 'change_status' => 'Cambia stato', + 'more' => 'Ancora', + 'delete_ticket' => 'Cancella ticket', + 'emergency' => 'Emergenza', + 'high' => 'Alta', + 'medium' => 'Media', + 'low' => 'Bassa', + 'sla_plan' => 'Piano SLA', + 'created_date' => 'Data creazione', + 'due_date' => 'Data di scadenza', + 'last_response' => 'Ultima risposta', + 'source' => 'Sorgente', + 'last_message' => 'Ultimo messaggio', + 'reply' => 'Risposta', + 'response' => 'Risposta', + 'reply_content' => 'Contenuto riposta', + 'attachment' => 'Allegato', + 'internal_note' => 'Nota interna', + 'this_ticket_is_under_banned_user' => 'Questo ticket è di un utente bannato', + 'ticket_source' => 'Sorgente ticket', + 'are_you_sure_to_ban' => 'Sicuro di voler bannare', + 'whome_do_you_want_to_assign_ticket' => 'A chi vuoi assegnare il ticket', + 'are_you_sure_you_want_to_surrender_this_ticket' => 'Sei sicuro di voler abbandonare questo ticket', + 'add_collaborator' => 'Aggiungi collaboratore', + 'search_existing_users' => 'Cerca utenti esistenti', + 'add_new_user' => 'Aggiungi nuovo utente', + 'search_existing_users_or_add_new_users' => 'Cerca utenti esistenti o aggiungi nuovi utenti', + 'search_by_email' => 'Cerca per email', + 'list_of_collaborators_of_this_ticket' => 'Lista dei collaboratori di questo Ticket', + 'submit' => 'Invia', + 'max' => 'Max', + 'add_cc' => 'Aggiungi CC', + 'recepients' => 'Destinatari', + 'select_a_canned_response' => 'Seleziona una risposta preimpostata', + 'assign_to' => 'Assegna a', + 'detail' => 'Dettaglio', + 'user_details' => 'Dettagli utente', + 'ticket_option' => 'Opzioni ticket', + 'ticket_detail' => 'Dettagli ticket', + 'Assigned_To' => 'ASSEGNATO A', + 'locked-ticket' => 'Attenzione! Questo ticket è etato bloccato da un altro utente ed è al momento in risposta.', + 'minutes-ago' => 'minuti fa', + 'access-ticket' => 'Attenzione! Questo ticket è etato bloccato da te per ', + 'minutes' => 'Minuti', + 'in_minutes' => 'In minuti', + 'add_another_owner' => 'Aggiungi un altro possessore', + 'user-not-found' => 'Utente non trovato, prova ancora o aggiungi un nuovo utente.', + 'change-success' => 'Successo! Il possessore di questo ticket è stato cambiato.', + 'user-exists' => 'Utente già esistente, prova a cercare questo stesso utente.', + 'valid-email' => 'Inserisci un indirizzo email valido.', + 'search_user' => 'Cerca utente', + 'merge-ticket' => 'Unisci ticket', + 'title' => 'Titolo', + 'merge' => 'Unisci', + 'select_tickets' => 'Seleziona ticket da unire', + 'select-pparent-ticket' => 'Seleziona un ticket padre', + 'merge-reason' => 'Motivazione unione', + 'no-reason' => 'Non è stata fornita alcuna ragione.', + 'get_merge_message' => 'Questo ticket è stato unito con il ticket', + 'ticket_merged' => ' è stato unito con il ticket.', + 'no-tickets-to-merge' => 'Non ci sono altri ticket di prorietà del possessore di questo ticket.', + 'merge-error' => 'Richiesta non processabile riprova in seguito.', + 'merge-success' => 'Ticket uniti con successo.', + 'merge-error2' => 'Per favore selzeziona un ticket da unire.', + 'select-tickets-to merge' => 'Seleziona due o più ticket da unire', + 'different-users' => 'Ticket da utenti diversi', + 'clean-up' => 'Cancella definitivamente', + 'hard-delete-success-message' => 'I ticket sono stati cancellati permanentemente.', + 'overdue' => 'In ritardo', + 'overdue-tickets' => 'Ticket in ritardo', + 'change_owner_for_ticket' => 'Cambia proprietario del ticket', /* |------------------------------------------------ |Tools Page |------------------------------------------------ */ - 'canned_response' => 'Canned Response', - 'create_canned_response' => 'Create Canned Response', - 'surrender' => 'Surrender', - 'view' => 'Vista', + 'canned_response' => 'Risposta predefinita', + 'create_canned_response' => 'Crea risposta predefinita', + 'surrender' => 'Abbandona', + 'added_successfully' => 'Aggiunto correttamente', + 'updated_successfully' => 'Aggiornato correttamente', + 'user_deleted_successfully' => 'Utente cancellato con successo', + 'view' => 'Visualizza', /* |----------------------------------------------- | Main text @@ -779,23 +1167,109 @@ return [ |Guest-User Page |------------------------------------------------ */ - 'issue_summary' => 'Sommario Problema', - 'issue_details' => 'Dettagli Problema', - 'contact_informations' => 'Informazioni contatto', - 'contact_details' => 'Dettagli Contatto', - 'role' => 'Ruolo', - 'ext' => 'EXT', - 'profile_pic' => 'Foto Profilo', - 'agent_sign' => 'Firma Agente', - 'inactive' => 'Inattivo', - 'male' => 'Uomo', - 'female' => 'Donna', - 'old_password' => 'Vecchia Password', - 'new_password' => 'Nuova Password', - 'confirm_password' => 'Conferma Password', - 'gender' => 'Genere', - 'ticket_number' => 'Numero di Ticket', - 'content' => 'Contenuto', + 'issue_summary' => 'Sommario problema', + 'contact' => 'Contatto', + 'issue_details' => 'Dettagli problema', + 'contact_informations' => 'Informazioni contatto', + 'contact_details' => 'Dettagli contatto', + 'role' => 'Ruolo', + 'ext' => 'EXT', + 'profile_pic' => 'Foto profilo', + 'agent_sign' => 'Firma agente', + 'inactive' => 'Inattivo', + 'male' => 'Uomo', + 'female' => 'Donna', + 'old_password' => 'Vecchia password', + 'new_password' => 'Nuova password', + 'confirm_password' => 'Conferma password', + 'gender' => 'Sesso', + 'ticket_number' => 'Numero ticket', + 'content' => 'Contenuto', + 'edit_template' => 'Modifica modello', + 'edit_status' => 'Modifica stato', + 'create_status' => 'Crea stato', + 'edit_details' => 'Modifica dettagli', + 'edit_templates' => 'Modifica modelli', + 'activate_this_set' => 'Attiva questo set', + 'show' => 'Mostra', + 'no_notification_available' => 'Nessuna notifica disponibile', + + //auto-close workflow + 'close-msg1' => 'Numero di giorni dopo i quali i ticket verranno chiusi automaticamente.', + 'no_of_days' => 'Numero di giorni', + 'close-msg2' => 'Abilita auto chiusura workflow?', + 'enable_workflow' => 'Abilita workflow', + 'send_email_to_user' => 'Invia email all\'utente', + 'close-msg3' => 'Seleziona stato da assegnare alla chiusura del ticket.', + 'close-msg4' => 'Inviare email di auto chiusura del ticket all\'utente?', + 'edit_status' => 'Modifica stato', + 'list_of_status' => 'Lista degli stati', + 'status_settings' => 'Impostazioni stati', + 'icon_class' => 'Icona', + 'close_ticket_workflow' => 'Chiudi workflow ticket', + 'ratings_settings' => 'Impostazioni valutazioni', + 'notification' => 'Notifica', + 'status_has_been_updated_successfully' => 'Stato aggiornato correttamente', + 'status_has_been_created_successfully' => 'Stato creato correttamente', + 'status_has_been_deleted' => 'Status cancellato', + 'you_cannot_delete_this_status' => 'Non puoi cancellare questo stato', + 'you_have_deleted_all_the_read_notifications' => 'Hai cancellato tutte le notifiche lette', + 'you_have_deleted_all_the_notification_records_since' => 'Hai cancellato tutti i record di notifica dal ', + 'ratings_updated_successfully' => 'Valutazione aggiornate correttamente', + 'ratings_can_not_be_created' => 'Impossibile creare la valutazione', + 'successfully_created_this_rating' => 'Valutazione creata con successo', + 'rating_deleted_successfully' => 'Valutazione cancellata correttamente', + //status msg + + 'status_msg1' => 'Se scegli SI verrà inviata una mail di notifica all\'utente.', + 'notify_user' => 'Notificare l\'utente su questo stato?', + 'deleted_status' => 'Questo è lo stato di un ticket cancellato?', + 'resolved_status' => 'Questo è lo stato di un ticket risolto?', + 'status_msg3' => 'Se scegli SI lo stato del ticket verrà impostato su risolto.', + 'status_msg2' => 'Se scegli SI lo stato del ticket verrà impostato su cancellato.', + 'rating-msg2' => 'Seleziona un dipartimento per restringere la valutazione dei ticket o chat a questa appartenenza. Se non selezioni alcuna voce la valutazione apparirà su tutti i dipartimenti.', + 'rating-msg3' => 'Se scegli SI l\'utente potrà modificare la valutazione.', + 'rating_restrict' => 'Restringi valutazione ad un dipartimento', + 'rating_change' => 'Consenti agli utenti di cambiare la valutazione?', + 'security_msg1' => 'Messaggio da mostrare quando un utente è stato bloccato.', + 'security_msg2' => 'Numero massimo di login errati che un utente può effettuare prima che venga bloccato fuori dal sistema. Imposta 0 per registrare i login errati senza bloccare l\'utente.', + 'security_msg3' => 'Numero di minuti per i quali l\'utente verrà bannato dal sistema dopo aver raggiunto il limite di login errati.', + 'max_attempt' => 'Numero tentativi di login per utente/host', + 'rating-msg1' => 'Valutazione massima che può essere fornita. Per esempio, se selezionato 5, il minimo possibile sarà 1 ed il massimo 5.', + 'enter_no_of_days' => 'Inserisci il numero di giorno', + 'template-types' => 'Tipi di modelli', + 'close-workflow' => 'Chiusura workflow ticket', + 'template' => 'Modello', + 'rating_label' => 'Etichetta valutazione', + 'display_order' => 'Ordinamento', + 'rating_scale' => 'Scala di valutazione', + 'rating_area' => 'Area di valutazione', + 'modify' => 'Modifica', + 'rating_name' => 'Nome valutazione', + 'add_user_to_this_organization' => 'Aggiungi utente a questa organizzazione', + 'Tickets_of' => 'Ticket di', + 'security' => 'Sicurezza', + 'security_settings' => 'Impostazioni di sicurezza', + 'lockouts' => 'Tentativi', + 'security_settings_saved_successfully' => 'Impostazioni di sicurezza salvate correttamente', + 'manage_status' => 'Gestisci stato', + 'notifications' => 'Notifiche', + 'auto_close_workflow' => 'Auto chiusura workflow', + 'close_ticket_workflow_settings' => 'Impostazioni chiusura workflow ticket', + 'successfully_saved_your_settings' => 'Impostazioni salvate correttamente', + + /* + |------------------------------------------------ + | Notification Settings Pages + |------------------------------------------------ + */ + 'notification_settings' => 'Impostazioni notifiche', + 'delete_noti' => 'Cancellare tutte le notifiche lette?', + 'noti_msg1' => 'Numero giorni di notifiche da cancellare', + 'noti_msg2' => 'Puoi inserire il numero di giorni di log del database da eliminare e la cronologia delle notifiche verrà eliminata dal giorno specificato.', + 'del_all_read' => 'Cancella', + 'You_have_deleted_all_the_read_notifications' => 'Hai cancellato tutte le notifiche lette', + 'view_all_notifications' => 'Visualizza tutte le notifiche', /* |------------------------------------------------ | Error Pages @@ -804,58 +1278,61 @@ return [ 'not_found' => 'Non trovato', 'oops_page_not_found' => 'Oops! Pagina non trovata', 'we_could_not_find_the_page_you_were_looking_for' => 'Impossibile trovare la pagina che stavi cercando', - 'internal_server_error' => 'Errore server interno', + 'internal_server_error' => 'Errore interno del server', 'be_right_back' => 'Torna indietro', 'sorry' => 'Spiacente', 'we_are_working_on_it' => 'Ci stiamo lavorando', 'category' => 'Categoria', - 'addcategory' => 'Aggiungi Categoria', - 'allcategory' => 'Tutte le Categorie', + 'addcategory' => 'Aggiungi categoria', + 'allcategory' => 'Tutte le categorie', 'article' => 'Articolo', 'articles' => 'Articoli', - 'addarticle' => 'Aggiungi Articolo', - 'allarticle' => 'Tutti gli Articoli', + 'addarticle' => 'Aggiungi articolo', + 'allarticle' => 'Tutti gli articoli', 'pages' => 'Pagine', - 'addpages' => 'Aggiungi Pagine', + 'addpages' => 'Aggiungi pagine', 'allpages' => 'Tutte le pagine', 'widgets' => 'Widgets', + 'widget-settings' => 'Impostazioni widget', 'footer1' => 'Footer 1', 'footer2' => 'Footer 2', 'footer3' => 'Footer 3', 'footer4' => 'Footer 4', - 'sidewidget1' => 'Side Widget 1', - 'sidewidget2' => 'Side Widget 2', + 'sidewidget1' => 'Widget laterale 1', + 'sidewidget2' => 'Widget laterale 2', 'comments' => 'Commenti', - 'settings' => 'Settaggi', - 'parent' => 'Padre', + 'comments-list' => 'Lista commenti', + 'settings' => 'Impostazioni', + 'parent' => 'Parente', 'description' => 'Descrizione', - 'enter_the_description' => 'Inserisci la Descrizione', + 'enter_the_description' => 'Inserisci la descrizione', 'publish' => 'Pubblica', + 'publish_immediately' => 'Pubblica immediatamente', 'published' => 'Pubblicato', 'draft' => 'Bozza', - 'create_a_category' => 'Crea una Categoria', + 'create_a_category' => 'Crea una categoria', 'add' => 'Aggiungi', 'social' => 'Social', + 'social-widget-settings' => 'Impostazioni widget sociali', 'comment' => 'Commento', - 'not_published' => 'Non Pubblicato', - 'numberofelementstodisplay' => 'numero elementi da visualizzare', + 'not_published' => 'Non pubblicato', + 'numberofelementstodisplay' => 'Numero elementi da visualizzare', //====================================== 'language' => 'Lingua', 'save' => 'Salva', 'create' => 'Crea', - 'dateformat' => 'Formato Data', + 'dateformat' => 'Formato data', 'slug' => 'Slug', - 'read_more' => 'leggi di più', + 'read_more' => 'Continua a leggere', 'view_all' => 'Vedi tutto', 'categories' => 'Categorie', 'need_more_support' => 'Necessita più supporto', - 'if_you_did_not_find_an_answer_please_raise_a_ticket_describing_the_issue' => 'Se non hai trovato una risposta, per favore apri un ticket con al descrizione del problema', - 'have_a_question?_type_your_search_term_here' => 'Hai una domanda? Scrivi una parola da cercare qui...', + 'if_you_did_not_find_an_answer_please_raise_a_ticket_describing_the_issue' => 'Se non hai trovato una risposta, per favore apri un ticket con la descrizione del problema', + 'have_a_question?_type_your_search_term_here' => 'Hai una domanda? Cerca qui un argomento...', 'search' => 'Cerca', - 'search_results' => 'Risultati Ricerca', - 'frequently_asked_questions' => 'Domande Frequenti', - 'leave_a_reply' => 'Lascia una Risposta', - 'post_message' => 'Post Message', + 'frequently_asked_questions' => 'Domande frequenti', + 'leave_a_reply' => 'Lascia una risposta', + 'post_message' => 'Messaggio post', /* |-------------------------------------------------------------------------------------- | Client Panel [English(en)] @@ -865,49 +1342,45 @@ return [ | customize your views to better match your application. | */ - 'home' => 'Home', - 'submit_a_ticket' => 'Invia un Ticket', - 'my_profile' => 'Mio Profilo', - 'log_out' => 'Logout', - 'forgot_password' => 'Password Dimenticata', - 'create_account' => 'Crea un Account', - 'you_are_here' => 'Sei qui', - 'have_a_ticket' => 'Have a Ticket', - 'check_ticket_status' => 'Controlla Status Ticket', - 'choose_a_help_topic' => 'Choose a Help Topic', - 'ticket_status' => 'Status Ticket', - 'post_comment' => 'Posta Commento', - 'plugin' => 'Plugin', - - /***************************New Updates****************************************/ - /* Translation Required after this line */ - /******************************************************************************/ - 'edit_profile' => 'Edit profile', - 'you_are_here' => 'You are here', - 'Send' => 'SEND', - 'no_article' => 'No article', - 'profile_settings' => 'Profile settings', - 'please_fill_all_required_feilds' => 'Please fill all required feilds.', - 'successfully_replied' => 'Successfully replied', - 'please_fill_some_data' => 'Please fill some data!', - 'profile_updated_sucessfully' => 'Profile updated sucessfully', - 'password_updated_sucessfully' => 'Password updated sucessfully', - 'password_was_not_updated_incorrect_old_password' => 'Password was not updated. Incorrect old password', - 'there_is_no_such_ticket_number' => 'There is no such ticket number', - "email_didn't_match_with_ticket_number" => "Email didn't match with ticket number", - 'we_have_sent_you_a_link_by_email_please_click_on_that_link_to_view_ticket' => 'We have sent you a link by email. Please click on that link to view ticket', - 'no_records_on_publish_time' => 'No records on publish time', - 'your_details_send_to_system' => 'Your details send to the system', - 'your_details_can_not_send_to_system' => 'Your details can not be sent to the system', - 'your_comment_posted' => 'Your comment posted', - 'sorry_not_processed' => 'Sorry not processed', - 'profile_updated_sucessfully' => 'Profile updated sucessfully', - 'password_was_not_updated' => 'Password was not updated', - 'sorry_your_ticket_token_has_expired_please_try_to_resend_the_ticket_link_request' => 'Sorry your ticket token has expired! Please try to resend the ticket link request', - 'sorry_you_are_not_allowed_token_expired' => 'Sorry you are not allowed. Token has expired!', - 'thank_you_for_your_rating' => 'Thank you for your rating!', - 'your_ticket_has_been' => 'Your ticket has been', - 'failed_to_send_email_contact_administrator' => 'Email sending failed. Please contact system administrator', + 'home' => 'Home', + 'submit_a_ticket' => 'Invia un Ticket', + 'my_profile' => 'Mio profilo', + 'log_out' => 'Logout', + 'forgot_password' => 'Password dimenticata', + 'create_account' => 'Crea un account', + 'you_are_here' => 'Sei qui', + 'have_a_ticket' => 'Hai un ticket', + 'check_ticket_status' => 'Controlla stato ticket', + 'choose_a_help_topic' => 'Scegli un area di supporto', + 'ticket_status' => 'Stato del ticket', + 'post_comment' => 'Pubblica un commento', + 'plugin' => 'Plugin', + 'edit_profile' => 'Modifica profilo', + 'you_are_here' => 'Sei qui', + 'Send' => 'INVIA', + 'no_article' => 'Nessun articolo', + 'profile_settings' => 'Impostazioni profilo', + 'please_fill_all_required_feilds' => 'Per favore compila tutti i campi richiesti.', + 'successfully_replied' => 'Replicato con successo', + 'please_fill_some_data' => 'Per favore inserisci qualche dato!', + 'profile_updated_sucessfully' => 'Profilo aggiornato con successo', + 'password_updated_sucessfully' => 'Password aggiornata', + 'password_was_not_updated_incorrect_old_password' => 'Password non aggiornata, "Vecchia password" errata', + 'there_is_no_such_ticket_number' => 'Numero ticket non trovato', + "email_didn't_match_with_ticket_number" => "Email non corrispondente al numero di ticket", + 'we_have_sent_you_a_link_by_email_please_click_on_that_link_to_view_ticket' => 'Ti abbiamo inviato un link per mail, per favore cliccaci per visualizzare il ticket', + 'no_records_on_publish_time' => 'Nessun data nella data indicata', + 'your_details_send_to_system' => 'I tuoi dettagli sono stati inviati al sistema', + 'your_details_can_not_send_to_system' => 'I tuoi dettagli non sono stati inviati al sistema', + 'your_comment_posted' => 'Commento pubblicato', + 'sorry_not_processed' => 'Non processato', + 'profile_updated_sucessfully' => 'Profilo aggiornato con successo', + 'password_was_not_updated' => 'Password non aggiornata', + 'sorry_your_ticket_token_has_expired_please_try_to_resend_the_ticket_link_request' => 'Token del ticket scaduto! Per favore prova ad inviare nuovamente il link di richiesta ticket', + 'sorry_you_are_not_allowed_token_expired' => 'Non sei autorizzato. Token scaduto!', + 'thank_you_for_your_rating' => 'Grazie per la valutazione!', + 'your_ticket_has_been' => 'Il tuo ticket è stato ', + 'failed_to_send_email_contact_administrator' => 'Invio mail fallito, per favore contatta l\'amministratore', /* * |--------------------------------------------------------------------------------------- * |API settings @@ -917,206 +1390,203 @@ return [ * | */ 'webhooks' => 'Webhooks', - 'enter_url_to_send_ticket_details' => 'Enter the URL to send the ticket details', + 'enter_url_to_send_ticket_details' => 'Inserisci l\'URL per inviare i dettagli del ticket', 'api' => 'API', - 'api_key' => 'API key', - 'api_key_mandatory' => 'API key mandatory', - 'api_configurations' => 'API configurations', - 'generate_key' => 'Generate key', - 'api_settings' => 'API settings', + 'api_key' => 'Chiave API', + 'api_key_mandatory' => 'Chiave API obbligatoria', + 'api_configurations' => 'Configurazione API', + 'generate_key' => 'Genera chiave', + 'api_settings' => 'Impostazioni API', /* * ----------------------------------------------------------------------------- * Error log and debugging settings * -------------------------------------------------------------------------- * */ - 'error-debug' => 'Error logs and debugging', - 'debug-options' => 'Debugging options', - 'view-logs' => 'View error logs', - 'not-authorised-error-debug' => 'You are not authorised to access the URL', - 'error-debug-settings' => 'Error and debugging settings', - 'debugging' => 'Debugging mode', - 'bugsnag-debugging' => 'Send app crash reports to help Ladybird improve Faveo', - 'error-debug-settings-saved-message' => 'Your error and debugging settings have been saved successfully', - 'error-debug-settings-error-message' => 'You have not made any change in the settings.', - 'error-logs' => 'Error logs', + 'error-debug' => 'Log errori e debug', + 'debug-options' => 'Opzioni di debug', + 'view-logs' => 'Visualizza log errori', + 'not-authorised-error-debug' => 'Non sei autorizzato ad accedere all\'URL', + 'error-debug-settings' => 'Impostazioni errori e debug', + 'debugging' => 'Modalità debug', + 'bugsnag-debugging' => 'Invia rapporti di crash per aiutare Ladybird a migliorare Faveo', + 'error-debug-settings-saved-message' => 'Le tue impostazioni sono state salvate correttamente', + 'error-debug-settings-error-message' => 'Non hai effettuato modifiche nelle impostazioni.', + 'error-logs' => 'Log errori', /* --------------------------------------------------------------------------------------- * Latest update 16-06-2016 * ----------------------------------------------------------------------------------- */ - 'that_email_is not_available_in_this_system' => 'That Email is not available in this System', - 'use_subject' => 'Use Subject', - 'reopen' => 'Reopen', - 'invalid_attempt' => 'Invalid Attempt', + 'that_email_is not_available_in_this_system' => 'Quella mail non è disponibile nel sistema', + 'use_subject' => 'Usa soggetto', + 'reopen' => 'riaperti', + 'invalid_attempt' => 'Tentativo non valido', /* --------------------------------------------------------------------------------------- * Latest update 27-07-2016 * ----------------------------------------------------------------------------------- */ - 'queue' => 'Queue', - 'queues' => 'Queues', + 'queue' => 'Coda', + 'queues' => 'Code', /* * ------------------------------------------------------------------------------------------------- * OTP messages body to send to user while registering, resetting passwords * -------------------------------------------------------------------------------------------------- */ - 'hello' => 'Hello', - 'reset-link-msg' => ",\r\nHere is the link to reset your password.\r\n", - 'otp-for-your' => ",\r\nOTP for your", - 'account-verification-is' => 'account verification is', - 'extra-text' => ".\r\nYou can login to verify your account via OTP or just click on the link we've sent to your email address.", - 'otp-not-sent' => 'We faced some problem in sending OTP please try after some time.', + 'hello' => 'Ciao', + 'reset-link-msg' => ",\r\nQuesto è il link per resettare la password.\r\n", + 'otp-for-your' => ",\r\nOTP per il tuo", + 'account-verification-is' => 'verifica account è', + 'extra-text' => ".\r\nPuoi collegarti per verificare il tuo via OTP o semplicamente cliccare sul link che ti abbiamo spedito per email.", + 'otp-not-sent' => 'Stiamo riscontrando qualche problema nell\'invio del codice OTP, per favore riprova più tardi.', /* * ------------------------------------------------------------------------------------------- * Ticket number settings 03-08-2016 * ------------------------------------------------------------------------------------------ */ - 'format' => 'Format', - 'ticket-number-format' => 'This setting is used to generate ticket numbers. Use hash signs (`#`) where digits are to be placed & dollar sign(‘$’) where characters are to be placed . Any other text in the number format will be preserved. ', - 'ticket-number-type' => 'Choose a sequence from which to derive new ticket numbers. The system has a incrementing sequence and a random sequence by default', + 'format' => 'Formato', + 'ticket-number-format' => 'Questa opzione è usata per generare il numero dei ticket. Usa il simbolo cancelletto (`#`) per usare numeri ed il simbolo del dollaro (‘$’) per usare lettere. Tutti gli altri caratteri saranno mantenuti inalterati. ', + 'ticket-number-type' => 'Scegli la sequenza dalla quale derivare il numero dei ticket. Il sistema usa una sequenza incrementale e casuale di default', /* * ---------------------------------------------------------------------------------------------------- * Social media integration * --------------------------------------------------------------------------------------------------------- */ - 'client_id' => 'Client id', - 'client_secret' => 'Client secret', - 'redirect' => 'Redirect URL', - 'details' => 'Details', + 'client_id' => 'Client ID', + 'client_secret' => 'Client segreto', + 'redirect' => 'URL di reindirizzamento', + 'details' => 'Dettagli', 'social-media' => 'Social media', /* * ---------------------------------------------------------------------------------------------- * Report * ---------------------------------------------------------------------------------------------- */ - 'report' => 'Report', - 'Report' => 'REPORT', - 'start_date' => 'Start date', - 'end_date' => 'End date', - 'select' => 'Select', - 'generate' => 'Generate', - 'day' => 'Day', - 'week' => 'Week', - 'month' => 'Month', - 'Currnet_In_Progress' => 'CURRENT IN PROGRESS', - 'Total_Created' => 'TOTAL CREATED', - 'Total_Reopened' => 'TOTAL REOPENED', - 'Total_Closed' => 'TOTAL CLOSED', - 'tabular' => 'Tabular', - 'reopened' => 'Reopened', + 'report' => 'Resoconto', + 'Report' => 'RESOCONTO', + 'start_date' => 'Data inizio', + 'end_date' => 'Data fine', + 'select' => 'Seleziona', + 'generate' => 'Genera', + 'day' => 'Giorno', + 'week' => 'Settimana', + 'month' => 'Mese', + 'Currnet_In_Progress' => 'IN CORSO', + 'Total_Created' => 'TOTALE CREATI', + 'Total_Reopened' => 'TOTALE RIAPERTI', + 'Total_Closed' => 'TOTALE CHIUSI', + 'tabular' => 'Tabulato', + 'reopened' => 'Riaperti', /* --------------------------------------------------------------------------------------- * Ticket Priority * ----------------------------------------------------------------------------------- */ - 'ticket_priority' => 'Ticket priority', - 'priority' => 'Priority', - 'priority_desc' => 'Priority description', - 'priority_urgency' => 'Priority urgency', - 'priority_id' => 'Priority Id', - 'priority_color' => 'Priority color', - 'ispublic' => 'IsPublic', - 'is_default' => 'By default', - 'create_ticket_priority' => 'Create ticket priority', - 'agent_notes' => 'Agent notes', - 'select_priority' => 'Select priority', - 'normal' => 'Normal', - 'ispublic' => 'Visibility', - 'make-default-priority' => 'Make default priority', - 'priority_successfully_created' => 'Priority successfully created', - 'priority_successfully_updated' => 'Priority successfully updated', - 'delete_successfully' => 'Delete successfully', - 'user_priority_status' => 'User priority status', - 'current' => 'Current:', - 'active_user_can_select_the_priority_while_creating_ticket' => 'Active user can select the priority while creating ticket', + 'ticket_priority' => 'Priorità ticket', + 'priority' => 'Priorità', + 'priority_desc' => 'Descrizione', + 'priority_urgency' => 'Urgenza priorità', + 'priority_id' => 'ID priorità', + 'priority_color' => 'Colore', + 'ispublic' => 'E\' pubblica', + 'is_default' => 'Di default', + 'create_ticket_priority' => 'Crea priorità ticket', + 'agent_notes' => 'Note agente', + 'select_priority' => 'Seleziona priorità', + 'normal' => 'Normale', + 'ispublic' => 'Visibilità', + 'make-default-priority' => 'Rendi priorità predefinita', + 'priority_successfully_created' => 'Priorità creata con successo', + 'priority_successfully_updated' => 'Priorità aggiornata con successo', + 'delete_successfully' => 'Cancellata correttamente', + 'user_priority_status' => 'Stato priorità utente', + 'current' => 'Corrente:', + 'active_user_can_select_the_priority_while_creating_ticket' => 'Gli utenti attivi possono seleziona la priorità durante la creazione del ticket', /* -------------------------------------------------------------------------------------------- * Approval Updated * -------------------------------------------------------------------------------------------- */ - 'approval' => 'Approval', - 'approval_tickets' => 'Approval tickets', - 'approve' => 'Approve', - 'approval_request' => 'Approval request', - 'approvel_ticket_list' => 'Approvel ticket list', - - 'approval_settings' => 'Approval settings', - 'close_all_ticket_for_approval' => 'Close all tickets for approval', - 'approval_settings-created-successfully' => 'Approval settings created successfully', + 'approval' => 'Approvati', + 'approval_tickets' => 'Ticket approvati', + 'approve' => 'Approva', + 'approval_request' => 'Richiesta approvazione', + 'approvel_ticket_list' => 'Lista ticket approvati', + 'approval_settings' => 'Impostazioni approvazione', + 'close_all_ticket_for_approval' => 'Chiudi tutti i ticket approvati', + 'approval_settings-created-successfully' => 'Impostazioni di approvazione create correttamente', /* -------------------------------------------------------------------------------------------- * Followup Updated * -------------------------------------------------------------------------------------------- */ 'followup' => 'Followup', - 'followup_tickets' => 'Followup tickets', - 'followup_Notification' => 'Followup notification', + 'followup_tickets' => 'Ticket di followup', + 'followup_Notification' => 'Notifiche followup', /* *-------------------------------------------------------------------------------------------- *Updated 6-9-2016 *--------------------------------------------------------------------------------------- */ - 'not-available' => 'Not available', + 'not-available' => 'Non disponibile', /* -------------------------------------------------------------------------------------------- * User Module * -------------------------------------------------------------------------------------------- */ - 'agent_report' => 'Agent report', - 'assign_tickets' => 'Assign tickets', - 'delete_agent' => 'Delete agent', - 'delete_user' => 'Delete user', - 'confirm_deletion' => 'Confirm deletion', - 'delete_all_content' => 'Delete all content', - 'agent_profile' => 'Agent profile', - 'change_role_to_admin' => 'Change role to admin', - 'change_role_to_user' => 'Change role to user', - 'change_role_to_agent' => 'Change role to agent', - 'change_password' => 'Change password', - 'role_change' => 'Role change', - 'password_generator' => 'Password generator', - 'depertment' => 'Depertment', - 'duetoday' => 'Due today', - 'today-due_tickets' => 'Today\'s due ticekts', - 'password_change_successfully' => 'Password changed successfully', - 'role_change_successfully' => 'Role changed successfully', - 'user_delete_successfully' => 'User deleted successfully', - 'agent_delete_successfully' => 'Agent deleted successfully', - 'select_another_agent' => 'Select another agent', - 'agent_delete_successfully_and_ticket_assign_to_another_agent' => 'Agent deleted successfully and ticket assigned to another agent', - 'deleted_user' => 'Deleted User', - 'deleted_user_directory' => 'Deleted User Directory', - 'restore' => 'Restore', - 'user_restore_successfully' => 'User restore successfully', + 'agent_report' => 'Resoconto agente', + 'assign_tickets' => 'Ticket assegnati', + 'delete_agent' => 'Cancella agente', + 'delete_user' => 'Cancella utente', + 'confirm_deletion' => 'Conferma cancellazione', + 'delete_all_content' => 'Cancella tutti i contenuti', + 'agent_profile' => 'Profilo agente', + 'change_role_to_admin' => 'Cambia ruolo in admin', + 'change_role_to_user' => 'Cambia ruolo in utente', + 'change_role_to_agent' => 'Cambia ruolo in agente', + 'change_password' => 'Cambia password', + 'role_change' => 'Cambio ruolo', + 'password_generator' => 'Genera password', + 'depertment' => 'Dipartimento', + 'duetoday' => 'In ritardo oggi', + 'today-due_tickets' => 'In scadenza oggi', + 'password_change_successfully' => 'Password cambiata con successo', + 'role_change_successfully' => 'Ruolo modificato con successo', + 'user_delete_successfully' => 'Utente cancellato correttamente', + 'agent_delete_successfully' => 'Agente cancellato correttamente', + 'select_another_agent' => 'Seleziona un altro agente', + 'agent_delete_successfully_and_ticket_assign_to_another_agent' => 'Agente cancellato e ticket assegnato ad altro agente', + 'deleted_user' => 'Utente cancellato', + 'deleted_user_directory' => 'Cartella utente cancellata', + 'restore' => 'Ripristina', + 'user_restore_successfully' => 'Utente ripristinato correttamente', /*** updates 28-11-2016***/ - 'apply' => 'Apply', + 'apply' => 'Applica', /* updates 2-12-2016 **/ - 'sort-by' => 'Sort by', - 'created-at' => 'Created at', - 'or' => 'OR', - 'activate' => 'Activate', - 'system-email-not-configured' => 'We are unable to process email request as the system has no configured email for sending mails. Please contact and report system admin.', - 'assign-ticket' => 'Assign tickets', - 'can-not-inactive-group' => 'Can not make the group inactive as it has agents assigned in it. Please assign those agents to another group and try again.', - 'internal-note-has-been-added' => 'Internal note added to the ticket', - 'active-users' => 'Active users', - 'deleted-users' => 'Deleted users', - 'view-option' => 'View options', - 'accoutn-not-verified' => 'User account is not verified', - 'enabled' => 'Enabled', - 'disabled' => 'Disabled', - 'user-account-is-deleted' => 'This user account has been deleted.', - 'restore-user' => 'Restore user account', - 'delete-account-caution-info' => 'Please note this account may still have open tickets in the system.', - 'reply-can-not-be-empty' => 'Reply can not be blank. Please enter your reply.', + 'sort-by' => 'Ordina per', + 'created-at' => 'Creato a', + 'or' => 'o', + 'activate' => 'Attiva', + 'system-email-not-configured' => 'Non possiamo processare la richiesta in quanto il sistema non ha configurato alcuna mail per le notifiche. Per favore contatta l\'amministratore.', + 'assign-ticket' => 'Assegna ticket', + 'can-not-inactive-group' => 'Impossibile disattivare il gruppo con agenti assegnati. Per favore riassegna gli agenti ad un altro gruppo e riprova.', + 'internal-note-has-been-added' => 'Note interne aggiunte al ticket', + 'active-users' => 'Utenti attivi', + 'deleted-users' => 'Utenti cancellati', + 'view-option' => 'Visualizza opzioni', + 'accoutn-not-verified' => 'Account non verificato', + 'enabled' => 'Abilitato', + 'disabled' => 'Disabilitato', + 'user-account-is-deleted' => 'Questo account è stato cancellato.', + 'restore-user' => 'Ripristina account utente', + 'delete-account-caution-info' => 'Questo account potrebbe avere ancora ticket aperti nel sistema.', + 'reply-can-not-be-empty' => 'La risposta non può essere vuota.', //update 18-12-2016 - 'account-created-contact-admin-as-we-were-not-able-to-send-opt' => 'Your account has been created successfully. Please contact admin for account activation as we were not able to send you an OPT code.', + 'account-created-contact-admin-as-we-were-not-able-to-send-opt' => 'Il tuo account è stato creato correttamente. Per favore contatta l\'amministratore in quanto non siamo stati in grado di spedire un codice OTP.', //update 19-12-2016 - 'only-agents' => 'Agent users', - 'only-users' => 'Clients users', - 'banned-users' => 'Banned users', - 'inactive-users' => 'Inactive users', - 'all-users' => 'All users', - 'search' => 'Search...', + 'only-agents' => 'Utenti agenti', + 'only-users' => 'Utenti clienti', + 'banned-users' => 'Utenti bannati', + 'inactive-users' => 'Utenti inattivi', + 'all-users' => 'Tutti gli utenti', + 'search' => 'Cerca...', //update 21-12-2016 - 'selected-user-is-already-the-owner' => 'Selected user is already the owner of this ticket.', - //updated 15-5-2017 - 'session-expired' => 'Session expired or invalid, please try again.', + 'selected-user-is-already-the-owner' => 'L\'utente selezionato è già il proprietario del ticket.', ]; diff --git a/resources/lang/it/pagination.php b/resources/lang/it/pagination.php index 668d15f77..623d76361 100644 --- a/resources/lang/it/pagination.php +++ b/resources/lang/it/pagination.php @@ -14,5 +14,5 @@ return [ */ 'previous' => '« Precedente', - 'next' => 'Prossimo »', + 'next' => 'Successivo »', ]; diff --git a/resources/lang/it/passwords.php b/resources/lang/it/passwords.php index 465ad8a90..5185b4e65 100644 --- a/resources/lang/it/passwords.php +++ b/resources/lang/it/passwords.php @@ -13,9 +13,9 @@ return [ | */ - 'password' => 'Le Passwords devono essere almeno di sei caratteri e combaciare.', - 'user' => 'Non esiste un utente con questo indirizzo e-mail.', - 'token' => 'Il token per il reset della password non è valido.', - 'sent' => 'Una email con il link al reset della passowrd ti è stato inviato!', + 'password' => 'Le password devono essere almeno di sei carattere e devono corrispondere.', + 'user' => "Non trovo nessun utente con l'email fornita.", + 'token' => 'Il token di reset password non è valido.', + 'sent' => 'Ti abbiamo inviato per email il link di reset della password!', 'reset' => 'La tua password è stata resettata!', ]; diff --git a/resources/lang/it/validation.php b/resources/lang/it/validation.php index 2c295dc85..caf305df1 100644 --- a/resources/lang/it/validation.php +++ b/resources/lang/it/validation.php @@ -2,77 +2,77 @@ return [ - /* - |-------------------------------------------------------------------------- - | Validation Language Lines - |-------------------------------------------------------------------------- - | - | The following language lines contain the default error messages used by - | the validator class. Some of these rules have multiple versions such - | as the size rules. Feel free to tweak each of these messages here. - | - */ + /* + |-------------------------------------------------------------------------- + | Validation Language Lines + |-------------------------------------------------------------------------- + | + | The following language lines contain the default error messages used by + | the validator class. Some of these rules have multiple versions such + | as the size rules. Feel free to tweak each of these messages here. + | + */ - 'accepted' => 'The :attribute must be accepted.', - 'active_url' => 'The :attribute is not a valid URL.', - 'after' => 'The :attribute must be a date after :date.', - 'alpha' => 'The :attribute may only contain letters.', - 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.', - 'alpha_num' => 'The :attribute may only contain letters and numbers.', - 'array' => 'The :attribute must be an array.', - 'before' => 'The :attribute must be a date before :date.', + 'accepted' => ':attribute deve essere accettatp.', + 'active_url' => ':attribute non è un URL valido.', + 'after' => ':attribute deve essere una data dopo il :date.', + 'alpha' => ':attribute può contenere lettere.', + 'alpha_dash' => ':attribute può contenere lettere, numeri, e trattini.', + 'alpha_num' => ':attribute può contenere lettere and numeri.', + 'array' => ':attribute deve essere un array.', + 'before' => ':attribute deve essere una data prima di :date.', 'between' => [ - 'numeric' => 'The :attribute must be between :min and :max.', - 'file' => 'The :attribute must be between :min and :max kilobytes.', - 'string' => 'The :attribute must be between :min and :max characters.', - 'array' => 'The :attribute must have between :min and :max items.', + 'numeric' => ':attribute deve essere fra :min e :max.', + 'file' => ':attribute deve essere fra :min e :max kilobytes.', + 'string' => ':attribute deve essere fra :min e :max caratteri.', + 'array' => ':attribute deve contenere fra :min e :max oggetti.', ], - 'boolean' => 'The :attribute field must be true or false.', - 'confirmed' => 'The :attribute confirmation does not match.', - 'date' => 'The :attribute is not a valid date.', - 'date_format' => 'The :attribute does not match the format :format.', - 'different' => 'The :attribute and :other must be different.', - 'digits' => 'The :attribute must be :digits digits.', - 'digits_between' => 'The :attribute must be between :min and :max digits.', - 'email' => 'The :attribute must be a valid email address.', - 'filled' => 'The :attribute field is required.', - 'exists' => 'The selected :attribute is invalid.', - 'image' => 'The :attribute must be an image.', - 'in' => 'The selected :attribute is invalid.', - 'integer' => 'The :attribute must be an integer.', - 'ip' => 'The :attribute must be a valid IP address.', + 'boolean' => ':attribute deve essere vero o falso.', + 'confirmed' => ':attribute di conferma non corrisponde.', + 'date' => ':attribute non è una data valida.', + 'date_format' => ':attribute non corrisponde al formato :format.', + 'different' => ':attribute e :other deveno essere differenti.', + 'digits' => ':attribute deve essere :digits numeri.', + 'digits_between' => ':attribute deve essere fra :min and :max numeri.', + 'email' => ':attribute deve essere un indirizzo email valido.', + 'filled' => ':attribute è obbligatorio.', + 'exists' => ':attribute selezionato non è valido.', + 'image' => ':attribute deve essere una immagine.', + 'in' => ':attribute selezionato non è valido.', + 'integer' => ':attribute deve essere un intero.', + 'ip' => ':attribute deve essere un indirizzo IP valido.', 'max' => [ - 'numeric' => 'The :attribute may not be greater than :max.', - 'file' => 'The :attribute may not be greater than :max kilobytes.', - 'string' => 'The :attribute may not be greater than :max characters.', - 'array' => 'The :attribute may not have more than :max items.', + 'numeric' => ':attribute non può essere più grande di :max.', + 'file' => ':attribute non può essere più grande di :max kilobytes.', + 'string' => ':attribute non può essere più grande di :max caratteri.', + 'array' => ':attribute non può avere più di :max oggetti.', ], - 'mimes' => 'The :attribute must be a file of type: :values.', + 'mimes' => ':attribute deve essere un file di tipo: :values.', 'min' => [ - 'numeric' => 'The :attribute must be at least :min.', - 'file' => 'The :attribute must be at least :min kilobytes.', - 'string' => 'The :attribute must be at least :min characters.', - 'array' => 'The :attribute must have at least :min items.', + 'numeric' => ':attribute deve essere almeno :min.', + 'file' => ':attribute deve essere almeno :min kilobytes.', + 'string' => ':attribute deve essere almeno :min caratteri.', + 'array' => ':attribute deve avere almeno :min oggetti.', ], - 'not_in' => 'The selected :attribute is invalid.', - 'numeric' => 'The :attribute must be a number.', - 'regex' => 'The :attribute format is invalid.', - 'required' => 'The :attribute field is required.', - 'required_if' => 'The :attribute field is required when :other is :value.', - 'required_with' => 'The :attribute field is required when :values is present.', - 'required_with_all' => 'The :attribute field is required when :values is present.', - 'required_without' => 'The :attribute field is required when :values is not present.', - 'required_without_all' => 'The :attribute field is required when none of :values are present.', - 'same' => 'The :attribute and :other must match.', + 'not_in' => ':attribute selezionato non è valido.', + 'numeric' => ':attribute deve essere un numero.', + 'regex' => ':attribute ha un formato non valido.', + 'required' => ':attribute è richiesto.', + 'required_if' => ':attribute è richiesto quando :other è :value.', + 'required_with' => ':attribute è richiesto quando :values è presente.', + 'required_with_all' => ':attribute è richiesto quando :values è presente.', + 'required_without' => ':attribute è richiesto quando :values non è presente.', + 'required_without_all' => ':attribute è richiesto quando nessuno dei :values è presente.', + 'same' => ':attribute e :other devono corrispondere.', 'size' => [ - 'numeric' => 'The :attribute must be :size.', - 'file' => 'The :attribute must be :size kilobytes.', - 'string' => 'The :attribute must be :size characters.', - 'array' => 'The :attribute must contain :size items.', + 'numeric' => ':attribute deve essere :size.', + 'file' => ':attribute deve essere :size kilobytes.', + 'string' => ':attribute deve essere :size caratter.', + 'array' => ':attribute deve contenere :size oggetti.', ], - 'unique' => 'The :attribute has already been taken.', - 'url' => 'The :attribute format is invalid.', - 'timezone' => 'The :attribute must be a valid zone.', + 'unique' => ':attribute è già stato utilizzato.', + 'url' => ':attribute è in un formato non valido.', + 'timezone' => ':attribute deve essere un valido fuso orario.', /* |-------------------------------------------------------------------------- | Custom Validation Language Lines From e11f59e191877a8d19ad895397e00112b82580cf Mon Sep 17 00:00:00 2001 From: Pietro La Gamba <2481452+donlimo@users.noreply.github.com> Date: Mon, 9 Oct 2017 22:26:08 +0200 Subject: [PATCH 13/46] styleci fix --- resources/lang/it/lang.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/lang/it/lang.php b/resources/lang/it/lang.php index 75f065d43..5c556813b 100644 --- a/resources/lang/it/lang.php +++ b/resources/lang/it/lang.php @@ -24,7 +24,7 @@ return [ 'required-error' => 'Per favore compila tutti i campi richiesti', 'invalid' => 'ID utente o password sbagliate', 'sorry_something_went_wrong' => 'Ci dispiace, qualcosa è andato storto', - 'were_working_on_it_and_well_get_it_fixed_as_soon_as_we_can' => "Ci stiamo lavorando e risolveremo il problema quanto prima.", + 'were_working_on_it_and_well_get_it_fixed_as_soon_as_we_can' => 'Ci stiamo lavorando e risolveremo il problema quanto prima.', 'we_are_sorry_but_the_page_you_are_looking_for_can_not_be_found' => 'Ci dispiace, la pagina che stai cercando non esiste.', 'go_back' => 'Torna indietro', 'the_board_is_offline' => 'Il sistema è offline', @@ -343,7 +343,7 @@ return [ 'cron_notification' => 'Attiva notifica cron', 'cron' => 'Schedulatore cron', 'cron-jobs' => 'Cron jobs', - 'crone-url-message' => "Questi sono i cron job di Faveo per il tuo sistema.", + 'crone-url-message' => 'Questi sono i cron job di Faveo per il tuo sistema.', 'clipboard-copy-message' => 'Copiato negli appunti.', 'click' => 'Clicca qui', 'check-cron-set' => 'per vedere come impostare cron jobs sul tuo server.', @@ -1367,7 +1367,7 @@ return [ 'password_updated_sucessfully' => 'Password aggiornata', 'password_was_not_updated_incorrect_old_password' => 'Password non aggiornata, "Vecchia password" errata', 'there_is_no_such_ticket_number' => 'Numero ticket non trovato', - "email_didn't_match_with_ticket_number" => "Email non corrispondente al numero di ticket", + "email_didn't_match_with_ticket_number" => 'Email non corrispondente al numero di ticket', 'we_have_sent_you_a_link_by_email_please_click_on_that_link_to_view_ticket' => 'Ti abbiamo inviato un link per mail, per favore cliccaci per visualizzare il ticket', 'no_records_on_publish_time' => 'Nessun data nella data indicata', 'your_details_send_to_system' => 'I tuoi dettagli sono stati inviati al sistema', From dd3882a98890f55901e3d4804e3e8927688d3cab Mon Sep 17 00:00:00 2001 From: Manish Verma Date: Thu, 12 Oct 2017 14:31:30 +0530 Subject: [PATCH 14/46] updated readme Added v1.9.7-BETA release information. To call testers and developers to test new features. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 893b7dd1b..a68bb7550 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ Faveo Helpdesk Community ========
       StyleCI  
    +#### :new: Faveo Helpdesk Community [v1.9.7-BETA](https://github.com/ladybirdweb/faveo-helpdesk/releases/tag/v1.9.7-BETA) is out. Click [here](https://github.com/ladybirdweb/faveo-helpdesk/archive/v1.9.7-BETA.zip) to download it now. + Faveo Helpdesk provides Businesses with an automated Helpdesk system to manage customer support. The word Faveo comes from Latin which means to be favourable. Which truly highlights vision and the scope as well as the functionality of the product that Faveo is. In today’s competitive startup scenario customer retention is one of the major challenges. Handling client query diligently is all the difference between retaining or losing a long lasting relationship. The company is driven with passion of providing tools for managing consumer queries for strategic insights and helping companies take those decisive decisions. @@ -15,7 +17,7 @@ Flavors of Faveo * Faveo Community Edition – Free, Open source edition * Faveo Pro Edition – Paid version with many advance features and integrations * Faveo Service Desk - Paid version for IT Assest management - + Faveo Documentation -------------------------- * Faveo user Manual From d2b26cd8905d16dff178f53c988fc8a226ab0cf6 Mon Sep 17 00:00:00 2001 From: Luca Volpones Date: Tue, 7 Nov 2017 18:43:22 +0100 Subject: [PATCH 15/46] Fix typo #1 --- app/Http/Middleware/CheckRoleAgent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Middleware/CheckRoleAgent.php b/app/Http/Middleware/CheckRoleAgent.php index e2e73012a..6c9a268af 100644 --- a/app/Http/Middleware/CheckRoleAgent.php +++ b/app/Http/Middleware/CheckRoleAgent.php @@ -25,6 +25,6 @@ class CheckRoleAgent return $next($request); } - return redirect('dashboard')->with('fails', 'You are not Autherised'); + return redirect('dashboard')->with('fails', 'You are not Authorised'); } } From 7eaedb97dcb6c3afc3fce6585f847128404ab070 Mon Sep 17 00:00:00 2001 From: Luca Volpones Date: Tue, 7 Nov 2017 18:46:39 +0100 Subject: [PATCH 16/46] Duplicate array key in lang.php in all languages --- resources/lang/de/lang.php | 1 - resources/lang/en/lang.php | 1 - resources/lang/fr/lang.php | 1 - resources/lang/it/lang.php | 1 - resources/lang/nl/lang.php | 1 - resources/lang/pt/lang.php | 1 - resources/lang/ru/lang.php | 1 - 7 files changed, 7 deletions(-) diff --git a/resources/lang/de/lang.php b/resources/lang/de/lang.php index dba6d0849..60b0b2010 100644 --- a/resources/lang/de/lang.php +++ b/resources/lang/de/lang.php @@ -1154,7 +1154,6 @@ return [ 'banned-users' => 'Banned users', 'inactive-users' => 'Inactive users', 'all-users' => 'All users', - 'search' => 'Search...', //update 21-12-2016 'selected-user-is-already-the-owner' => 'Selected user is already the owner of this ticket.', //updated 15-5-2017 diff --git a/resources/lang/en/lang.php b/resources/lang/en/lang.php index e576f8265..b3cc8e21e 100644 --- a/resources/lang/en/lang.php +++ b/resources/lang/en/lang.php @@ -1591,7 +1591,6 @@ return [ 'banned-users' => 'Banned users', 'inactive-users' => 'Inactive users', 'all-users' => 'All users', - 'search' => 'Search...', //update 21-12-2016 'selected-user-is-already-the-owner' => 'Selected user is already the owner of this ticket.', //updated 15-5-2017 diff --git a/resources/lang/fr/lang.php b/resources/lang/fr/lang.php index e8656a327..95ee1ad1b 100644 --- a/resources/lang/fr/lang.php +++ b/resources/lang/fr/lang.php @@ -1562,7 +1562,6 @@ return [ 'banned-users' => 'Utilisateurs bannis', 'inactive-users' => 'Utilisateurs inactifs', 'all-users' => 'Tous les utilisateurs', - 'search' => 'Rechercher...', //update 21-12-2016 'selected-user-is-already-the-owner' => 'L\'utilisateur sélectionné est déjà le propriétaire du ticket.', //updated 15-5-2017 diff --git a/resources/lang/it/lang.php b/resources/lang/it/lang.php index 087f45769..8d4b80168 100644 --- a/resources/lang/it/lang.php +++ b/resources/lang/it/lang.php @@ -1114,7 +1114,6 @@ return [ 'banned-users' => 'Banned users', 'inactive-users' => 'Inactive users', 'all-users' => 'All users', - 'search' => 'Search...', //update 21-12-2016 'selected-user-is-already-the-owner' => 'Selected user is already the owner of this ticket.', //updated 15-5-2017 diff --git a/resources/lang/nl/lang.php b/resources/lang/nl/lang.php index fbf5463fb..191fe648f 100644 --- a/resources/lang/nl/lang.php +++ b/resources/lang/nl/lang.php @@ -1608,7 +1608,6 @@ return [ 'banned-users' => 'Banned users', 'inactive-users' => 'Inactive users', 'all-users' => 'All users', - 'search' => 'Search...', //update 21-12-2016 'selected-user-is-already-the-owner' => 'Selected user is already the owner of this ticket.', //updated 15-5-2017 diff --git a/resources/lang/pt/lang.php b/resources/lang/pt/lang.php index 35727ce30..0b9d29150 100644 --- a/resources/lang/pt/lang.php +++ b/resources/lang/pt/lang.php @@ -1553,7 +1553,6 @@ return [ 'banned-users' => 'Banned users', 'inactive-users' => 'Inactive users', 'all-users' => 'All users', - 'search' => 'Search...', //update 21-12-2016 'selected-user-is-already-the-owner' => 'Selected user is already the owner of this ticket.', //updated 15-5-2017 diff --git a/resources/lang/ru/lang.php b/resources/lang/ru/lang.php index 0fc6c253d..17c4541e7 100644 --- a/resources/lang/ru/lang.php +++ b/resources/lang/ru/lang.php @@ -1062,7 +1062,6 @@ return [ 'banned-users' => 'Banned users', 'inactive-users' => 'Inactive users', 'all-users' => 'All users', - 'search' => 'Search...', //update 21-12-2016 'selected-user-is-already-the-owner' => 'Selected user is already the owner of this ticket.', //updated 15-5-2017 From e293187b4bc9f2501b40d51a714774cdbe18cb55 Mon Sep 17 00:00:00 2001 From: Luca Volpones Date: Tue, 7 Nov 2017 18:54:12 +0100 Subject: [PATCH 17/46] Improve it/pagination.php --- resources/lang/it/pagination.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/it/pagination.php b/resources/lang/it/pagination.php index 668d15f77..623d76361 100644 --- a/resources/lang/it/pagination.php +++ b/resources/lang/it/pagination.php @@ -14,5 +14,5 @@ return [ */ 'previous' => '« Precedente', - 'next' => 'Prossimo »', + 'next' => 'Successivo »', ]; From 0b57e4c6afc27c7d1e51bdebddff2e3ec81d6ad6 Mon Sep 17 00:00:00 2001 From: Luca Volpones Date: Tue, 7 Nov 2017 18:57:05 +0100 Subject: [PATCH 18/46] #1 Improve it/lang.php --- resources/lang/it/lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/it/lang.php b/resources/lang/it/lang.php index 087f45769..80cbd80cd 100644 --- a/resources/lang/it/lang.php +++ b/resources/lang/it/lang.php @@ -20,7 +20,7 @@ return [ 'success' => 'Successo', 'fails' => 'Fallito', - 'alert' => 'Allerta', + 'alert' => 'Errore', 'required-error' => 'Per favore inserire i campi richiesti', 'invalid' => 'Id Utente o Password sbagliate', /* From 4172299b31e2997a8f3ca0638c3e06b0b0c448d6 Mon Sep 17 00:00:00 2001 From: Luca Volpones Date: Tue, 7 Nov 2017 18:57:45 +0100 Subject: [PATCH 19/46] #2 Improve it/lang.php --- resources/lang/it/lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/it/lang.php b/resources/lang/it/lang.php index 80cbd80cd..a7aa73e87 100644 --- a/resources/lang/it/lang.php +++ b/resources/lang/it/lang.php @@ -629,7 +629,7 @@ return [ | Dashboard |----------------------------------------------- */ - 'dashboard' => 'Cruscotto', + 'dashboard' => 'Dashboard', 'line_chart' => 'Tabella lineare', 'statistics' => 'Statistiche', 'opened' => 'Aperto', From 760d752b5dde468b16710179f661cce73f4ad591 Mon Sep 17 00:00:00 2001 From: Luca Volpones Date: Tue, 7 Nov 2017 19:01:46 +0100 Subject: [PATCH 20/46] Fix #2 --- resources/lang/de/lang.php | 1 - resources/lang/en/lang.php | 1 - resources/lang/fr/lang.php | 1 - resources/lang/it/lang.php | 1 - resources/lang/nl/lang.php | 1 - resources/lang/pt/lang.php | 1 - resources/lang/ru/lang.php | 1 - 7 files changed, 7 deletions(-) diff --git a/resources/lang/de/lang.php b/resources/lang/de/lang.php index 60b0b2010..b5f709973 100644 --- a/resources/lang/de/lang.php +++ b/resources/lang/de/lang.php @@ -923,7 +923,6 @@ return [ *translation required from here *****************************************************/ 'edit_profile' => 'Edit profile', - 'you_are_here' => 'You are here', 'Send' => 'SEND', 'no_article' => 'No article', 'profile_settings' => 'Profile settings', diff --git a/resources/lang/en/lang.php b/resources/lang/en/lang.php index b3cc8e21e..a7cbe124c 100644 --- a/resources/lang/en/lang.php +++ b/resources/lang/en/lang.php @@ -1360,7 +1360,6 @@ return [ 'post_comment' => 'Post comment', 'plugin' => 'Plugin', 'edit_profile' => 'Edit profile', - 'you_are_here' => 'You are here', 'Send' => 'SEND', 'no_article' => 'No article', 'profile_settings' => 'Profile settings', diff --git a/resources/lang/fr/lang.php b/resources/lang/fr/lang.php index 95ee1ad1b..bcf2a27f1 100644 --- a/resources/lang/fr/lang.php +++ b/resources/lang/fr/lang.php @@ -1322,7 +1322,6 @@ return [ 'post_comment' => 'Poster commentaire', 'plugin' => 'Plugin', 'edit_profile' => 'Modifier profil', - 'you_are_here' => 'Vous êtes ici', 'Send' => 'VALIDER', 'no_article' => 'Pas d\'article', 'profile_settings' => 'Paramètres du profil', diff --git a/resources/lang/it/lang.php b/resources/lang/it/lang.php index 8d4b80168..4cba37743 100644 --- a/resources/lang/it/lang.php +++ b/resources/lang/it/lang.php @@ -883,7 +883,6 @@ return [ /* Translation Required after this line */ /******************************************************************************/ 'edit_profile' => 'Edit profile', - 'you_are_here' => 'You are here', 'Send' => 'SEND', 'no_article' => 'No article', 'profile_settings' => 'Profile settings', diff --git a/resources/lang/nl/lang.php b/resources/lang/nl/lang.php index 191fe648f..2afe15a2c 100644 --- a/resources/lang/nl/lang.php +++ b/resources/lang/nl/lang.php @@ -1378,7 +1378,6 @@ return [ 'post_comment' => 'Plaats reactie', 'plugin' => 'Plugin', 'edit_profile' => 'Bewerk profiel', - 'you_are_here' => 'Je bent hier', 'Send' => 'Verstuur', 'no_article' => 'Geen artikel', 'profile_settings' => 'Profiel instellingen', diff --git a/resources/lang/pt/lang.php b/resources/lang/pt/lang.php index 0b9d29150..e0c0f5b8a 100644 --- a/resources/lang/pt/lang.php +++ b/resources/lang/pt/lang.php @@ -1316,7 +1316,6 @@ return [ 'post_comment' => 'Enviar comentário', 'plugin' => 'Plugin', 'edit_profile' => 'Editar Perfil', - 'you_are_here' => 'Você está aqui', 'Send' => 'ENVIAR', 'no_article' => 'Nenhum artigo', 'profile_settings' => 'Configurações de perfil', diff --git a/resources/lang/ru/lang.php b/resources/lang/ru/lang.php index 17c4541e7..293134029 100644 --- a/resources/lang/ru/lang.php +++ b/resources/lang/ru/lang.php @@ -830,7 +830,6 @@ return [ /* Translation reuired */ /*****************************************************************************************/ 'edit_profile' => 'Edit profile', - 'you_are_here' => 'You are here', 'Send' => 'SEND', 'no_article' => 'No article', 'profile_settings' => 'Profile settings', From 5d51afd360fa2f8c3f0c0c941c387277932b3bff Mon Sep 17 00:00:00 2001 From: Luca Volpones Date: Tue, 7 Nov 2017 19:08:48 +0100 Subject: [PATCH 21/46] Fix #3 --- resources/lang/de/lang.php | 3 +-- resources/lang/en/lang.php | 1 - resources/lang/fr/lang.php | 1 - resources/lang/it/lang.php | 1 - resources/lang/nl/lang.php | 1 - resources/lang/pt/lang.php | 1 - resources/lang/ru/lang.php | 1 - 7 files changed, 1 insertion(+), 8 deletions(-) diff --git a/resources/lang/de/lang.php b/resources/lang/de/lang.php index b5f709973..7ba032e3d 100644 --- a/resources/lang/de/lang.php +++ b/resources/lang/de/lang.php @@ -28,7 +28,7 @@ return [ |-------------------------------------- */ 'Login_to_start_your_session' => 'Einloggen um Ihre Sitzung zu starten', - 'login' => 'Login', + 'login' => 'Anmeldung', 'remember' => 'Erinnere dich an mich', 'signmein' => 'Melde mich an', 'iforgot' => 'Ich habe mein Passwort vergessen', @@ -36,7 +36,6 @@ return [ 'password' => 'Passwort', 'woops' => 'Whoops!', 'theirisproblem' => 'Es gab einige Probleme mit Ihrer Eingabe.', - 'login' => 'Anmeldung', 'e-mail' => 'E-Mail', 'reg_new_member' => 'Registrieren für eine neue Mitgliedschaft', /* diff --git a/resources/lang/en/lang.php b/resources/lang/en/lang.php index a7cbe124c..0c94c3585 100644 --- a/resources/lang/en/lang.php +++ b/resources/lang/en/lang.php @@ -51,7 +51,6 @@ return [ 'password_confirmation' => 'Password confirmation', 'woops' => 'Whoops!', 'theirisproblem' => 'There were some problems with your input.', - 'login' => 'Login', 'e-mail' => 'Email', 'reg_new_member' => 'Register a new membership', 'this_account_is_currently_inactive' => 'This account is currently inactive!', diff --git a/resources/lang/fr/lang.php b/resources/lang/fr/lang.php index bcf2a27f1..45d0bddbd 100644 --- a/resources/lang/fr/lang.php +++ b/resources/lang/fr/lang.php @@ -44,7 +44,6 @@ return [ 'password' => 'Mot de passe', 'woops' => 'Oups!', 'theirisproblem' => 'Il y a eu un problème avec ce que vous avez saisi', - 'login' => 'Connexion', 'e-mail' => 'E-mail', 'reg_new_member' => 'Inscrivez-vous', 'this_account_is_currently_inactive' => 'Ce compte est actuellement inactif!', diff --git a/resources/lang/it/lang.php b/resources/lang/it/lang.php index 4cba37743..ac92e646a 100644 --- a/resources/lang/it/lang.php +++ b/resources/lang/it/lang.php @@ -37,7 +37,6 @@ return [ 'password' => 'Password', 'woops' => 'Whoops!', 'theirisproblem' => 'Ci sono problemi con ciò che hai inserito.', - 'login' => 'Login', 'e-mail' => 'E-mail', 'reg_new_member' => 'Registra una nuova associazione', /* diff --git a/resources/lang/nl/lang.php b/resources/lang/nl/lang.php index 2afe15a2c..f4466ea93 100644 --- a/resources/lang/nl/lang.php +++ b/resources/lang/nl/lang.php @@ -64,7 +64,6 @@ return [ 'password' => 'Wachtwoord', 'woops' => 'Oeps!!', 'theirisproblem' => 'Er is een probleem met je invoer.', - 'login' => 'Login', 'e-mail' => 'E-mailadres', 'reg_new_member' => 'Registreren', 'this_account_is_currently_inactive' => 'Dit account is niet actief!', diff --git a/resources/lang/pt/lang.php b/resources/lang/pt/lang.php index e0c0f5b8a..4ceece5be 100644 --- a/resources/lang/pt/lang.php +++ b/resources/lang/pt/lang.php @@ -57,7 +57,6 @@ return [ 'password' => 'Senha', 'woops' => 'Whoops!', 'theirisproblem' => 'Ocorreu um erro durante o login.', - 'login' => 'Login', 'e-mail' => 'E-mail', 'reg_new_member' => 'Registrar uma nova associação.', 'this_account_is_currently_inactive' => 'Essa conta está inativa!', diff --git a/resources/lang/ru/lang.php b/resources/lang/ru/lang.php index 293134029..542d90c27 100644 --- a/resources/lang/ru/lang.php +++ b/resources/lang/ru/lang.php @@ -34,7 +34,6 @@ return [ 'password' => 'Пароль', 'woops' => 'Whoops!', 'theirisproblem' => 'There were some problems with your input.', - 'login' => 'Login', 'e-mail' => 'E-mail', 'reg_new_member' => 'Register a new membership', /* From 87fe77898d0f84cf5b5b69b344ea9530bd5ed49b Mon Sep 17 00:00:00 2001 From: Luca Volpones Date: Wed, 8 Nov 2017 09:18:40 +0100 Subject: [PATCH 22/46] #3 Improve it/lang.php --- resources/lang/it/lang.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/resources/lang/it/lang.php b/resources/lang/it/lang.php index a7aa73e87..e45314e18 100644 --- a/resources/lang/it/lang.php +++ b/resources/lang/it/lang.php @@ -162,7 +162,7 @@ return [ | Diagnostics Page |-------------------------------------- */ - 'diagnostics' => 'Diagnostici', + 'diagnostics' => 'Diagnostica', 'from' => 'Da', 'to' => 'A', 'subject' => 'Soggetto', @@ -184,7 +184,7 @@ return [ | Company Settings Page |-------------------------------------- */ - 'company' => 'Compagnia', + 'company' => 'Azienda', 'website' => 'Sito Web', 'phone' => 'Telefono', 'address' => 'Indirizzo', @@ -225,6 +225,7 @@ return [ |-------------------------------------- */ 'email' => 'Email', + 'email-settings' => 'Impostazioni Email', 'default_template' => 'Template Set di Default:', 'default_system_email' => 'Sistema Email di Default:', 'default_alert_email' => 'Allerta Email di Default:', @@ -826,7 +827,7 @@ return [ 'sidewidget1' => 'Side Widget 1', 'sidewidget2' => 'Side Widget 2', 'comments' => 'Commenti', - 'settings' => 'Settaggi', + 'settings' => 'Impostazioni', 'parent' => 'Padre', 'description' => 'Descrizione', 'enter_the_description' => 'Inserisci la Descrizione', @@ -952,8 +953,8 @@ return [ * Latest update 27-07-2016 * ----------------------------------------------------------------------------------- */ - 'queue' => 'Queue', - 'queues' => 'Queues', + 'queue' => 'Coda', + 'queues' => 'Code', /* * ------------------------------------------------------------------------------------------------- * OTP messages body to send to user while registering, resetting passwords * -------------------------------------------------------------------------------------------------- From 6fc492bb555fca8a34579eb24c170bbcef24ebd5 Mon Sep 17 00:00:00 2001 From: Luca Volpones Date: Wed, 8 Nov 2017 17:47:36 +0100 Subject: [PATCH 23/46] #4 Improve it/lang.php --- resources/lang/it/lang.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/resources/lang/it/lang.php b/resources/lang/it/lang.php index e45314e18..4f44c7691 100644 --- a/resources/lang/it/lang.php +++ b/resources/lang/it/lang.php @@ -487,7 +487,7 @@ return [ 'staffs' => 'Staffs', 'name' => 'Nome', 'user_name' => 'Nome Utente', - 'status' => 'Status', + 'status' => 'Stato', 'group' => 'Gruppo', 'department' => 'Dipartimento', 'created' => 'Creato', @@ -496,7 +496,7 @@ return [ 'delete' => 'Cancella', 'agents' => 'Agenti', 'create' => 'Crea', - 'edit' => 'modifica', + 'edit' => 'Modifica', 'departments' => 'Dipartimenti', 'groups' => 'Gruppi', /* @@ -509,7 +509,7 @@ return [ 'last_name' => 'Cognome', 'mobile_number' => 'Numero Mobile', 'agent_signature' => 'Firma Agente', - 'account_status_setting' => 'Status Account & Settaggi', + 'account_status_setting' => 'Stato & Impostazioni Account', 'account_type' => 'Tipo Account', 'admin' => 'Admin', 'agent' => 'Agente', @@ -517,12 +517,14 @@ return [ 'locked' => 'Bloccato', 'assigned_group' => 'Gruppo Assegnato', 'primary_department' => 'Dipartimento Principale', - 'agent_time_zone' => 'Agent Time Zone', + 'agent_time_zone' => 'Fuso orario', 'day_light_saving' => 'Day Light Saving', 'limit_access' => 'Limita Accesso', 'directory_listing' => 'Directory Listing', 'vocation_mode' => 'Vocation Mode', 'assigned_team' => 'Team Assegnato', + 'list_of_agents' => 'Elenco agenti', + 'create_an_agent' => 'Crea un agente', /* |-------------------------------------- | Department Create Page @@ -573,6 +575,7 @@ return [ 'admin_notes' => 'Note Admin', 'group_members' => 'Componenti del Gruppo', 'group_name' => 'Nome Gruppo', + 'select_a_group' => 'Seleziona un gruppo', /* |-------------------------------------- | SMTP Page From 954b5d6a9a29739621c9e7ff820f6931e72519b1 Mon Sep 17 00:00:00 2001 From: Luca Volpones Date: Wed, 8 Nov 2017 17:50:11 +0100 Subject: [PATCH 24/46] Fix #4 --- resources/lang/en/lang.php | 1 - resources/lang/fr/lang.php | 1 - resources/lang/nl/lang.php | 1 - resources/lang/pt/lang.php | 1 - 4 files changed, 4 deletions(-) diff --git a/resources/lang/en/lang.php b/resources/lang/en/lang.php index 0c94c3585..06f7d0fb3 100644 --- a/resources/lang/en/lang.php +++ b/resources/lang/en/lang.php @@ -827,7 +827,6 @@ return [ 'the_associated_helptopic_has_been_deactivated' => 'The associated helptopic has been deactivated', 'department_deleted_sucessfully' => 'Department deleted successfully', 'department_can_not_delete' => 'Department can not be deleted', - 'select_a_department' => 'Select a department', 'make-default-department' => 'Make system\'s default department', /* |-------------------------------------- diff --git a/resources/lang/fr/lang.php b/resources/lang/fr/lang.php index 45d0bddbd..cb2709695 100644 --- a/resources/lang/fr/lang.php +++ b/resources/lang/fr/lang.php @@ -789,7 +789,6 @@ return [ 'the_associated_helptopic_has_been_deactivated' => 'La branche de support associée a été désactivée', 'department_deleted_sucessfully' => 'Département supprimé avec succès', 'department_can_not_delete' => 'Le département ne peut pas être supprimé', - 'select_a_department' => 'Sélectionner un département', 'make-default-department' => 'Marquer comme département par défaut du système', /* |-------------------------------------- diff --git a/resources/lang/nl/lang.php b/resources/lang/nl/lang.php index f4466ea93..78f50247e 100644 --- a/resources/lang/nl/lang.php +++ b/resources/lang/nl/lang.php @@ -852,7 +852,6 @@ return [ 'the_associated_helptopic_has_been_deactivated' => 'Het gerelateerde help-onderwerp is uitgeschakeld', 'department_deleted_sucessfully' => 'Afdeling succesvol verwijderd', 'department_can_not_delete' => 'Afdeling kan niet verwijderd worden', - 'select_a_department' => 'Selecteer een afdeling', 'make-default-department' => 'Maak hier de standaard afdeling van', /* |-------------------------------------- diff --git a/resources/lang/pt/lang.php b/resources/lang/pt/lang.php index 4ceece5be..6660b2f70 100644 --- a/resources/lang/pt/lang.php +++ b/resources/lang/pt/lang.php @@ -788,7 +788,6 @@ return [ 'the_associated_helptopic_has_been_deactivated' => 'O tópico de ajuda associado foi desativado', 'department_deleted_sucessfully' => 'Departamento deletado com sucesso', 'department_can_not_delete' => 'Departamento não pode ser deletado', - 'select_a_department' => 'Selecione um departamento', 'make-default-department' => 'Criar departamento padrão', /* |-------------------------------------- From f736fc20e5c8a5a94e7001a39445b3939a36920b Mon Sep 17 00:00:00 2001 From: Luca Volpones Date: Wed, 8 Nov 2017 17:54:46 +0100 Subject: [PATCH 25/46] #5 --- resources/lang/it/lang.php | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/lang/it/lang.php b/resources/lang/it/lang.php index 4f44c7691..d441fdd67 100644 --- a/resources/lang/it/lang.php +++ b/resources/lang/it/lang.php @@ -392,6 +392,7 @@ return [ 'system_default' => 'Default di Sistema', 'custom' => 'Personalizzato', 'internal_notes' => 'Note Interne', + 'select_a_department' => 'Seleziona un dipartimento', /* |-------------------------------------- | SLA plan Index Page From 36bcf0af30e7f5c070973723634ccb6390d186c6 Mon Sep 17 00:00:00 2001 From: Luca Volpones Date: Wed, 8 Nov 2017 17:56:11 +0100 Subject: [PATCH 26/46] Fix #5 --- resources/lang/en/lang.php | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/lang/en/lang.php b/resources/lang/en/lang.php index 06f7d0fb3..df908fa82 100644 --- a/resources/lang/en/lang.php +++ b/resources/lang/en/lang.php @@ -756,7 +756,6 @@ return [ 'edit' => 'Edit', 'departments' => 'Departments', 'groups' => 'Groups', - 'select_a_time_zone' => 'Select a time zone', 'time_zones' => 'Time zones', /* |-------------------------------------- From e6cc1bd11f169c98a82e5ddc1a3223f2cb802f53 Mon Sep 17 00:00:00 2001 From: Luca Volpones Date: Wed, 8 Nov 2017 19:06:27 +0100 Subject: [PATCH 27/46] #6 Improve it/lang.php --- resources/lang/it/lang.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/lang/it/lang.php b/resources/lang/it/lang.php index d441fdd67..a32f0ea2d 100644 --- a/resources/lang/it/lang.php +++ b/resources/lang/it/lang.php @@ -214,6 +214,7 @@ return [ 'date_time' => 'Formato Data e Ora', 'day_date_time' => 'Formato Giorno,Data e Ora', 'timezone' => 'Fuso orario di default', + 'select_a_time_zone' => 'Seleziona un fuso orario', 'api' => 'Api', 'api_key' => 'Chiave Api', 'api_key_mandatory' => 'Chiave Api obbligatoria', @@ -500,6 +501,7 @@ return [ 'edit' => 'Modifica', 'departments' => 'Dipartimenti', 'groups' => 'Gruppi', + 'time_zones' => 'Fusi orari', /* |-------------------------------------- | Staff Create Page @@ -544,6 +546,7 @@ return [ 'recipient' => 'Recipient', 'group_access' => 'Accesso Gruppo', 'department_signature' => 'Firma Dipartimento', + 'list_of_departments' => 'Elenco dipartimenti', /* |-------------------------------------- | Team Create Page @@ -554,6 +557,7 @@ return [ 'assignment_alert' => 'Allerta Assegnamento', 'disable_for_this_team' => 'Disattiva per questo team', 'teams' => 'Teams', + 'list_of_teams' => 'Elenco teams', /* |-------------------------------------- | Group Create Page @@ -801,6 +805,7 @@ return [ 'gender' => 'Genere', 'ticket_number' => 'Numero di Ticket', 'content' => 'Contenuto', + 'show' => 'Visualizza', /* |------------------------------------------------ | Error Pages From 5749ef2691d10261a62494aaedb6486eb05a1ca6 Mon Sep 17 00:00:00 2001 From: Luca Volpones Date: Wed, 8 Nov 2017 19:12:42 +0100 Subject: [PATCH 28/46] Suggested improvements to labels and translations --- resources/lang/en/lang.php | 1 + resources/lang/it/lang.php | 1 + .../default1/admin/helpdesk/agent/agents/index.blade.php | 6 +++--- .../default1/admin/helpdesk/agent/groups/index.blade.php | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/resources/lang/en/lang.php b/resources/lang/en/lang.php index e576f8265..aff6f594d 100644 --- a/resources/lang/en/lang.php +++ b/resources/lang/en/lang.php @@ -886,6 +886,7 @@ return [ 'group_deleted_successfully' => 'Group deleted successfully', 'group_cannot_delete' => 'Group cannot delete', 'failed_to_load_the_page' => 'Failed to load the page', + 'list_of_groups' => 'List of groups', /* |-------------------------------------- | SMTP Page diff --git a/resources/lang/it/lang.php b/resources/lang/it/lang.php index 087f45769..b9deff7c8 100644 --- a/resources/lang/it/lang.php +++ b/resources/lang/it/lang.php @@ -572,6 +572,7 @@ return [ 'admin_notes' => 'Note Admin', 'group_members' => 'Componenti del Gruppo', 'group_name' => 'Nome Gruppo', + 'list_of_groups' => 'Elenco gruppi', /* |-------------------------------------- | SMTP Page diff --git a/resources/views/themes/default1/admin/helpdesk/agent/agents/index.blade.php b/resources/views/themes/default1/admin/helpdesk/agent/agents/index.blade.php index 50a10b3bd..b2deec39a 100644 --- a/resources/views/themes/default1/admin/helpdesk/agent/agents/index.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/agent/agents/index.blade.php @@ -16,7 +16,7 @@ class="active" @stop @section('PageHeader') -

    {{ Lang::get('lang.staffs')}}

    +

    {{ Lang::get('lang.agents')}}

    @stop @@ -40,7 +40,7 @@ class="active"
    - {{Session::get('success')}} + {{Session::get('success')}}
    @endif @@ -116,4 +116,4 @@ class="active"
    -@stop \ No newline at end of file +@stop diff --git a/resources/views/themes/default1/admin/helpdesk/agent/groups/index.blade.php b/resources/views/themes/default1/admin/helpdesk/agent/groups/index.blade.php index 6734ede3b..94802437a 100644 --- a/resources/views/themes/default1/admin/helpdesk/agent/groups/index.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/agent/groups/index.blade.php @@ -16,7 +16,7 @@ class="active" @stop @section('PageHeader') -

    {{Lang::get('lang.staffs')}}

    +

    {{Lang::get('lang.groups')}}

    @stop @@ -31,7 +31,7 @@ class="active"
    -

    {!! Lang::get('lang.groups') !!}

     {{Lang::get('lang.create_group')}}
    +

    {!! Lang::get('lang.list_of_groups') !!}

     {{Lang::get('lang.create_group')}}
    @if(Session::has('success')) @@ -84,4 +84,4 @@ class="active"
    -@stop \ No newline at end of file +@stop From 3bf81b18daaa6ecd70a0bca022e09777493e3970 Mon Sep 17 00:00:00 2001 From: Luca Volpones Date: Wed, 8 Nov 2017 19:23:00 +0100 Subject: [PATCH 29/46] Single use of duplicated translation --- app/Http/breadcrumbs.php | 2 +- resources/lang/de/lang.php | 1 - resources/lang/en/lang.php | 1 - resources/lang/fr/lang.php | 1 - resources/lang/it/lang.php | 1 - resources/lang/nl/lang.php | 1 - resources/lang/pt/lang.php | 1 - resources/lang/ru/lang.php | 1 - 8 files changed, 1 insertion(+), 8 deletions(-) diff --git a/app/Http/breadcrumbs.php b/app/Http/breadcrumbs.php index cef4a36c6..12ccac9fd 100644 --- a/app/Http/breadcrumbs.php +++ b/app/Http/breadcrumbs.php @@ -82,7 +82,7 @@ Breadcrumbs::register('emails.edit', function ($breadcrumbs) { Breadcrumbs::register('banlist.index', function ($breadcrumbs) { $breadcrumbs->parent('setting'); - $breadcrumbs->push(Lang::get('lang.banlists'), route('banlist.index')); + $breadcrumbs->push(Lang::get('lang.ban_lists'), route('banlist.index')); }); Breadcrumbs::register('banlist.create', function ($breadcrumbs) { $breadcrumbs->parent('banlist.index'); diff --git a/resources/lang/de/lang.php b/resources/lang/de/lang.php index dba6d0849..abb0820e0 100644 --- a/resources/lang/de/lang.php +++ b/resources/lang/de/lang.php @@ -124,7 +124,6 @@ return [ */ 'ban_lists' => 'Ban Lists', 'ban_email' => 'Ban Email', - 'banlists' => 'Ban lists', 'ban_status' => 'Ban Status', /* |-------------------------------------- diff --git a/resources/lang/en/lang.php b/resources/lang/en/lang.php index aff6f594d..676ce07e3 100644 --- a/resources/lang/en/lang.php +++ b/resources/lang/en/lang.php @@ -171,7 +171,6 @@ return [ */ 'ban_lists' => 'Ban lists', 'ban_email' => 'Ban email', - 'banlists' => 'Ban lists', 'ban_status' => 'Ban status', 'list_of_banned_emails' => 'List of banned emails', 'edit_banned_email' => 'Edit banned email', diff --git a/resources/lang/fr/lang.php b/resources/lang/fr/lang.php index e8656a327..eaa772616 100644 --- a/resources/lang/fr/lang.php +++ b/resources/lang/fr/lang.php @@ -149,7 +149,6 @@ return [ */ 'ban_lists' => 'Ban lists', 'ban_email' => 'Ban email', - 'banlists' => 'Ban lists', 'ban_status' => 'Ban status', 'list_of_banned_emails' => 'List of banned emails', 'edit_banned_email' => 'Edit banned email', diff --git a/resources/lang/it/lang.php b/resources/lang/it/lang.php index b9deff7c8..3a4d3f308 100644 --- a/resources/lang/it/lang.php +++ b/resources/lang/it/lang.php @@ -125,7 +125,6 @@ return [ */ 'ban_lists' => 'Lista Ban', 'ban_email' => 'Email Ban', - 'banlists' => 'Liste Ban', 'ban_status' => 'Status Ban', /* |-------------------------------------- diff --git a/resources/lang/nl/lang.php b/resources/lang/nl/lang.php index fbf5463fb..86e6c0e74 100644 --- a/resources/lang/nl/lang.php +++ b/resources/lang/nl/lang.php @@ -182,7 +182,6 @@ return [ */ 'ban_lists' => 'Blokkeringslijst', 'ban_email' => 'Blokkeer E-mailadres', - 'banlists' => 'Blokkeringslijst', 'ban_status' => 'Blokkeringsstatus', 'list_of_banned_emails' => 'Lijst van geblokkeerde e-mailadressen', 'edit_banned_email' => 'Bewerk geblokkeerde e-mailadressen', diff --git a/resources/lang/pt/lang.php b/resources/lang/pt/lang.php index 35727ce30..488fdf134 100644 --- a/resources/lang/pt/lang.php +++ b/resources/lang/pt/lang.php @@ -160,7 +160,6 @@ return [ */ 'ban_lists' => 'Lista de bloqueio', 'ban_email' => 'E-mails bloqueados', - 'banlists' => 'Lista de bloqueio', 'ban_status' => 'Status de bloqueio', 'list_of_banned_emails' => 'Lista de E-mails bloqueados', 'edit_banned_email' => 'Editar um bloqueio de E-mails', diff --git a/resources/lang/ru/lang.php b/resources/lang/ru/lang.php index 0fc6c253d..8c101d18c 100644 --- a/resources/lang/ru/lang.php +++ b/resources/lang/ru/lang.php @@ -111,7 +111,6 @@ return [ */ 'ban_lists' => 'Лист запретов', 'ban_email' => 'Запрет Email', - 'banlists' => 'Листы запретов', 'ban_status' => 'Статус запретов', /* |-------------------------------------- From d0fa55e42628a508bf550197d770b2c0c958bbc3 Mon Sep 17 00:00:00 2001 From: Luca Volpones Date: Wed, 8 Nov 2017 19:44:30 +0100 Subject: [PATCH 30/46] Version label --- resources/lang/de/lang.php | 1 + resources/lang/en/lang.php | 1 + resources/lang/fr/lang.php | 1 + resources/lang/it/lang.php | 1 + resources/lang/nl/lang.php | 1 + resources/lang/pt/lang.php | 1 + resources/lang/ru/lang.php | 1 + .../admin/helpdesk/tickets/ticket.blade.php | 4 +- .../admin/helpdesk/tickets/timeline.blade.php | 46 +++++++++---------- .../admin/kb/article/layout.blade.php | 4 +- .../default1/admin/layout/admin.blade.php | 28 +++++------ .../default1/agent/layout/agent.blade.php | 30 ++++++------ .../default1/agent/layout/agentold.blade.php | 38 +++++++-------- .../themes/default1/agent/layout/kb.blade.php | 4 +- .../themes/default1/layouts/admin.blade.php | 14 +++--- .../themes/default1/layouts/agent.blade.php | 4 +- .../themes/default1/layouts/blank.blade.php | 4 +- .../themes/default1/layouts/guest.blade.php | 4 +- .../themes/default1/layouts/kb.blade.php | 4 +- 19 files changed, 99 insertions(+), 92 deletions(-) diff --git a/resources/lang/de/lang.php b/resources/lang/de/lang.php index abb0820e0..159fce87e 100644 --- a/resources/lang/de/lang.php +++ b/resources/lang/de/lang.php @@ -813,6 +813,7 @@ return [ 'copyright' => 'Copyright', 'all_rights_reserved' => 'All right Reserved', 'powered_by' => 'Powered by', + 'version' => 'Version', /* |------------------------------------------------ |Guest-User Page diff --git a/resources/lang/en/lang.php b/resources/lang/en/lang.php index 676ce07e3..27e51af39 100644 --- a/resources/lang/en/lang.php +++ b/resources/lang/en/lang.php @@ -1164,6 +1164,7 @@ return [ 'copyright' => 'Copyright', 'all_rights_reserved' => 'All rights reserved', 'powered_by' => 'Powered by', + 'version' => 'Version', /* |------------------------------------------------ |Guest-User Page diff --git a/resources/lang/fr/lang.php b/resources/lang/fr/lang.php index eaa772616..07036ae58 100644 --- a/resources/lang/fr/lang.php +++ b/resources/lang/fr/lang.php @@ -1125,6 +1125,7 @@ return [ 'copyright' => 'Copyright', 'all_rights_reserved' => 'Tous droits réservés', 'powered_by' => 'Powered by', + 'version' => 'Version', /* |------------------------------------------------ |Guest-User Page diff --git a/resources/lang/it/lang.php b/resources/lang/it/lang.php index 3a4d3f308..69f50a2d5 100644 --- a/resources/lang/it/lang.php +++ b/resources/lang/it/lang.php @@ -126,6 +126,7 @@ return [ 'ban_lists' => 'Lista Ban', 'ban_email' => 'Email Ban', 'ban_status' => 'Status Ban', + 'version' => 'Versione', /* |-------------------------------------- | Templates Index Page diff --git a/resources/lang/nl/lang.php b/resources/lang/nl/lang.php index 86e6c0e74..599fe4960 100644 --- a/resources/lang/nl/lang.php +++ b/resources/lang/nl/lang.php @@ -1186,6 +1186,7 @@ return [ 'copyright' => 'Copyright', 'all_rights_reserved' => 'Alle rechten voorbehouden', 'powered_by' => 'Mogelijk gemaakt door', + 'version' => 'Version', /* |------------------------------------------------ |Guest-User Page diff --git a/resources/lang/pt/lang.php b/resources/lang/pt/lang.php index 488fdf134..c9846454b 100644 --- a/resources/lang/pt/lang.php +++ b/resources/lang/pt/lang.php @@ -1120,6 +1120,7 @@ return [ 'copyright' => 'Copyright', 'all_rights_reserved' => 'Todos os direitos reservados', 'powered_by' => 'Distribuído por', + 'version' => 'Version', /* |------------------------------------------------ |Guest-User Page diff --git a/resources/lang/ru/lang.php b/resources/lang/ru/lang.php index 8c101d18c..2b2dec983 100644 --- a/resources/lang/ru/lang.php +++ b/resources/lang/ru/lang.php @@ -720,6 +720,7 @@ return [ 'copyright' => 'Copyright', 'all_rights_reserved' => 'Все права защищены', 'powered_by' => 'Разработано на', + 'version' => 'Version', /* |------------------------------------------------ |Гостевая-Страница Пользователя diff --git a/resources/views/themes/default1/admin/helpdesk/tickets/ticket.blade.php b/resources/views/themes/default1/admin/helpdesk/tickets/ticket.blade.php index 455c3b7da..e1dcf3a6b 100644 --- a/resources/views/themes/default1/admin/helpdesk/tickets/ticket.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/tickets/ticket.blade.php @@ -366,7 +366,7 @@
    Copyright © 2014-2015 Ladybird Web Solution. All rights reserved.
    @@ -434,4 +434,4 @@ - \ No newline at end of file + diff --git a/resources/views/themes/default1/admin/helpdesk/tickets/timeline.blade.php b/resources/views/themes/default1/admin/helpdesk/tickets/timeline.blade.php index dcb104184..e9e59c663 100644 --- a/resources/views/themes/default1/admin/helpdesk/tickets/timeline.blade.php +++ b/resources/views/themes/default1/admin/helpdesk/tickets/timeline.blade.php @@ -12,7 +12,7 @@ - @@ -22,7 +22,7 @@ - +
    -
    -
    +
    @@ -372,7 +372,7 @@
    -
    +
    @@ -380,13 +380,13 @@
    - +
    - + @@ -416,7 +416,7 @@
    - +
    @@ -456,7 +456,7 @@
    - +
    @@ -583,7 +583,7 @@
    Copyright © 2014-2015 Ladybird Web Solution. All rights reserved.
    diff --git a/resources/views/themes/default1/admin/kb/article/layout.blade.php b/resources/views/themes/default1/admin/kb/article/layout.blade.php index e042d1e74..de5745509 100644 --- a/resources/views/themes/default1/admin/kb/article/layout.blade.php +++ b/resources/views/themes/default1/admin/kb/article/layout.blade.php @@ -197,7 +197,7 @@
    Copyright © {{date("Y")}} {{$settings->company_name}}. Powered By Faveo.
    @@ -232,4 +232,4 @@ - \ No newline at end of file + diff --git a/resources/views/themes/default1/admin/layout/admin.blade.php b/resources/views/themes/default1/admin/layout/admin.blade.php index bf6c51e1e..0e6c0b351 100644 --- a/resources/views/themes/default1/admin/layout/admin.blade.php +++ b/resources/views/themes/default1/admin/layout/admin.blade.php @@ -5,7 +5,7 @@ Faveo | HELP DESK - + @@ -33,9 +33,9 @@ - + - + @@ -246,7 +246,7 @@
  • {!! Lang::get('lang.email-settings') !!}
  • {!! Lang::get('lang.queues') !!}
  • {!! Lang::get('lang.diagnostics') !!}
  • - + @@ -367,7 +367,7 @@