Apply fixes from StyleCI
This commit is contained in:

committed by
RafficMohammed

parent
0975cc5dd9
commit
b3b057e0cc
@@ -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',
|
||||
|
Reference in New Issue
Block a user