Apply fixes from StyleCI

This commit is contained in:
StyleCI Bot
2023-03-24 06:00:31 +00:00
committed by RafficMohammed
parent 0975cc5dd9
commit b3b057e0cc
33 changed files with 172 additions and 184 deletions

View File

@@ -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

View File

@@ -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') {

View File

@@ -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;

View File

@@ -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');

View File

@@ -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');