Apply fixes from StyleCI
This commit is contained in:

committed by
RafficMohammed

parent
0975cc5dd9
commit
b3b057e0cc
@@ -3,81 +3,81 @@
|
||||
use App\Http\Controllers\Common;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
/*
|
||||
* ================================================================================================
|
||||
* @version v1
|
||||
* @access public
|
||||
* @copyright (c) 2016, Ladybird web solution
|
||||
* @author Vijay Sebastian<vijay.sebastian@ladybirdweb.com>
|
||||
* @name Faveo
|
||||
*/
|
||||
Route::prefix('api/v1')->group(function () {
|
||||
Route::post('authenticate', [\App\Api\v1\TokenAuthController::class, 'authenticate']);
|
||||
Route::get('authenticate/user', [\App\Api\v1\TokenAuthController::class, 'getAuthenticatedUser']);
|
||||
Route::get('/database-config', [\App\Api\v1\InstallerApiController::class, 'config_database'])->name('database-config');
|
||||
Route::get('/system-config', [\App\Api\v1\InstallerApiController::class, 'config_system'])->name('database-config');
|
||||
/*
|
||||
* ================================================================================================
|
||||
* @version v1
|
||||
* @access public
|
||||
* @copyright (c) 2016, Ladybird web solution
|
||||
* @author Vijay Sebastian<vijay.sebastian@ladybirdweb.com>
|
||||
* @name Faveo
|
||||
* Helpdesk
|
||||
*/
|
||||
Route::prefix('api/v1')->group(function () {
|
||||
Route::post('authenticate', [\App\Api\v1\TokenAuthController::class, 'authenticate']);
|
||||
Route::get('authenticate/user', [\App\Api\v1\TokenAuthController::class, 'getAuthenticatedUser']);
|
||||
Route::get('/database-config', [\App\Api\v1\InstallerApiController::class, 'config_database'])->name('database-config');
|
||||
Route::get('/system-config', [\App\Api\v1\InstallerApiController::class, 'config_system'])->name('database-config');
|
||||
Route::prefix('helpdesk')->group(function () {
|
||||
Route::post('create', [\App\Api\v1\ApiController::class, 'createTicket']);
|
||||
Route::post('reply', [\App\Api\v1\ApiController::class, 'ticketReply']);
|
||||
Route::post('edit', [\App\Api\v1\ApiController::class, 'editTicket']);
|
||||
Route::post('delete', [\App\Api\v1\ApiController::class, 'deleteTicket']);
|
||||
Route::post('assign', [\App\Api\v1\ApiController::class, 'assignTicket']);
|
||||
Route::get('open', [\App\Api\v1\ApiController::class, 'openedTickets']);
|
||||
Route::get('unassigned', [\App\Api\v1\ApiController::class, 'unassignedTickets']);
|
||||
Route::get('closed', [\App\Api\v1\ApiController::class, 'closeTickets']);
|
||||
Route::get('agents', [\App\Api\v1\ApiController::class, 'getAgents']);
|
||||
Route::get('teams', [\App\Api\v1\ApiController::class, 'getTeams']);
|
||||
Route::get('customers', [\App\Api\v1\ApiController::class, 'getCustomers']);
|
||||
Route::get('customer', [\App\Api\v1\ApiController::class, 'getCustomer']);
|
||||
Route::get('ticket-search', [\App\Api\v1\ApiController::class, 'searchTicket']);
|
||||
Route::get('ticket-thread', [\App\Api\v1\ApiController::class, 'ticketThreads']);
|
||||
Route::get('url', [\App\Api\v1\ApiExceptAuthController::class, 'checkUrl']);
|
||||
Route::get('check-url', [\App\Api\v1\ApiExceptAuthController::class, 'urlResult']);
|
||||
Route::get('api_key', [\App\Api\v1\ApiController::class, 'generateApiKey']);
|
||||
Route::get('help-topic', [\App\Api\v1\ApiController::class, 'getHelpTopic']);
|
||||
Route::get('sla-plan', [\App\Api\v1\ApiController::class, 'getSlaPlan']);
|
||||
Route::get('priority', [\App\Api\v1\ApiController::class, 'getPriority']);
|
||||
Route::get('department', [\App\Api\v1\ApiController::class, 'getDepartment']);
|
||||
Route::get('tickets', [\App\Api\v1\ApiController::class, 'getTickets']);
|
||||
Route::get('ticket', [\App\Api\v1\ApiController::class, 'getTicketById']);
|
||||
Route::get('inbox', [\App\Api\v1\ApiController::class, 'inbox']);
|
||||
Route::get('trash', [\App\Api\v1\ApiController::class, 'getTrash']);
|
||||
Route::get('my-tickets-agent', [\App\Api\v1\ApiController::class, 'getMyTicketsAgent']);
|
||||
Route::post('internal-note', [\App\Api\v1\ApiController::class, 'internalNote']);
|
||||
/*
|
||||
* Helpdesk
|
||||
* Newly added
|
||||
*/
|
||||
Route::prefix('helpdesk')->group(function () {
|
||||
Route::post('create', [\App\Api\v1\ApiController::class, 'createTicket']);
|
||||
Route::post('reply', [\App\Api\v1\ApiController::class, 'ticketReply']);
|
||||
Route::post('edit', [\App\Api\v1\ApiController::class, 'editTicket']);
|
||||
Route::post('delete', [\App\Api\v1\ApiController::class, 'deleteTicket']);
|
||||
Route::post('assign', [\App\Api\v1\ApiController::class, 'assignTicket']);
|
||||
Route::get('open', [\App\Api\v1\ApiController::class, 'openedTickets']);
|
||||
Route::get('unassigned', [\App\Api\v1\ApiController::class, 'unassignedTickets']);
|
||||
Route::get('closed', [\App\Api\v1\ApiController::class, 'closeTickets']);
|
||||
Route::get('agents', [\App\Api\v1\ApiController::class, 'getAgents']);
|
||||
Route::get('teams', [\App\Api\v1\ApiController::class, 'getTeams']);
|
||||
Route::get('customers', [\App\Api\v1\ApiController::class, 'getCustomers']);
|
||||
Route::get('customer', [\App\Api\v1\ApiController::class, 'getCustomer']);
|
||||
Route::get('ticket-search', [\App\Api\v1\ApiController::class, 'searchTicket']);
|
||||
Route::get('ticket-thread', [\App\Api\v1\ApiController::class, 'ticketThreads']);
|
||||
Route::get('url', [\App\Api\v1\ApiExceptAuthController::class, 'checkUrl']);
|
||||
Route::get('check-url', [\App\Api\v1\ApiExceptAuthController::class, 'urlResult']);
|
||||
Route::get('api_key', [\App\Api\v1\ApiController::class, 'generateApiKey']);
|
||||
Route::get('help-topic', [\App\Api\v1\ApiController::class, 'getHelpTopic']);
|
||||
Route::get('sla-plan', [\App\Api\v1\ApiController::class, 'getSlaPlan']);
|
||||
Route::get('priority', [\App\Api\v1\ApiController::class, 'getPriority']);
|
||||
Route::get('department', [\App\Api\v1\ApiController::class, 'getDepartment']);
|
||||
Route::get('tickets', [\App\Api\v1\ApiController::class, 'getTickets']);
|
||||
Route::get('ticket', [\App\Api\v1\ApiController::class, 'getTicketById']);
|
||||
Route::get('inbox', [\App\Api\v1\ApiController::class, 'inbox']);
|
||||
Route::get('trash', [\App\Api\v1\ApiController::class, 'getTrash']);
|
||||
Route::get('my-tickets-agent', [\App\Api\v1\ApiController::class, 'getMyTicketsAgent']);
|
||||
Route::post('internal-note', [\App\Api\v1\ApiController::class, 'internalNote']);
|
||||
/*
|
||||
* Newly added
|
||||
*/
|
||||
Route::get('customers-custom', [\App\Api\v1\ApiController::class, 'getCustomersWith']);
|
||||
Route::get('collaborator/search', [\App\Api\v1\ApiController::class, 'collaboratorSearch']);
|
||||
Route::post('collaborator/create', [\App\Api\v1\ApiController::class, 'addCollaboratorForTicket']);
|
||||
Route::post('collaborator/remove', [\App\Api\v1\ApiController::class, 'deleteCollaborator']);
|
||||
Route::post('collaborator/get-ticket', [\App\Api\v1\ApiController::class, 'getCollaboratorForTicket']);
|
||||
Route::get('my-tickets-user', [\App\Api\v1\ApiController::class, 'getMyTicketsUser']);
|
||||
Route::get('dependency', [\App\Api\v1\ApiController::class, 'dependency']);
|
||||
Route::post('register', [\App\Api\v1\ApiController::class, 'createUser']);
|
||||
});
|
||||
Route::get('customers-custom', [\App\Api\v1\ApiController::class, 'getCustomersWith']);
|
||||
Route::get('collaborator/search', [\App\Api\v1\ApiController::class, 'collaboratorSearch']);
|
||||
Route::post('collaborator/create', [\App\Api\v1\ApiController::class, 'addCollaboratorForTicket']);
|
||||
Route::post('collaborator/remove', [\App\Api\v1\ApiController::class, 'deleteCollaborator']);
|
||||
Route::post('collaborator/get-ticket', [\App\Api\v1\ApiController::class, 'getCollaboratorForTicket']);
|
||||
Route::get('my-tickets-user', [\App\Api\v1\ApiController::class, 'getMyTicketsUser']);
|
||||
Route::get('dependency', [\App\Api\v1\ApiController::class, 'dependency']);
|
||||
Route::post('register', [\App\Api\v1\ApiController::class, 'createUser']);
|
||||
});
|
||||
|
||||
/*
|
||||
* FCM token response
|
||||
*/
|
||||
Route::post('fcmtoken', [Common\PushNotificationController::class, 'fcmToken'])->name('fcmtoken');
|
||||
});
|
||||
/*
|
||||
* ================================================================================================
|
||||
* @version v1
|
||||
* @access public
|
||||
* @copyright (c) 2016, Ladybird web solution
|
||||
* @author Manish Verma<manish.verma@ladybirdweb.com>
|
||||
* @name Faveo
|
||||
* FCM token response
|
||||
*/
|
||||
Route::prefix('api/v2')->group(function () {
|
||||
/*
|
||||
* Helpdesk
|
||||
*/
|
||||
Route::prefix('helpdesk')->group(function () {
|
||||
Route::get('tickets', [\App\Api\v2\TicketController::class, 'getTickets']);
|
||||
});
|
||||
Route::post('fcmtoken', [Common\PushNotificationController::class, 'fcmToken'])->name('fcmtoken');
|
||||
});
|
||||
/*
|
||||
* ================================================================================================
|
||||
* @version v1
|
||||
* @access public
|
||||
* @copyright (c) 2016, Ladybird web solution
|
||||
* @author Manish Verma<manish.verma@ladybirdweb.com>
|
||||
* @name Faveo
|
||||
*/
|
||||
Route::prefix('api/v2')->group(function () {
|
||||
/*
|
||||
* Helpdesk
|
||||
*/
|
||||
Route::prefix('helpdesk')->group(function () {
|
||||
Route::get('tickets', [\App\Api\v2\TicketController::class, 'getTickets']);
|
||||
});
|
||||
});
|
||||
|
@@ -32,6 +32,7 @@ use Illuminate\Support\Str;
|
||||
*
|
||||
* @author Vijay Sebastian <vijay.sebastian@ladybirdweb.com>
|
||||
* @copyright (c) 2016, Ladybird Web Solution
|
||||
*
|
||||
* @name Faveo HELPDESK
|
||||
*
|
||||
* @version v1
|
||||
|
@@ -26,6 +26,7 @@ use Mail;
|
||||
*
|
||||
* @author Vijay Sebastian <vijay.sebastian@ladybirdweb.com>
|
||||
* @copyright (c) 2016, Ladybird Web Solution
|
||||
*
|
||||
* @name Faveo HELPDESK
|
||||
*
|
||||
* @version v1
|
||||
|
@@ -19,6 +19,7 @@ use Tymon\JWTAuth\Exceptions\JWTException;
|
||||
*
|
||||
* @author Vijay Sebastian <vijay.sebastian@ladybirdweb.com>
|
||||
* @copyright (c) 2016, Ladybird Web Solution
|
||||
*
|
||||
* @name Faveo HELPDESK
|
||||
*
|
||||
* @version v1
|
||||
|
@@ -70,7 +70,7 @@ class SecureFaveoAPPKey extends Command
|
||||
}
|
||||
$this->line("\r\nAPP_KEY has been updated in the environment.");
|
||||
$this->line("\r\nNext you might want to check if your configured email is working fine or not. If it has any problem you can update the password and restart your queue workers if you are processing mail jobs in queue.\r\n");
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
$this->info('Alright, calm down we did not make any changes to your environment. But if you think your APP_KEY was compromised or you were using Faveo without generating APP_KEY explicitly(for version v1.10.* or older) we recommend you to run this command on priority basis.');
|
||||
}
|
||||
|
@@ -29,6 +29,7 @@ class Sync extends Command
|
||||
public function handle()
|
||||
{
|
||||
(new SyncFaveoToLatestVersion())->sync();
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ class Kernel extends ConsoleKernel
|
||||
\App\Console\Commands\InstallDB::class,
|
||||
\App\Console\Commands\SetupTestEnv::class,
|
||||
\App\Console\Commands\SecureFaveoAPPKey::class,
|
||||
SyncFaveoToLatestVersion::class
|
||||
SyncFaveoToLatestVersion::class,
|
||||
];
|
||||
|
||||
/**
|
||||
|
@@ -9,7 +9,6 @@ use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Illuminate\Session\TokenMismatchException;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
|
||||
|
@@ -3,7 +3,6 @@
|
||||
namespace App\Exports;
|
||||
|
||||
use Maatwebsite\Excel\Concerns\FromArray;
|
||||
use Maatwebsite\Excel\Concerns\FromCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadings;
|
||||
|
||||
class UserExport implements FromArray, WithHeadings
|
||||
|
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
use App\Http\Controllers\App;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Breadcrumbs::register('logs', function ($breadcrumbs) {
|
||||
|
@@ -116,25 +116,25 @@ class Finder
|
||||
public static function rolesGroup($id)
|
||||
{
|
||||
switch ($id) {
|
||||
case null:
|
||||
return \Lang::get('lang.none');
|
||||
case 1:
|
||||
return 'Client';
|
||||
case 2:
|
||||
return 'Agent';
|
||||
case 4:
|
||||
return 'Admin';
|
||||
case 3:
|
||||
return 'Client,Agent';
|
||||
case 5:
|
||||
return 'Client,Admin';
|
||||
case 6:
|
||||
return 'Agent,Admin';
|
||||
case 7:
|
||||
return 'Client,Agent,Admin';
|
||||
default:
|
||||
return 'Undefined!';
|
||||
}
|
||||
case null:
|
||||
return \Lang::get('lang.none');
|
||||
case 1:
|
||||
return 'Client';
|
||||
case 2:
|
||||
return 'Agent';
|
||||
case 4:
|
||||
return 'Admin';
|
||||
case 3:
|
||||
return 'Client,Agent';
|
||||
case 5:
|
||||
return 'Client,Admin';
|
||||
case 6:
|
||||
return 'Agent,Admin';
|
||||
case 7:
|
||||
return 'Client,Agent,Admin';
|
||||
default:
|
||||
return 'Undefined!';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -149,15 +149,12 @@ class LanguageController extends Controller
|
||||
// doing the validation, passing post data, rules and the messages
|
||||
$validator = Validator::make($file, $rules);
|
||||
if ($validator->fails()) {
|
||||
|
||||
// send back to the page with the input data and errors
|
||||
return Redirect::back()->withInput()->withErrors($validator);
|
||||
} else {
|
||||
|
||||
//Checking if package already exists or not in lang folder
|
||||
$path = base_path('lang');
|
||||
if (in_array(strtolower(Request::get('iso-code')), scandir($path))) {
|
||||
|
||||
//sending back with error message
|
||||
Session::flash('fails', Lang::get('lang.package_exist'));
|
||||
Session::flash('link', 'change-language/'.strtolower(Request::get('iso-code')));
|
||||
@@ -169,7 +166,6 @@ class LanguageController extends Controller
|
||||
|
||||
return Redirect::back()->withInput();
|
||||
} else {
|
||||
|
||||
// checking file is valid.
|
||||
if (Request::file('File')->isValid()) {
|
||||
$name = Request::file('File')->getClientOriginalName(); //uploaded file's original name
|
||||
|
@@ -159,7 +159,7 @@ class PriorityController extends Controller
|
||||
->update(['is_default' => 1]);
|
||||
}
|
||||
|
||||
return \Redirect::route('priority.index')->with('success', (Lang::get('lang.priority_successfully_updated')));
|
||||
return \Redirect::route('priority.index')->with('success', Lang::get('lang.priority_successfully_updated'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,6 +187,6 @@ class PriorityController extends Controller
|
||||
|
||||
$tk_priority->delete();
|
||||
|
||||
return \Redirect::route('priority.index')->with('success', (Lang::get('lang.delete_successfully')));
|
||||
return \Redirect::route('priority.index')->with('success', Lang::get('lang.delete_successfully'));
|
||||
}
|
||||
}
|
||||
|
@@ -318,7 +318,7 @@ class FilterController extends Controller
|
||||
return $table;
|
||||
break;
|
||||
|
||||
// case 'show-overdue':
|
||||
// case 'show-overdue':
|
||||
// $table = $this->filterByDate('overdue', $value, $table);
|
||||
// return $table;
|
||||
// break;
|
||||
@@ -610,7 +610,7 @@ class FilterController extends Controller
|
||||
|
||||
return $table;
|
||||
break;
|
||||
// case 'overdue':
|
||||
// case 'overdue':
|
||||
// if ($value[0] == 1 || $value[0] == '1') {
|
||||
// $table = $table->where('isanswered', '=', 0)
|
||||
// ->whereNotNull('tickets.duedate')
|
||||
@@ -857,7 +857,7 @@ class FilterController extends Controller
|
||||
|
||||
return [$start, $end];
|
||||
break;
|
||||
// cases for due date
|
||||
// cases for due date
|
||||
|
||||
case 'any-time':
|
||||
return ['any'];
|
||||
@@ -952,6 +952,7 @@ class FilterController extends Controller
|
||||
* @category function to filter tickets by SLA
|
||||
*
|
||||
* @param string array $value, builder $table
|
||||
*
|
||||
* @
|
||||
*
|
||||
* @return builder
|
||||
|
@@ -102,12 +102,12 @@ class FilterControllerOld extends Controller
|
||||
->whereIn('ticket_status.state', ['closed']);
|
||||
});
|
||||
case '/ticket/myticket':
|
||||
return $table
|
||||
->leftJoin('ticket_status', function ($join) {
|
||||
$join->on('ticket_status.id', '=', 'tickets.status');
|
||||
})
|
||||
->orWhere('tickets.assigned_to', '=', Auth::user()->id)
|
||||
->where('tickets.status', '=', 1);
|
||||
return $table
|
||||
->leftJoin('ticket_status', function ($join) {
|
||||
$join->on('ticket_status.id', '=', 'tickets.status');
|
||||
})
|
||||
->orWhere('tickets.assigned_to', '=', Auth::user()->id)
|
||||
->where('tickets.status', '=', 1);
|
||||
case '/unassigned':
|
||||
if (Auth::user()->role == 'agent') {
|
||||
$id = Auth::user()->primary_dpt;
|
||||
@@ -126,17 +126,17 @@ class FilterControllerOld extends Controller
|
||||
$table = $table->where('tickets.dept_id', '=', $id);
|
||||
}
|
||||
|
||||
return $table
|
||||
->leftJoin('ticket_status', function ($join) {
|
||||
$join->on('ticket_status.id', '=', 'tickets.status');
|
||||
})
|
||||
->where('tickets.status', '=', 1)
|
||||
->where('tickets.isanswered', '=', 0)
|
||||
->whereNotNull('tickets.duedate')
|
||||
->where('tickets.duedate', '!=', '00-00-00 00:00:00')
|
||||
return $table
|
||||
->leftJoin('ticket_status', function ($join) {
|
||||
$join->on('ticket_status.id', '=', 'tickets.status');
|
||||
})
|
||||
->where('tickets.status', '=', 1)
|
||||
->where('tickets.isanswered', '=', 0)
|
||||
->whereNotNull('tickets.duedate')
|
||||
->where('tickets.duedate', '!=', '00-00-00 00:00:00')
|
||||
|
||||
// ->where('duedate','>',\Carbon\Carbon::now());
|
||||
->where('tickets.duedate', '<', \Carbon\Carbon::now());
|
||||
// ->where('duedate','>',\Carbon\Carbon::now());
|
||||
->where('tickets.duedate', '<', \Carbon\Carbon::now());
|
||||
case '/ticket/approval/closed':
|
||||
if (Auth::user()->role == 'agent') {
|
||||
$id = Auth::user()->primary_dpt;
|
||||
@@ -203,14 +203,14 @@ class FilterControllerOld extends Controller
|
||||
$table = $table->where('tickets.dept_id', '=', $id);
|
||||
}
|
||||
|
||||
return $table
|
||||
->leftJoin('ticket_status', function ($join) {
|
||||
$join->on('ticket_status.id', '=', 'tickets.status');
|
||||
})
|
||||
->where('tickets.status', '=', 1)
|
||||
return $table
|
||||
->leftJoin('ticket_status', function ($join) {
|
||||
$join->on('ticket_status.id', '=', 'tickets.status');
|
||||
})
|
||||
->where('tickets.status', '=', 1)
|
||||
|
||||
->whereNotNull('tickets.duedate')
|
||||
->whereDate('tickets.duedate', '=', \Carbon\Carbon::now()->format('Y-m-d'));
|
||||
->whereNotNull('tickets.duedate')
|
||||
->whereDate('tickets.duedate', '=', \Carbon\Carbon::now()->format('Y-m-d'));
|
||||
|
||||
case '/ticket/followup':
|
||||
if (Auth::user()->role == 'agent') {
|
||||
|
@@ -3,7 +3,6 @@
|
||||
namespace App\Http\Controllers\Agent\helpdesk;
|
||||
|
||||
// controllers
|
||||
use App\Http\Controllers\Agent\helpdesk\Filter\FilterControllerOld;
|
||||
use App\Http\Controllers\Common\FileuploadController;
|
||||
use App\Http\Controllers\Common\NotificationController as Notify;
|
||||
use App\Http\Controllers\Common\PhpMailController;
|
||||
@@ -51,7 +50,6 @@ use Illuminate\Support\Str;
|
||||
use Lang;
|
||||
use Mail;
|
||||
use UTC;
|
||||
use Vsmoraes\Pdf\Pdf;
|
||||
use Vsmoraes\Pdf\PdfFacade;
|
||||
use Yajra\DataTables\Facades\DataTables;
|
||||
|
||||
|
@@ -600,8 +600,8 @@ class UserController extends Controller
|
||||
}
|
||||
}
|
||||
// } catch (Exception $e) {
|
||||
/* redirect to Index page with Fails Message */
|
||||
// return redirect('user')->with('fails', $e->getMessage());
|
||||
/* redirect to Index page with Fails Message */
|
||||
// return redirect('user')->with('fails', $e->getMessage());
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -640,7 +640,6 @@ class UserController extends Controller
|
||||
public function edit($id, CountryCode $code)
|
||||
{
|
||||
try {
|
||||
|
||||
// dd('here');
|
||||
$settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first();
|
||||
$email_mandatory = CommonSettings::select('status')->where('option_name', '=', 'email_mandatory')->first();
|
||||
@@ -996,6 +995,7 @@ class UserController extends Controller
|
||||
$users = $this->getUsers($first_date, $second_date);
|
||||
$excel_controller = new \App\Http\Controllers\Common\ExcelController();
|
||||
$filename = 'users'.$date;
|
||||
|
||||
return $excel_controller->export($filename, $users);
|
||||
} catch (Exception $ex) {
|
||||
return redirect()->back()->with('fails', $ex->getMessage());
|
||||
@@ -1046,7 +1046,7 @@ class UserController extends Controller
|
||||
->first();
|
||||
if ($otp != null) {
|
||||
$otp_length = strlen(Input::get('otp'));
|
||||
if (($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp')))) {
|
||||
if ($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp'))) {
|
||||
$otp2 = Hash::make(Input::get('otp'));
|
||||
$date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa');
|
||||
$date2 = date('Y-m-d h:i:sa');
|
||||
|
@@ -184,7 +184,6 @@ class CategoryController extends Controller
|
||||
*/
|
||||
public function update($id, CategoryRequest $request)
|
||||
{
|
||||
|
||||
/* Edit the selected category via id */
|
||||
$category = Category::where('id', $id)->first();
|
||||
$sl = $request->input('name');
|
||||
|
@@ -550,7 +550,7 @@ class AuthController extends Controller
|
||||
$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')))) {
|
||||
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');
|
||||
|
@@ -188,7 +188,7 @@ class FormController extends Controller
|
||||
// $priority = $ticket_settings->first()->priority;
|
||||
$default_priority = Ticket_Priority::where('is_default', '=', 1)->first();
|
||||
$user_priority = CommonSettings::where('option_name', '=', 'user_priority')->first();
|
||||
if (!($request->input('priority'))) {
|
||||
if (!$request->input('priority')) {
|
||||
$priority = $default_priority->priority_id;
|
||||
if ($helpTopicObj->exists() && ($helpTopicObj->value('status') == 1)) {
|
||||
$priority = $helpTopicObj->value('priority');
|
||||
|
@@ -409,7 +409,7 @@ class GuestController extends Controller
|
||||
->first();
|
||||
if ($otp != null) {
|
||||
$otp_length = strlen(Input::get('otp'));
|
||||
if (($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp')))) {
|
||||
if ($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp'))) {
|
||||
$otp2 = Hash::make(Input::get('otp'));
|
||||
$date1 = date_format($otp->updated_at, 'Y-m-d h:i:sa');
|
||||
$date2 = date('Y-m-d h:i:sa');
|
||||
|
@@ -344,7 +344,7 @@ class UnAuthController extends Controller
|
||||
|
||||
\Cache::forever('language', $lang);
|
||||
// dd(Cache::get('language'));
|
||||
// dd()
|
||||
// dd()
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -361,31 +361,31 @@ class UnAuthController extends Controller
|
||||
|
||||
switch ($condition) {
|
||||
case 'everyMinute':
|
||||
$followup_set = ' + 1 minute';
|
||||
$followup_set = ' + 1 minute';
|
||||
break;
|
||||
case 'everyFiveMinutes':
|
||||
$followup_set = ' + 5 minute';
|
||||
$followup_set = ' + 5 minute';
|
||||
break;
|
||||
case 'everyTenMinutes':
|
||||
$followup_set = ' + 10 minute';
|
||||
$followup_set = ' + 10 minute';
|
||||
break;
|
||||
case 'everyThirtyMinutes':
|
||||
$followup_set = ' + 30 minute';
|
||||
$followup_set = ' + 30 minute';
|
||||
break;
|
||||
case 'hourly':
|
||||
$followup_set = ' + 1 hours';
|
||||
$followup_set = ' + 1 hours';
|
||||
break;
|
||||
case 'daily':
|
||||
$followup_set = ' + 1 day';
|
||||
$followup_set = ' + 1 day';
|
||||
break;
|
||||
case 'weekly':
|
||||
$followup_set = ' + 7 day';
|
||||
$followup_set = ' + 7 day';
|
||||
break;
|
||||
case 'monthly':
|
||||
$followup_set = ' + 30 day';
|
||||
$followup_set = ' + 30 day';
|
||||
break;
|
||||
case 'yearly':
|
||||
$followup_set = ' + 365 day';
|
||||
$followup_set = ' + 365 day';
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -410,12 +410,12 @@ class UnAuthController extends Controller
|
||||
$ticket->follow_up = 1;
|
||||
$ticket->save();
|
||||
// Tickets::where('id', '=',$id)
|
||||
// ->update(['follow_up' => 1]);
|
||||
// ->update(['follow_up' => 1]);
|
||||
|
||||
// }
|
||||
// }
|
||||
}
|
||||
// if($id=2)
|
||||
// {dd($ticket);}
|
||||
// {dd($ticket);}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,20 +12,20 @@ use App\Model\helpdesk\Settings\System;
|
||||
use App\Model\helpdesk\Utility\Date_time_format;
|
||||
use App\Model\helpdesk\Utility\Timezones;
|
||||
use App\User;
|
||||
Use Illuminate\Support\Facades\Artisan;
|
||||
// classes
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use DB;
|
||||
// classes
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Hash;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\Request as Input;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use UnAuth;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use UnAuth;
|
||||
|
||||
/**
|
||||
* |=======================================================================
|
||||
@@ -436,7 +436,7 @@ class InstallController extends Controller
|
||||
$ENV['DB_DATABASE'] = '"'.$database.'"';
|
||||
$ENV['DB_USERNAME'] = '"'.$dbusername.'"';
|
||||
$ENV['DB_PASSWORD'] = '"'.$dbpassword.'"';
|
||||
$ENV['DB_ENGINE'] = 'InnoDB';
|
||||
$ENV['DB_ENGINE'] = 'InnoDB';
|
||||
$ENV['MAIL_MAILER'] = 'smtp';
|
||||
$ENV['MAIL_HOST'] = 'mailtrap.io';
|
||||
$ENV['MAIL_PORT'] = '2525';
|
||||
|
@@ -70,7 +70,7 @@ class MailController extends Controller
|
||||
case 'log':
|
||||
return $form;
|
||||
case 'ses':
|
||||
$form .= "<div class='row'>".$this->form('Key', 'key', 'col-md-6 form-group');
|
||||
$form .= "<div class='row'>".$this->form('Key', 'key', 'col-md-6 form-group');
|
||||
$form .= $this->form('Secret Key', 'secret', 'col-md-6 form-group').$this->form('Region', 'region', 'col-md-6 form-group').'</div>';
|
||||
|
||||
return $form;
|
||||
|
@@ -4,12 +4,8 @@ namespace App\Http\Controllers\Update;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class SyncFaveoToLatestVersion extends Controller
|
||||
{
|
||||
@@ -20,7 +16,7 @@ class SyncFaveoToLatestVersion extends Controller
|
||||
set_time_limit(0);
|
||||
|
||||
$latestVersion = $this->getPhpComaptibleVersion(Config::get('app.version'));
|
||||
$olderVersion = $this->getOlderVersion();
|
||||
$olderVersion = $this->getOlderVersion();
|
||||
|
||||
if (version_compare($latestVersion, $olderVersion) == 1) {
|
||||
$this->updateToLatestVersion($olderVersion);
|
||||
@@ -35,14 +31,14 @@ class SyncFaveoToLatestVersion extends Controller
|
||||
|
||||
$seederPath = base_path('database'.DIRECTORY_SEPARATOR.'seeders');
|
||||
|
||||
if(file_exists($seederPath)){
|
||||
if (file_exists($seederPath)) {
|
||||
$seederVersions = scandir($seederPath);
|
||||
|
||||
natsort($seederVersions);
|
||||
$formattedOlderVersion = $olderVersion;
|
||||
foreach ($seederVersions as $version) {
|
||||
if(version_compare($this->getPhpComaptibleVersion($version), $formattedOlderVersion) == 1){
|
||||
Artisan::call('db:seed',['--class' => "Database\Seeders\\$version\DatabaseSeeder", '--force' => true]);
|
||||
if (version_compare($this->getPhpComaptibleVersion($version), $formattedOlderVersion) == 1) {
|
||||
Artisan::call('db:seed', ['--class' => "Database\Seeders\\$version\DatabaseSeeder", '--force' => true]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,6 +51,7 @@ class SyncFaveoToLatestVersion extends Controller
|
||||
}
|
||||
|
||||
$version = System::value('version') ?: '0.0.0';
|
||||
|
||||
return $this->getPhpComaptibleVersion($version);
|
||||
}
|
||||
|
||||
|
@@ -98,7 +98,7 @@ class UpgradeController extends Controller
|
||||
$dlHandler = fopen($this->dir.'/UPDATES/'.'/faveo-helpdesk-master.zip', 'w');
|
||||
if (!fwrite($dlHandler, $newUpdate)) {
|
||||
echo '<p>Could not save new update. Operation aborted.</p>';
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
fclose($dlHandler);
|
||||
echo '<p>Update Downloaded And Saved</p>';
|
||||
@@ -205,7 +205,7 @@ class UpgradeController extends Controller
|
||||
echo "<li style='color:red;'>".$ex->getMessage().'</li>';
|
||||
echo '</ul>';
|
||||
}
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
public function deleteBarNotification($key)
|
||||
@@ -293,7 +293,7 @@ class UpgradeController extends Controller
|
||||
}
|
||||
} else {
|
||||
echo '<p>Latest code found. <a href='.url('file-upgrade?dodownload=true').'>» Download Now?</a></p>';
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
echo '<p>Update already downloaded.</p>';
|
||||
@@ -302,7 +302,7 @@ class UpgradeController extends Controller
|
||||
$updated = $this->doUpdate();
|
||||
} else {
|
||||
echo '<p>Update ready. <a href='.url('file-upgrade?doUpdate=true').'>» Install Now?</a></p>';
|
||||
exit();
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($updated == true) {
|
||||
|
@@ -4,7 +4,6 @@ namespace App\Http\Requests\helpdesk;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use App\Model\helpdesk\Settings\CommonSettings;
|
||||
use Illuminate\Contracts\Validation\Validator;
|
||||
|
||||
/**
|
||||
* AgentRequest.
|
||||
|
@@ -129,7 +129,7 @@ class ClientRequest extends Request
|
||||
{
|
||||
$settings = $settings->select('status')->where('option_name', '=', 'send_otp')->first();
|
||||
$email_mandatory = $settings->select('status')->where('option_name', '=', 'email_mandatory')->first();
|
||||
if (($email_mandatory->status == 0 || $email_mandatory->status == '0')) {
|
||||
if ($email_mandatory->status == 0 || $email_mandatory->status == '0') {
|
||||
if (!\Auth::check()) {
|
||||
return [
|
||||
'Name' => 'required',
|
||||
|
@@ -13,6 +13,6 @@ class System extends BaseModel
|
||||
protected $fillable = [
|
||||
|
||||
'id', 'status', 'url', 'name', 'department', 'page_size', 'log_level', 'purge_log', 'name_format',
|
||||
'time_farmat', 'date_format', 'date_time_format', 'day_date_time', 'time_zone', 'content', 'api_key', 'api_enable', 'api_key_mandatory', 'version'
|
||||
'time_farmat', 'date_format', 'date_time_format', 'day_date_time', 'time_zone', 'content', 'api_key', 'api_enable', 'api_key_mandatory', 'version',
|
||||
];
|
||||
}
|
||||
|
@@ -2,10 +2,8 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Model\helpdesk\Settings\System;
|
||||
use App\Model\Update\BarNotification;
|
||||
use Illuminate\Queue\Events\JobFailed;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Dusk\DuskServiceProvider;
|
||||
|
@@ -26,7 +26,6 @@ class EventServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
|
@@ -51,18 +51,18 @@ class DatabaseSeeder extends Seeder
|
||||
$tables = Schema::getAllTables();
|
||||
|
||||
foreach ($tables as $table) {
|
||||
$tableName = (array)$table;
|
||||
$tableName = (array) $table;
|
||||
$tableName = reset($tableName);
|
||||
|
||||
$columns = Schema::getColumnListing($tableName);
|
||||
|
||||
foreach ($columns as $column) {
|
||||
if (Schema::getColumnType($tableName, $column) == 'string') {
|
||||
Schema::table($tableName, function ($table) use($column) {
|
||||
Schema::table($tableName, function ($table) use ($column) {
|
||||
$table->string($column)->nullable()->change();
|
||||
});
|
||||
} elseif (Schema::getColumnType($tableName, $column) == 'boolean') {
|
||||
Schema::table($tableName, function ($table) use($column) {
|
||||
Schema::table($tableName, function ($table) use ($column) {
|
||||
$table->boolean($column)->default(0)->change();
|
||||
});
|
||||
}
|
||||
|
@@ -461,10 +461,10 @@ Route::middleware('web')->group(function () {
|
||||
|
||||
Route::get('/ticket/unassigned', [Agent\helpdesk\TicketController::class, 'get_unassigned'])->name('get.unassigned.ticket'); /* Get tickets in datatable */
|
||||
// Department ticket
|
||||
Route::get('/{dept}/open', [Agent\helpdesk\TicketController::class, 'deptopen'])->name('dept.open.ticket'); // Open
|
||||
Route::get('tickets/{dept}/{status}', [Agent\helpdesk\TicketController::class, 'deptTicket'])->name('dept.ticket'); // Open
|
||||
Route::get('/{dept}/open', [Agent\helpdesk\TicketController::class, 'deptopen'])->name('dept.open.ticket'); // Open
|
||||
Route::get('tickets/{dept}/{status}', [Agent\helpdesk\TicketController::class, 'deptTicket'])->name('dept.ticket'); // Open
|
||||
|
||||
Route::get('/{dept}/assigned', [Agent\helpdesk\TicketController::class, 'deptinprogress'])->name('dept.inprogress.ticket'); // Inprogress
|
||||
Route::get('/{dept}/assigned', [Agent\helpdesk\TicketController::class, 'deptinprogress'])->name('dept.inprogress.ticket'); // Inprogress
|
||||
|
||||
Route::get('/{dept}/closed', [Agent\helpdesk\TicketController::class, 'deptclose'])->name('dept.closed.ticket'); // Closed
|
||||
/*
|
||||
@@ -473,8 +473,8 @@ Route::middleware('web')->group(function () {
|
||||
Route::get('/ticket/followup', [Agent\helpdesk\TicketController::class, 'followupTicketList'])->name('followup.ticket'); // Get Closed Ticket /
|
||||
|
||||
Route::get('/ticket/get-followup', [Agent\helpdesk\TicketController::class, 'getFollowup'])->name('get.followup.ticket'); // Get tickets in datatable /
|
||||
Route::get('/ticket/close/get-approval/{id}', [Agent\helpdesk\TicketController::class, 'getCloseapproval'])->name('get.close.approval.ticket'); // Get tickets in datatable /
|
||||
Route::get('filter', [Agent\helpdesk\Filter\FilterControllerOld::class, 'getFilter'])->name('filter');
|
||||
Route::get('/ticket/close/get-approval/{id}', [Agent\helpdesk\TicketController::class, 'getCloseapproval'])->name('get.close.approval.ticket'); // Get tickets in datatable /
|
||||
Route::get('filter', [Agent\helpdesk\Filter\FilterControllerOld::class, 'getFilter'])->name('filter');
|
||||
|
||||
/*
|
||||
*=======================================================================
|
||||
@@ -527,7 +527,7 @@ Route::middleware('web')->group(function () {
|
||||
// show ticket via have a ticket
|
||||
Route::get('show-ticket/{id}/{code}', [Client\helpdesk\UnAuthController::class, 'showTicketCode'])->name('show.ticket'); //detail ticket information
|
||||
|
||||
//testing ckeditor
|
||||
//testing ckeditor
|
||||
//===================================================================================
|
||||
Route::middleware('auth')->group(function () {
|
||||
Route::get('client-profile', [Client\helpdesk\GuestController::class, 'getProfile'])->name('client.profile'); /* User profile get */
|
||||
|
Reference in New Issue
Block a user