Apply Laravel coding style
Shift automatically applies the Laravel coding style - which uses the PSR-12 coding style as a base with some minor additions. You may customize the code style applied by configuring [Pint](https://laravel.com/docs/pint), [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer), or [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) for your project root. For more information on customizing the code style applied by Shift, [watch this short video](https://laravelshift.com/videos/shift-code-style).
This commit is contained in:
@@ -61,11 +61,10 @@ class SettingsController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
* @param $compant instance of company table
|
||||
*
|
||||
* get the form for company setting page
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function getcompany(Company $company)
|
||||
@@ -86,7 +85,6 @@ class SettingsController extends Controller
|
||||
* @param type int $id
|
||||
* @param type Company $company
|
||||
* @param type CompanyRequest $request
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function postcompany($id, Company $company, CompanyRequest $request)
|
||||
@@ -122,7 +120,7 @@ class SettingsController extends Controller
|
||||
public function deleteLogo()
|
||||
{
|
||||
$path = $_GET['data1']; //get file path of logo image
|
||||
if (!unlink($path)) {
|
||||
if (! unlink($path)) {
|
||||
return 'false';
|
||||
} else {
|
||||
$companys = Company::where('id', '=', 1)->first();
|
||||
@@ -144,7 +142,6 @@ class SettingsController extends Controller
|
||||
* @param type Date_format $date
|
||||
* @param type Date_time_format $date_time
|
||||
* @param type Time_format $time
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getsystem(System $system, Department $department, Timezones $timezone, Date_format $date, Date_time_format $date_time, Time_format $time, CommonSettings $common_settings)
|
||||
@@ -179,7 +176,6 @@ class SettingsController extends Controller
|
||||
* @param type int $id
|
||||
* @param type System $system
|
||||
* @param type SystemRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function postsystem($id, System $system, SystemRequest $request)
|
||||
@@ -210,7 +206,7 @@ class SettingsController extends Controller
|
||||
|
||||
if ($request->has('itil')) {
|
||||
$itil = $request->input('itil');
|
||||
$sett = CommonSettings::firstOrCreate(['option_name'=>'itil']);
|
||||
$sett = CommonSettings::firstOrCreate(['option_name' => 'itil']);
|
||||
$sett->status = $itil;
|
||||
$sett->save();
|
||||
}
|
||||
@@ -229,7 +225,6 @@ class SettingsController extends Controller
|
||||
* @param type Sla_plan $sla
|
||||
* @param type Help_topic $topic
|
||||
* @param type Priority $priority
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getticket(Ticket $ticket, Sla_plan $sla, Help_topic $topic, Ticket_Priority $priority)
|
||||
@@ -254,7 +249,6 @@ class SettingsController extends Controller
|
||||
* @param type int $id
|
||||
* @param type Ticket $ticket
|
||||
* @param type Request $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function postticket($id, Ticket $ticket, Request $request)
|
||||
@@ -289,7 +283,6 @@ class SettingsController extends Controller
|
||||
* @param type Email $email
|
||||
* @param type Template $template
|
||||
* @param type Emails $email1
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getemail(Email $email, Template $template, Emails $email1)
|
||||
@@ -314,7 +307,6 @@ class SettingsController extends Controller
|
||||
* @param type int $id
|
||||
* @param type Email $email
|
||||
* @param type EmailRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function postemail($id, Email $email, EmailRequest $request)
|
||||
@@ -347,7 +339,6 @@ class SettingsController extends Controller
|
||||
* @param type Email $email
|
||||
* @param type Template $template
|
||||
* @param type Emails $email1
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getSchedular(Email $email, Template $template, Emails $email1, WorkflowClose $workflow)
|
||||
@@ -368,29 +359,29 @@ class SettingsController extends Controller
|
||||
$condition = new \App\Model\MailJob\Condition();
|
||||
$job = $condition->checkActiveJob();
|
||||
$commands = [
|
||||
'' => 'Select',
|
||||
'everyMinute' => 'Every Minute',
|
||||
'everyFiveMinutes' => 'Every Five Minute',
|
||||
'everyTenMinutes' => 'Every Ten Minute',
|
||||
'' => 'Select',
|
||||
'everyMinute' => 'Every Minute',
|
||||
'everyFiveMinutes' => 'Every Five Minute',
|
||||
'everyTenMinutes' => 'Every Ten Minute',
|
||||
'everyThirtyMinutes' => 'Every Thirty Minute',
|
||||
'hourly' => 'Every Hour',
|
||||
'daily' => 'Every Day',
|
||||
'dailyAt' => 'Daily at',
|
||||
'weekly' => 'Every Week',
|
||||
'monthly' => 'Monthly',
|
||||
'yearly' => 'Yearly',
|
||||
'hourly' => 'Every Hour',
|
||||
'daily' => 'Every Day',
|
||||
'dailyAt' => 'Daily at',
|
||||
'weekly' => 'Every Week',
|
||||
'monthly' => 'Monthly',
|
||||
'yearly' => 'Yearly',
|
||||
];
|
||||
$followupcommands = [
|
||||
'' => 'Select',
|
||||
'everyMinute' => 'Every Minute',
|
||||
'everyFiveMinutes' => 'Every Five Minute',
|
||||
'everyTenMinutes' => 'Every Ten Minute',
|
||||
'' => 'Select',
|
||||
'everyMinute' => 'Every Minute',
|
||||
'everyFiveMinutes' => 'Every Five Minute',
|
||||
'everyTenMinutes' => 'Every Ten Minute',
|
||||
'everyThirtyMinutes' => 'Every Thirty Minute',
|
||||
'hourly' => 'Every Hour',
|
||||
'daily' => 'Every Day',
|
||||
'weekly' => 'Every Week',
|
||||
'monthly' => 'Monthly',
|
||||
'yearly' => 'Yearly',
|
||||
'hourly' => 'Every Hour',
|
||||
'daily' => 'Every Day',
|
||||
'weekly' => 'Every Week',
|
||||
'monthly' => 'Monthly',
|
||||
'yearly' => 'Yearly',
|
||||
];
|
||||
if (ini_get('register_argc_argv') == '') {
|
||||
//$warn = "Please make 'register_argc_argv' flag as on. Or you can set all your job url in cron";
|
||||
@@ -406,7 +397,6 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @param type Email $email
|
||||
* @param type EmailRequest $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function postSchedular(Email $email, Template $template, Emails $email1, TaskRequest $request, WorkflowClose $workflow)
|
||||
@@ -446,7 +436,6 @@ class SettingsController extends Controller
|
||||
* get the form for Responder setting page.
|
||||
*
|
||||
* @param type Responder $responder
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getresponder(Responder $responder)
|
||||
@@ -466,7 +455,6 @@ class SettingsController extends Controller
|
||||
*
|
||||
* @param type Responder $responder
|
||||
* @param type Request $request
|
||||
*
|
||||
* @return type
|
||||
*/
|
||||
public function postresponder(Responder $responder, Request $request)
|
||||
@@ -495,7 +483,6 @@ class SettingsController extends Controller
|
||||
* get the form for Alert setting page.
|
||||
*
|
||||
* @param type Alert $alert
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function getalert(Alert $alert)
|
||||
@@ -513,10 +500,9 @@ class SettingsController extends Controller
|
||||
/**
|
||||
* Update the specified alert in storage.
|
||||
*
|
||||
* @param type $id
|
||||
* @param type $id
|
||||
* @param type Alert $alert
|
||||
* @param type Request $request
|
||||
*
|
||||
* @return type Response
|
||||
*/
|
||||
public function postalert($id, Alert $alert, Request $request)
|
||||
@@ -602,11 +588,10 @@ class SettingsController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
* @param $compant instance of company table
|
||||
*
|
||||
* get the form for company setting page
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function getStatuses()
|
||||
@@ -622,11 +607,10 @@ class SettingsController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
* @param $compant instance of company table
|
||||
*
|
||||
* get the form for company setting page
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function getEditStatuses($id)
|
||||
@@ -642,11 +626,10 @@ class SettingsController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
* @param int $id
|
||||
* @param $compant instance of company table
|
||||
*
|
||||
* get the form for company setting page
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function editStatuses($id, StatusRequest $request)
|
||||
@@ -676,9 +659,8 @@ class SettingsController extends Controller
|
||||
/**
|
||||
* create a status.
|
||||
*
|
||||
* @param \App\Model\helpdesk\Ticket\Ticket_Status $statuss
|
||||
* @param \App\Http\Requests\helpdesk\StatusRequest $request
|
||||
*
|
||||
* @param \App\Model\helpdesk\Ticket\Ticket_Status $statuss
|
||||
* @param \App\Http\Requests\helpdesk\StatusRequest $request
|
||||
* @return type redirect
|
||||
*/
|
||||
public function createStatuses(\App\Model\helpdesk\Ticket\Ticket_Status $statuss, StatusRequest $request)
|
||||
@@ -707,8 +689,7 @@ class SettingsController extends Controller
|
||||
/**
|
||||
* delete a status.
|
||||
*
|
||||
* @param type $id
|
||||
*
|
||||
* @param type $id
|
||||
* @return type redirect
|
||||
*/
|
||||
public function deleteStatuses($id)
|
||||
@@ -795,8 +776,7 @@ class SettingsController extends Controller
|
||||
/**
|
||||
* edit a rating.
|
||||
*
|
||||
* @param type $id
|
||||
*
|
||||
* @param type $id
|
||||
* @return type view
|
||||
*/
|
||||
public function editRatingSettings($id)
|
||||
@@ -850,10 +830,9 @@ class SettingsController extends Controller
|
||||
/**
|
||||
* store a rating value.
|
||||
*
|
||||
* @param \App\Model\helpdesk\Ratings\Rating $rating
|
||||
* @param \App\Model\helpdesk\Ratings\RatingRef $ratingrefs
|
||||
* @param \App\Http\Requests\helpdesk\RatingRequest $request
|
||||
*
|
||||
* @param \App\Model\helpdesk\Ratings\Rating $rating
|
||||
* @param \App\Model\helpdesk\Ratings\RatingRef $ratingrefs
|
||||
* @param \App\Http\Requests\helpdesk\RatingRequest $request
|
||||
* @return type redirect
|
||||
*/
|
||||
public function storeRating(Rating $rating, \App\Model\helpdesk\Ratings\RatingRef $ratingrefs, \App\Http\Requests\helpdesk\RatingRequest $request)
|
||||
@@ -896,7 +875,7 @@ class SettingsController extends Controller
|
||||
$fetching_command = $this->getCommand($fetching_commands, $fetching_dailyAt);
|
||||
$notification_command = $this->getCommand($notification_commands, $notification_dailyAt);
|
||||
$work_command = $this->getCommand($work_commands, $workflow_dailyAt);
|
||||
$jobs = ['fetching'=>$fetching_command, 'notification'=>$notification_command, 'work'=>$work_command];
|
||||
$jobs = ['fetching' => $fetching_command, 'notification' => $notification_command, 'work' => $work_command];
|
||||
$this->storeCommand($jobs);
|
||||
}
|
||||
}
|
||||
@@ -920,10 +899,10 @@ class SettingsController extends Controller
|
||||
}
|
||||
}
|
||||
if (count($array) > 0) {
|
||||
foreach ($array as $key=>$save) {
|
||||
foreach ($array as $key => $save) {
|
||||
$command->create([
|
||||
'job' => $key,
|
||||
'value'=> $save,
|
||||
'job' => $key,
|
||||
'value' => $save,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -933,7 +912,7 @@ class SettingsController extends Controller
|
||||
{
|
||||
$this->validate($request, [
|
||||
'format' => ['required', 'regex:/^(?=.*[$|-|#]).+$/'],
|
||||
'type' => 'required',
|
||||
'type' => 'required',
|
||||
]);
|
||||
|
||||
$format = $request->input('format');
|
||||
@@ -1054,7 +1033,6 @@ class SettingsController extends Controller
|
||||
* @category function to return clean data view
|
||||
*
|
||||
* @param null
|
||||
*
|
||||
* @return respone/view
|
||||
*/
|
||||
public function getCleanUpView()
|
||||
@@ -1073,7 +1051,6 @@ class SettingsController extends Controller
|
||||
* @category function to handle clean dummy data ajax request
|
||||
*
|
||||
* @param null
|
||||
*
|
||||
* @return json
|
||||
*/
|
||||
public function postCleanDummyData(Request $request)
|
||||
@@ -1091,7 +1068,6 @@ class SettingsController extends Controller
|
||||
* @category function to clean dummy database and reseed tables with default options
|
||||
*
|
||||
* @param null
|
||||
*
|
||||
* @return
|
||||
* Very dangerous function should be call by admin only
|
||||
*/
|
||||
@@ -1128,16 +1104,16 @@ class SettingsController extends Controller
|
||||
DB::commit();
|
||||
\Artisan::call('db:seed', ['--force' => true]);
|
||||
$user2 = \App\User::updateOrCreate(['id' => 1], [
|
||||
'first_name' => $user->first_name,
|
||||
'last_name' => $user->last_name,
|
||||
'email' => $user->email,
|
||||
'user_name' => $user->user_name,
|
||||
'password' => $user->password,
|
||||
'first_name' => $user->first_name,
|
||||
'last_name' => $user->last_name,
|
||||
'email' => $user->email,
|
||||
'user_name' => $user->user_name,
|
||||
'password' => $user->password,
|
||||
'assign_group' => 1,
|
||||
'primary_dpt' => 1,
|
||||
'active' => 1,
|
||||
'agent_tzone' => $user->agent_tzone,
|
||||
'role' => 'admin',
|
||||
'primary_dpt' => 1,
|
||||
'active' => 1,
|
||||
'agent_tzone' => $user->agent_tzone,
|
||||
'role' => 'admin',
|
||||
]);
|
||||
$system2 = System::find(1);
|
||||
$system2->time_zone = $system->time_zone;
|
||||
|
Reference in New Issue
Block a user