Skip to content
This repository has been archived by the owner on Feb 6, 2020. It is now read-only.

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
bhanu2217 authored and StyleCIBot committed Aug 22, 2017
1 parent fcb90ec commit 15ac1d0
Show file tree
Hide file tree
Showing 282 changed files with 5,120 additions and 4,107 deletions.
1 change: 0 additions & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class Kernel extends ConsoleKernel
protected function schedule(Schedule $schedule)
{
if (env('DB_INSTALL') == 1) {

if ($this->getCurrentQueue() != 'sync') {
$schedule->command('queue:listen '.$this->getCurrentQueue().' --sleep 60')->everyMinute();
}
Expand Down
35 changes: 20 additions & 15 deletions app/FaveoStorage/Controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,26 @@
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;

class SettingsController extends Controller {

public function settingsIcon() {
class SettingsController extends Controller
{
public function settingsIcon()
{
return ' <div class="col-md-2 col-sm-6">
<div class="settingiconblue">
<div class="settingdivblue">
<a href="' . url('storage') . '">
<a href="'.url('storage').'">
<span class="fa-stack fa-2x">
<i class="fa fa-save fa-stack-1x"></i>
</span>
</a>
</div>
<p class="box-title" >' . Lang::get('storage::lang.storage') . '</p>
<p class="box-title" >'.Lang::get('storage::lang.storage').'</p>
</div>
</div>';
}

public function settings() {
public function settings()
{
try {
$settings = new CommonSettings();
$directories = $this->directories();
Expand All @@ -49,7 +51,8 @@ public function settings() {
}
}

public function postSettings(Request $request) {
public function postSettings(Request $request)
{
try {
$requests = $request->except('_token');
$this->delete();
Expand All @@ -67,7 +70,8 @@ public function postSettings(Request $request) {
}
}

public function delete() {
public function delete()
{
$settings = CommonSettings::where('option_name', 'storage')->get();
if ($settings->count() > 0) {
foreach ($settings as $setting) {
Expand All @@ -76,15 +80,17 @@ public function delete() {
}
}

public function save($key, $value) {
public function save($key, $value)
{
CommonSettings::create([
'option_name' => 'storage',
'option_name' => 'storage',
'optional_field' => $key,
'option_value' => $value,
'option_value' => $value,
]);
}

public function directories($root = '') {
public function directories($root = '')
{
if ($root == '') {
$root = base_path();
}
Expand All @@ -103,12 +109,12 @@ public function directories($root = '') {
return $paths;
}

public function attachment() {
public function attachment()
{
$storage = new StorageController();
$storage->upload();
}


public function activate()
{
if (!\Schema::hasColumn('ticket_attachment', 'driver')) {
Expand All @@ -119,5 +125,4 @@ public function activate()
]);
}
}

}
116 changes: 58 additions & 58 deletions app/Helper/Finder.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,26 @@ public static function group($id, $custom = null)
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.
Expand Down Expand Up @@ -137,48 +137,48 @@ public static function rolesGroup($id)
}
}

/**
* 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;
}
return $status_group2;
}

/**
* 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();

/**
* 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 $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;
}

return $contents;
}
}
2 changes: 2 additions & 0 deletions app/Http/Controllers/Admin/helpdesk/AgentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,12 @@ public function destroy($id, User $user, Assign_team_agent $team_assign_agent)
$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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function update($id, WorkflowCloseRequest $request)
$security = new WorkflowClose();
$securitys = $security->whereId($id)->first();
$securitys->days = $request->input('days');
// $securitys->condition = $request->input('condition');
// $securitys->condition = $request->input('condition');
$securitys->send_email = $request->input('send_email');
$securitys->status = $request->input('status');
$securitys->save();
Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/Admin/helpdesk/EmailsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ public function destroy($id, Emails $email)
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();
Expand Down
6 changes: 6 additions & 0 deletions app/Http/Controllers/Admin/helpdesk/FormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public function show($id)

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());
Expand All @@ -125,6 +126,7 @@ public function store(Request $request)
'name.*' => 'required',
'type.*' => 'required',
]);

try {
$forms = new Forms();
$require = Input::get('required');
Expand Down Expand Up @@ -195,6 +197,7 @@ public function edit($id)
//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());
Expand All @@ -213,6 +216,7 @@ public function addChildForm($id)
//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());
Expand All @@ -227,6 +231,7 @@ public function update($id, Request $request)
'name.*' => 'required',
'type.*' => 'required',
]);

try {
if (!$request->input('formname')) {
throw new Exception(Lang::get('lang.please_fill_form_name'));
Expand Down Expand Up @@ -391,6 +396,7 @@ public function createValues($fieldid, $values, $childid = null, $key = '')
public function addChild($fieldid, Request $request)
{
$ids = $request->except('_token');

try {
foreach ($ids as $valueid => $formid) {
$field_value = new \App\Model\helpdesk\Form\FieldValue();
Expand Down
1 change: 0 additions & 1 deletion app/Http/Controllers/Admin/helpdesk/GroupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Exception;
// classes
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Input;
use Lang;

/**
Expand Down
5 changes: 2 additions & 3 deletions app/Http/Controllers/Admin/helpdesk/PriorityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
// classes
use Illuminate\Http\Request;
use Illuminate\support\Collection;
use Input;
use Lang;

/**
Expand All @@ -47,7 +46,7 @@ public function priorityIndex()
$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'));
}

/**
Expand Down Expand Up @@ -173,7 +172,7 @@ public function priorityEdit1(PriorityRequest $request)
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) {
Expand Down
9 changes: 4 additions & 5 deletions app/Http/Controllers/Admin/helpdesk/SecurityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
// Request
use Illuminate\Http\Request;
// Class
use Input;
use Lang;
use Redirect;

Expand Down Expand Up @@ -64,10 +63,10 @@ public function create()
*
* @return Response
*/
// public function show($id)
// {
// return view('themes.default1.admin.helpdesk.setting.security.preview', compact('id'));
// }
// public function show($id)
// {
// return view('themes.default1.admin.helpdesk.setting.security.preview', compact('id'));
// }

/**
* Update security details.
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/helpdesk/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ public function PostRatingSettings($id, Rating $ratings, RatingUpdateRequest $re
$rating->display_order = $request->input('display_order');
$rating->allow_modification = $request->input('allow_modification');
$rating->rating_scale = $request->input('rating_scale');
// $rating->rating_area = $request->input('rating_area');
// $rating->rating_area = $request->input('rating_area');
$rating->restrict = $request->input('restrict');
$rating->save();

Expand Down
Loading

0 comments on commit 15ac1d0

Please sign in to comment.