Apply fixes from StyleCI

This commit is contained in:
StyleCI Bot
2024-01-22 12:27:21 +00:00
committed by RafficMohammed
parent ac7fc33df2
commit e8f61f16d5
36 changed files with 114 additions and 8 deletions

View File

@@ -155,6 +155,7 @@ class CannedController extends Controller
/* delete the selected field */
/* Check whether function success or not */
$canned->delete();
/* redirect to Index page with Success Message */
return redirect()->route('canned.list')->with('success', Lang::get('lang.canned_response_deleted'));
} catch (Exception $e) {
@@ -180,6 +181,7 @@ class CannedController extends Controller
} else {
$msg = '';
}
// returning the canned response in JSON format
return \Response::json($msg);
}

View File

@@ -576,6 +576,7 @@ class FilterController extends Controller
$query->whereIn('tickets.team_id', $teams)
->orWhereIn('tickets.assigned_to', $users);
});
// dd($table->toSql());
return $table;
}
@@ -899,6 +900,7 @@ class FilterController extends Controller
} else {
$table = $table->where('tickets.id', '=', null);
}
// dd($table->toSql());
return $table;
}

View File

@@ -51,6 +51,7 @@ class FilterControllerOld extends Controller
if ((is_array($tags) && count($tags) > 0) || (is_array($labels) && count($labels) > 0)) {
$render = true;
}
// return \Datatables::of($table)->make();
return \Ttable::getTable($table);
}

View File

@@ -25,6 +25,7 @@ class ImapMail extends Mailbox
{
//dd($this->getImapStream());
$mailsIds = imap_search($this->getImapStream(), $criteria, SE_UID);
//dd($mailsIds);
return $mailsIds ? $mailsIds : [];
}

View File

@@ -178,6 +178,7 @@ class OrganizationController extends Controller
try {
/* select the field by id */
$orgs = $org->whereId($id)->first();
/* To view page */
return view('themes.default1.agent.helpdesk.organization.show', compact('orgs'));
} catch (Exception $e) {
@@ -198,6 +199,7 @@ class OrganizationController extends Controller
try {
/* select the field by id */
$orgs = $org->whereId($id)->first();
/* To view page */
return view('themes.default1.agent.helpdesk.organization.edit', compact('orgs'));
} catch (Exception $e) {
@@ -254,6 +256,7 @@ class OrganizationController extends Controller
/* Delete the field selected from the table */
/* Check whether function success or not */
$orgs->delete();
/* redirect to Index page with Success Message */
return redirect('organizations')->with('success', Lang::get('lang.organization_deleted_successfully'));
} catch (Exception $e) {

View File

@@ -501,6 +501,7 @@ class TicketController extends Controller
$ticket = Tickets::where('tickets.id', '=', $id)->first();
$html = view('themes.default1.agent.helpdesk.ticket.pdf', compact('id', 'ticket', 'tickets'))->render();
$html1 = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8');
/**
* This statement throws error with php7.1.
*
@@ -2457,6 +2458,7 @@ class TicketController extends Controller
$ticket = Tickets::where('id', $thread->ticket_id)->first();
$html = view('themes.default1.agent.helpdesk.ticket.thread-pdf', compact('thread', 'system', 'company', 'ticket'))->render();
$html1 = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8');
/**
* This statement throws error with php7.1.
*

View File

@@ -201,6 +201,7 @@ class TicketWorkflowController extends Controller
} elseif ($condition == 'ends') {
$return = $this->checkEnds($statement, $to_check);
}
// elseif($condition == 'match') {
//
// } elseif($condition == 'not_match') {

View File

@@ -149,6 +149,7 @@ class UserController extends Controller
$query->orWhere('country_code', 'LIKE', '%'.$search.'%');
});
}
// displaying list of users with chumper datatables
// return \Datatable::collection(User::where('role', "!=", "admin")->get())
return \Yajra\DataTables\Facades\DataTables::of($users)
@@ -338,6 +339,7 @@ class UserController extends Controller
return redirect('user')->with('success', Lang::get('lang.User-Created-Successfully'));
}
// $user->save();
/* redirect to Index page with Success Message */
return redirect('user')->with('success', Lang::get('lang.User-Created-Successfully'));
@@ -676,6 +678,7 @@ class UserController extends Controller
$user = new User();
/* select the field where id = $id(request Id) */
$users = $user->whereId($id)->first();
/* Update the value by selected field */
/* Check whether function success or not */
try {
@@ -697,6 +700,7 @@ class UserController extends Controller
$this->storeUserOrgRelation($id, $orgid);
}
/* redirect to Index page with Success Message */
return redirect('user')->with('success', Lang::get('lang.User-profile-Updated-Successfully'));
} catch (Exception $e) {
@@ -932,6 +936,7 @@ class UserController extends Controller
$user_org->org_id = $org->id;
$user_org->user_id = $id;
$user_org->save();
// for success return 0
return 0;
}
@@ -956,6 +961,7 @@ class UserController extends Controller
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters[rand(0, $charactersLength - 1)];
}
// return random string
return $randomString;
}
@@ -1061,6 +1067,7 @@ class UserController extends Controller
if (Hash::check(Input::get('otp'), $otp->otp)) {
Otp::where('user_id', '=', Input::get('u_id'))
->update(['otp' => '']);
// User::where('id', '=', $user->id)
// ->update(['active' => 1]);
// $this->openTicketAfterVerification($user->id);

View File

@@ -68,6 +68,7 @@ class ArticleController extends Controller
->select('id', 'name', 'description', 'publish_time', 'slug')
->orderBy('publish_time', 'desc')
->get();
// returns chumper datatable
return Datatable::Collection($articles)
@@ -136,6 +137,7 @@ class ArticleController extends Controller
{
/* get the attributes of the category */
$category = $category->pluck('id', 'name');
/* get the create page */
try {
return view('themes.default1.agent.kb.article.create', compact('category'));
@@ -169,6 +171,7 @@ class ArticleController extends Controller
foreach ($requests as $req) {
DB::insert('insert into kb_article_relationship (category_id, article_id) values (?,?)', [$req, $id]);
}
/* insert the values to the article table */
try {
$article->fill($request->except('slug'))->save();
@@ -203,6 +206,7 @@ class ArticleController extends Controller
/* get the selected article and display it at edit page */
/* Get the selected article with id */
$article = $article->whereId($id)->first();
/* send to the edit page */
try {
return view('themes.default1.agent.kb.article.edit', compact('assign', 'article', 'category'));
@@ -244,6 +248,7 @@ class ArticleController extends Controller
foreach ($requests as $req) {
DB::insert('insert into kb_article_relationship (category_id, article_id) values (?,?)', [$req, $id]);
}
/* update the value to the table */
try {
$article->fill($request->all())->save();

View File

@@ -123,6 +123,7 @@ class CategoryController extends Controller
{
/* Get the all attributes in the category model */
$category = $category->pluck('name', 'id')->toArray();
/* get the view page to create new category with all attributes
of category model */
try {
@@ -146,6 +147,7 @@ class CategoryController extends Controller
$sl = $request->input('name');
$slug = Str::slug($sl, '-');
$category->slug = $slug;
// send success message to index page
try {
$category->fill($request->input())->save();
@@ -169,6 +171,7 @@ class CategoryController extends Controller
/* get the atributes of the category model whose id == $id */
$category = Category::whereId($id)->first();
$categories = Category::pluck('name', 'id')->toArray();
/* get the Edit page the selected category via id */
return view('themes.default1.agent.kb.category.edit', compact('category', 'categories'));
}
@@ -188,6 +191,7 @@ class CategoryController extends Controller
$category = Category::where('id', $id)->first();
$sl = $request->input('name');
$slug = Str::slug($sl, '-');
/* update the values at the table via model according with the request */
//redirct to index page with success message
try {
@@ -218,6 +222,7 @@ class CategoryController extends Controller
} else {
/* delete the category selected, id == $id */
$category = $category->whereId($id)->first();
// redirect to index with success message
try {
$category->delete();

View File

@@ -56,6 +56,7 @@ class SettingsController extends Controller
/* get the setting where the id == 1 */
$settings = $settings->whereId('1')->first();
$time = $time->get();
//$date = $date->get();
return view('themes.default1.agent.kb.settings.settings', compact('date', 'settings', 'time'));
}