@@ -23,26 +23,26 @@ discard block |
||
23 | 23 | public function setup() : void |
24 | 24 | { |
25 | 25 | // Eloquent model to associate with this collection of views and controller actions. |
26 | - $this->crud->setModel('App\Models\Lookup\Department'); |
|
26 | + $this->crud->setModel ('App\Models\Lookup\Department'); |
|
27 | 27 | // Custom backpack route. |
28 | - $this->crud->setRoute('admin/department'); |
|
28 | + $this->crud->setRoute ('admin/department'); |
|
29 | 29 | // Custom strings to display within the backpack UI. |
30 | - $this->crud->setEntityNameStrings('department', 'departments'); |
|
30 | + $this->crud->setEntityNameStrings ('department', 'departments'); |
|
31 | 31 | |
32 | - $this->crud->operation(['create', 'update'], function () { |
|
33 | - $this->crud->addField([ |
|
32 | + $this->crud->operation (['create', 'update'], function (){ |
|
33 | + $this->crud->addField ([ |
|
34 | 34 | 'name' => 'name', |
35 | 35 | 'type' => 'text', |
36 | 36 | 'label' => 'Name', |
37 | 37 | ]); |
38 | 38 | |
39 | - $this->crud->addField([ |
|
39 | + $this->crud->addField ([ |
|
40 | 40 | 'name' => 'impact', |
41 | 41 | 'type' => 'textarea', |
42 | 42 | 'label' => 'Impact', |
43 | 43 | ]); |
44 | 44 | |
45 | - $this->crud->addField([ |
|
45 | + $this->crud->addField ([ |
|
46 | 46 | 'name' => 'preference', |
47 | 47 | 'type' => 'textarea', |
48 | 48 | 'label' => 'Preference', |
@@ -54,34 +54,34 @@ discard block |
||
54 | 54 | { |
55 | 55 | // Required for order logic. |
56 | 56 | $locale = 'en'; |
57 | - if (null !== $this->request->input('locale')) { |
|
58 | - $locale = $this->request->input('locale'); |
|
57 | + if (null !== $this->request->input ('locale')) { |
|
58 | + $locale = $this->request->input ('locale'); |
|
59 | 59 | } |
60 | - App::setLocale($locale); |
|
60 | + App::setLocale ($locale); |
|
61 | 61 | |
62 | 62 | // Remove delete button. |
63 | - $this->crud->removeButton('delete'); |
|
63 | + $this->crud->removeButton ('delete'); |
|
64 | 64 | |
65 | 65 | // Add custom columns to the Department index view. |
66 | - $this->crud->addColumn([ |
|
66 | + $this->crud->addColumn ([ |
|
67 | 67 | 'name' => 'id', |
68 | 68 | 'type' => 'text', |
69 | 69 | 'label' => 'ID', |
70 | 70 | 'orderable' => true, |
71 | 71 | ]); |
72 | 72 | |
73 | - $this->crud->addColumn([ |
|
73 | + $this->crud->addColumn ([ |
|
74 | 74 | 'name' => 'name', |
75 | 75 | 'type' => 'text', |
76 | 76 | 'label' => 'Name', |
77 | 77 | 'orderable' => true, |
78 | 78 | 'limit' => 70, |
79 | 79 | 'orderLogic' => function ($query, $column, $columnDirection) use ($locale) { |
80 | - return $query->orderBy('name->' . $locale, $columnDirection)->select('*'); |
|
80 | + return $query->orderBy ('name->'.$locale, $columnDirection)->select ('*'); |
|
81 | 81 | } |
82 | 82 | ]); |
83 | 83 | |
84 | - $this->crud->addColumn([ |
|
84 | + $this->crud->addColumn ([ |
|
85 | 85 | 'name' => 'impact', |
86 | 86 | 'type' => 'text', |
87 | 87 | 'label' => 'Impact', |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | 'limit' => 70, |
90 | 90 | ]); |
91 | 91 | |
92 | - $this->crud->addColumn([ |
|
92 | + $this->crud->addColumn ([ |
|
93 | 93 | 'name' => 'preference', |
94 | 94 | 'type' => 'text', |
95 | 95 | 'label' => 'Preference', |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | |
101 | 101 | public function setupCreateOperation() |
102 | 102 | { |
103 | - $this->crud->setValidation(StoreRequest::class); |
|
103 | + $this->crud->setValidation (StoreRequest::class); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | public function setupUpdateOperation() |
107 | 107 | { |
108 | - $this->crud->setValidation(UpdateRequest::class); |
|
108 | + $this->crud->setValidation (UpdateRequest::class); |
|
109 | 109 | } |
110 | 110 | } |
@@ -18,68 +18,68 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function setup() : void |
20 | 20 | { |
21 | - $this->crud->setModel('App\Models\User'); |
|
22 | - $this->crud->setRoute('admin/user'); |
|
23 | - $this->crud->setEntityNameStrings('user', 'users'); |
|
21 | + $this->crud->setModel ('App\Models\User'); |
|
22 | + $this->crud->setRoute ('admin/user'); |
|
23 | + $this->crud->setEntityNameStrings ('user', 'users'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | public function setupListOperation() |
27 | 27 | { |
28 | - $this->crud->addColumn([ |
|
28 | + $this->crud->addColumn ([ |
|
29 | 29 | 'name' => 'id', |
30 | 30 | 'type' => 'number', |
31 | 31 | 'label' => 'ID' |
32 | 32 | ]); |
33 | - $this->crud->addColumn([ |
|
33 | + $this->crud->addColumn ([ |
|
34 | 34 | 'name' => 'first_name', |
35 | 35 | 'type' => 'text', |
36 | 36 | 'label' => 'First Name' |
37 | 37 | ]); |
38 | - $this->crud->addColumn([ |
|
38 | + $this->crud->addColumn ([ |
|
39 | 39 | 'name' => 'last_name', |
40 | 40 | 'type' => 'text', |
41 | 41 | 'label' => 'Last Name' |
42 | 42 | ]); |
43 | - $this->crud->addColumn([ |
|
43 | + $this->crud->addColumn ([ |
|
44 | 44 | 'name' => 'user_role.name', |
45 | 45 | 'type' => 'text', |
46 | 46 | 'key' => 'user_role_name', |
47 | 47 | 'label' => 'Role' |
48 | 48 | ]); |
49 | - $this->crud->addColumn([ |
|
49 | + $this->crud->addColumn ([ |
|
50 | 50 | 'name' => 'email', |
51 | 51 | 'type' => 'text', |
52 | 52 | 'label' => 'Email' |
53 | 53 | ]); |
54 | - $this->crud->addColumn([ |
|
54 | + $this->crud->addColumn ([ |
|
55 | 55 | 'name' => 'gov_email', |
56 | 56 | 'type' => 'text', |
57 | 57 | 'label' => 'Government Email' |
58 | 58 | ]); |
59 | - $this->crud->addColumn([ |
|
59 | + $this->crud->addColumn ([ |
|
60 | 60 | 'name' => 'not_in_gov', |
61 | 61 | 'type' => 'check', |
62 | 62 | 'label' => 'In Government' |
63 | 63 | ]); |
64 | - $this->crud->addColumn([ |
|
64 | + $this->crud->addColumn ([ |
|
65 | 65 | 'name' => 'is_priority', |
66 | 66 | 'type' => 'check', |
67 | 67 | 'label' => 'Priority' |
68 | 68 | ]); |
69 | - $this->crud->addFilter([ |
|
69 | + $this->crud->addFilter ([ |
|
70 | 70 | 'name' => 'user_role', |
71 | 71 | 'type' => 'select2', |
72 | 72 | 'label' => 'Role' |
73 | - ], function () { |
|
74 | - return UserRole::all()->keyBy('id')->pluck('name', 'id')->toArray(); |
|
73 | + ], function (){ |
|
74 | + return UserRole::all ()->keyBy ('id')->pluck ('name', 'id')->toArray (); |
|
75 | 75 | }, function ($value) : void { |
76 | - $this->crud->addClause('where', 'user_role_id', $value); |
|
76 | + $this->crud->addClause ('where', 'user_role_id', $value); |
|
77 | 77 | }); |
78 | 78 | } |
79 | 79 | |
80 | 80 | public function setupUpdateOperation() |
81 | 81 | { |
82 | - $this->crud->addField([ |
|
82 | + $this->crud->addField ([ |
|
83 | 83 | 'name' => 'name', |
84 | 84 | 'label' => 'Name', |
85 | 85 | 'type' => 'text', |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | 'readonly'=>'readonly' |
88 | 88 | ] |
89 | 89 | ]); |
90 | - $this->crud->addField([ |
|
90 | + $this->crud->addField ([ |
|
91 | 91 | 'label' => 'Role', |
92 | 92 | 'type' => 'select', |
93 | 93 | 'name' => 'user_role_id', // The db column for the foreign key. |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | 'attribute' => 'name', // Foreign key attribute that is shown to user. |
96 | 96 | 'model' => 'App\Models\UserRole' // Foreign key model. |
97 | 97 | ]); |
98 | - $this->crud->addField([ |
|
98 | + $this->crud->addField ([ |
|
99 | 99 | 'name' => 'is_priority', |
100 | 100 | 'type' => 'checkbox', |
101 | 101 | 'label' => 'Priority' |
@@ -34,22 +34,22 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function index(JobPoster $jobPoster) |
36 | 36 | { |
37 | - $applications = $jobPoster->submitted_applications() |
|
38 | - ->with([ |
|
37 | + $applications = $jobPoster->submitted_applications () |
|
38 | + ->with ([ |
|
39 | 39 | 'veteran_status', |
40 | 40 | 'citizenship_declaration', |
41 | 41 | 'application_review', |
42 | 42 | 'applicant.user', |
43 | 43 | 'job_poster.criteria', |
44 | 44 | ]) |
45 | - ->get(); |
|
46 | - return view('manager/review_applications', [ |
|
45 | + ->get (); |
|
46 | + return view ('manager/review_applications', [ |
|
47 | 47 | // Localization Strings. |
48 | - 'jobs_l10n' => Lang::get('manager/job_index'), |
|
48 | + 'jobs_l10n' => Lang::get ('manager/job_index'), |
|
49 | 49 | // Data. |
50 | - 'job' => $jobPoster->toApiArray(), |
|
50 | + 'job' => $jobPoster->toApiArray (), |
|
51 | 51 | 'applications' => $applications, |
52 | - 'review_statuses' => ReviewStatus::all() |
|
52 | + 'review_statuses' => ReviewStatus::all () |
|
53 | 53 | ]); |
54 | 54 | } |
55 | 55 | |
@@ -61,14 +61,14 @@ discard block |
||
61 | 61 | */ |
62 | 62 | protected function getApplicationFromJob(JobPoster $jobPoster) |
63 | 63 | { |
64 | - $application = JobApplication::where('applicant_id', Auth::user()->applicant->id) |
|
65 | - ->where('job_poster_id', $jobPoster->id)->first(); |
|
64 | + $application = JobApplication::where ('applicant_id', Auth::user ()->applicant->id) |
|
65 | + ->where ('job_poster_id', $jobPoster->id)->first (); |
|
66 | 66 | if ($application == null) { |
67 | - $application = new JobApplication(); |
|
67 | + $application = new JobApplication (); |
|
68 | 68 | $application->job_poster_id = $jobPoster->id; |
69 | - $application->applicant_id = Auth::user()->applicant->id; |
|
70 | - $application->application_status_id = ApplicationStatus::where('name', 'draft')->firstOrFail()->id; |
|
71 | - $application->save(); |
|
69 | + $application->applicant_id = Auth::user ()->applicant->id; |
|
70 | + $application->application_status_id = ApplicationStatus::where ('name', 'draft')->firstOrFail ()->id; |
|
71 | + $application->save (); |
|
72 | 72 | } |
73 | 73 | return $application; |
74 | 74 | } |
@@ -81,32 +81,32 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function editBasics(JobPoster $jobPoster) |
83 | 83 | { |
84 | - $applicant = Auth::user()->applicant; |
|
85 | - $application = $this->getApplicationFromJob($jobPoster); |
|
84 | + $applicant = Auth::user ()->applicant; |
|
85 | + $application = $this->getApplicationFromJob ($jobPoster); |
|
86 | 86 | |
87 | 87 | // Ensure user has permissions to view and update application. |
88 | - $this->authorize('view', $application); |
|
89 | - $this->authorize('update', $application); |
|
88 | + $this->authorize ('view', $application); |
|
89 | + $this->authorize ('update', $application); |
|
90 | 90 | |
91 | - return view( |
|
91 | + return view ( |
|
92 | 92 | 'applicant/application_post_01', |
93 | 93 | [ |
94 | 94 | // Application Template Data. |
95 | 95 | 'application_step' => 1, |
96 | - 'application_template' => Lang::get('applicant/application_template'), |
|
97 | - 'language_options' => PreferredLanguage::all(), |
|
98 | - 'citizenship_options' => CitizenshipDeclaration::all(), |
|
99 | - 'veteran_options' => VeteranStatus::all(), |
|
100 | - 'preferred_language_template' => Lang::get('common/preferred_language'), |
|
101 | - 'citizenship_declaration_template' => Lang::get('common/citizenship_declaration'), |
|
102 | - 'veteran_status_template' => Lang::get('common/veteran_status'), |
|
96 | + 'application_template' => Lang::get ('applicant/application_template'), |
|
97 | + 'language_options' => PreferredLanguage::all (), |
|
98 | + 'citizenship_options' => CitizenshipDeclaration::all (), |
|
99 | + 'veteran_options' => VeteranStatus::all (), |
|
100 | + 'preferred_language_template' => Lang::get ('common/preferred_language'), |
|
101 | + 'citizenship_declaration_template' => Lang::get ('common/citizenship_declaration'), |
|
102 | + 'veteran_status_template' => Lang::get ('common/veteran_status'), |
|
103 | 103 | // Job Data. |
104 | 104 | 'job' => $jobPoster, |
105 | 105 | // Applicant Data. |
106 | 106 | 'applicant' => $applicant, |
107 | 107 | 'job_application' => $application, |
108 | 108 | // Submission. |
109 | - 'form_submit_action' => route('job.application.update.1', $jobPoster) |
|
109 | + 'form_submit_action' => route ('job.application.update.1', $jobPoster) |
|
110 | 110 | ] |
111 | 111 | ); |
112 | 112 | } |
@@ -119,26 +119,26 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function editExperience(JobPoster $jobPoster) |
121 | 121 | { |
122 | - $applicant = Auth::user()->applicant; |
|
123 | - $application = $this->getApplicationFromJob($jobPoster); |
|
122 | + $applicant = Auth::user ()->applicant; |
|
123 | + $application = $this->getApplicationFromJob ($jobPoster); |
|
124 | 124 | |
125 | 125 | // Ensure user has permissions to view and update application. |
126 | - $this->authorize('view', $application); |
|
127 | - $this->authorize('update', $application); |
|
126 | + $this->authorize ('view', $application); |
|
127 | + $this->authorize ('update', $application); |
|
128 | 128 | |
129 | - return view( |
|
129 | + return view ( |
|
130 | 130 | 'applicant/application_post_02', |
131 | 131 | [ |
132 | 132 | // Application Template Data. |
133 | 133 | 'application_step' => 2, |
134 | - 'application_template' => Lang::get('applicant/application_template'), |
|
134 | + 'application_template' => Lang::get ('applicant/application_template'), |
|
135 | 135 | // Job Data. |
136 | 136 | 'job' => $jobPoster, |
137 | 137 | // Applicant Data. |
138 | 138 | 'applicant' => $applicant, |
139 | 139 | 'job_application' => $application, |
140 | 140 | // Submission. |
141 | - 'form_submit_action' => route('job.application.update.2', $jobPoster) |
|
141 | + 'form_submit_action' => route ('job.application.update.2', $jobPoster) |
|
142 | 142 | ] |
143 | 143 | ); |
144 | 144 | } |
@@ -151,39 +151,39 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function editEssentialSkills(JobPoster $jobPoster) |
153 | 153 | { |
154 | - $applicant = Auth::user()->applicant; |
|
155 | - $application = $this->getApplicationFromJob($jobPoster); |
|
154 | + $applicant = Auth::user ()->applicant; |
|
155 | + $application = $this->getApplicationFromJob ($jobPoster); |
|
156 | 156 | |
157 | 157 | // Ensure user has permissions to view and update application. |
158 | - $this->authorize('view', $application); |
|
159 | - $this->authorize('update', $application); |
|
158 | + $this->authorize ('view', $application); |
|
159 | + $this->authorize ('update', $application); |
|
160 | 160 | |
161 | 161 | $criteria = [ |
162 | - 'essential' => $jobPoster->criteria->filter(function ($value, $key) { |
|
162 | + 'essential' => $jobPoster->criteria->filter (function ($value, $key){ |
|
163 | 163 | return $value->criteria_type->name == 'essential'; |
164 | 164 | }), |
165 | - 'asset' => $jobPoster->criteria->filter(function ($value, $key) { |
|
165 | + 'asset' => $jobPoster->criteria->filter (function ($value, $key){ |
|
166 | 166 | return $value->criteria_type->name == 'asset'; |
167 | 167 | }), |
168 | 168 | ]; |
169 | 169 | |
170 | - return view( |
|
170 | + return view ( |
|
171 | 171 | 'applicant/application_post_03', |
172 | 172 | [ |
173 | 173 | // Application Template Data. |
174 | 174 | 'application_step' => 3, |
175 | - 'application_template' => Lang::get('applicant/application_template'), |
|
175 | + 'application_template' => Lang::get ('applicant/application_template'), |
|
176 | 176 | // Job Data. |
177 | 177 | 'job' => $jobPoster, |
178 | 178 | // Skills Data. |
179 | - 'skills' => Skill::all(), |
|
180 | - 'skill_template' => Lang::get('common/skills'), |
|
179 | + 'skills' => Skill::all (), |
|
180 | + 'skill_template' => Lang::get ('common/skills'), |
|
181 | 181 | 'criteria' => $criteria, |
182 | 182 | // Applicant Data. |
183 | 183 | 'applicant' => $applicant, |
184 | 184 | 'job_application' => $application, |
185 | 185 | // Submission. |
186 | - 'form_submit_action' => route('job.application.update.3', $jobPoster) |
|
186 | + 'form_submit_action' => route ('job.application.update.3', $jobPoster) |
|
187 | 187 | ] |
188 | 188 | ); |
189 | 189 | } |
@@ -196,39 +196,39 @@ discard block |
||
196 | 196 | */ |
197 | 197 | public function editAssetSkills(JobPoster $jobPoster) |
198 | 198 | { |
199 | - $applicant = Auth::user()->applicant; |
|
200 | - $application = $this->getApplicationFromJob($jobPoster); |
|
199 | + $applicant = Auth::user ()->applicant; |
|
200 | + $application = $this->getApplicationFromJob ($jobPoster); |
|
201 | 201 | |
202 | 202 | // Ensure user has permissions to view and update application. |
203 | - $this->authorize('view', $application); |
|
204 | - $this->authorize('update', $application); |
|
203 | + $this->authorize ('view', $application); |
|
204 | + $this->authorize ('update', $application); |
|
205 | 205 | |
206 | 206 | $criteria = [ |
207 | - 'essential' => $jobPoster->criteria->filter(function ($value, $key) { |
|
207 | + 'essential' => $jobPoster->criteria->filter (function ($value, $key){ |
|
208 | 208 | return $value->criteria_type->name == 'essential'; |
209 | 209 | }), |
210 | - 'asset' => $jobPoster->criteria->filter(function ($value, $key) { |
|
210 | + 'asset' => $jobPoster->criteria->filter (function ($value, $key){ |
|
211 | 211 | return $value->criteria_type->name == 'asset'; |
212 | 212 | }), |
213 | 213 | ]; |
214 | 214 | |
215 | - return view( |
|
215 | + return view ( |
|
216 | 216 | 'applicant/application_post_04', |
217 | 217 | [ |
218 | 218 | // Application Template Data. |
219 | 219 | 'application_step' => 4, |
220 | - 'application_template' => Lang::get('applicant/application_template'), |
|
220 | + 'application_template' => Lang::get ('applicant/application_template'), |
|
221 | 221 | // Job Data. |
222 | 222 | 'job' => $jobPoster, |
223 | 223 | // Skills Data. |
224 | - 'skills' => Skill::all(), |
|
225 | - 'skill_template' => Lang::get('common/skills'), |
|
224 | + 'skills' => Skill::all (), |
|
225 | + 'skill_template' => Lang::get ('common/skills'), |
|
226 | 226 | 'criteria' => $criteria, |
227 | 227 | // Applicant Data. |
228 | 228 | 'applicant' => $applicant, |
229 | 229 | 'job_application' => $application, |
230 | 230 | // Submission. |
231 | - 'form_submit_action' => route('job.application.update.4', $jobPoster) |
|
231 | + 'form_submit_action' => route ('job.application.update.4', $jobPoster) |
|
232 | 232 | ] |
233 | 233 | ); |
234 | 234 | } |
@@ -241,38 +241,38 @@ discard block |
||
241 | 241 | */ |
242 | 242 | public function preview(JobPoster $jobPoster) |
243 | 243 | { |
244 | - $applicant = Auth::user()->applicant; |
|
245 | - $application = $this->getApplicationFromJob($jobPoster); |
|
244 | + $applicant = Auth::user ()->applicant; |
|
245 | + $application = $this->getApplicationFromJob ($jobPoster); |
|
246 | 246 | |
247 | - $this->authorize('view', $application); |
|
247 | + $this->authorize ('view', $application); |
|
248 | 248 | $criteria = [ |
249 | - 'essential' => $jobPoster->criteria->filter(function ($value, $key) { |
|
249 | + 'essential' => $jobPoster->criteria->filter (function ($value, $key){ |
|
250 | 250 | return $value->criteria_type->name == 'essential'; |
251 | 251 | }), |
252 | - 'asset' => $jobPoster->criteria->filter(function ($value, $key) { |
|
252 | + 'asset' => $jobPoster->criteria->filter (function ($value, $key){ |
|
253 | 253 | return $value->criteria_type->name == 'asset'; |
254 | 254 | }), |
255 | 255 | ]; |
256 | 256 | |
257 | - return view( |
|
257 | + return view ( |
|
258 | 258 | 'applicant/application_post_05', |
259 | 259 | [ |
260 | 260 | // Application Template Data. |
261 | 261 | 'application_step' => 5, |
262 | - 'application_template' => Lang::get('applicant/application_template'), |
|
263 | - 'preferred_language_template' => Lang::get('common/preferred_language'), |
|
264 | - 'citizenship_declaration_template' => Lang::get('common/citizenship_declaration'), |
|
265 | - 'veteran_status_template' => Lang::get('common/veteran_status'), |
|
262 | + 'application_template' => Lang::get ('applicant/application_template'), |
|
263 | + 'preferred_language_template' => Lang::get ('common/preferred_language'), |
|
264 | + 'citizenship_declaration_template' => Lang::get ('common/citizenship_declaration'), |
|
265 | + 'veteran_status_template' => Lang::get ('common/veteran_status'), |
|
266 | 266 | // Job Data. |
267 | 267 | 'job' => $jobPoster, |
268 | 268 | // Skills Data. |
269 | - 'skills' => Skill::all(), |
|
270 | - 'skill_template' => Lang::get('common/skills'), |
|
269 | + 'skills' => Skill::all (), |
|
270 | + 'skill_template' => Lang::get ('common/skills'), |
|
271 | 271 | 'criteria' => $criteria, |
272 | 272 | // Applicant Data. |
273 | 273 | 'applicant' => $applicant, |
274 | 274 | 'job_application' => $application, |
275 | - 'is_manager_view' => WhichPortal::isManagerPortal(), |
|
275 | + 'is_manager_view' => WhichPortal::isManagerPortal (), |
|
276 | 276 | ] |
277 | 277 | ); |
278 | 278 | } |
@@ -285,22 +285,22 @@ discard block |
||
285 | 285 | */ |
286 | 286 | public function confirm(JobPoster $jobPoster) |
287 | 287 | { |
288 | - $applicant = Auth::user()->applicant; |
|
289 | - $application = $this->getApplicationFromJob($jobPoster); |
|
288 | + $applicant = Auth::user ()->applicant; |
|
289 | + $application = $this->getApplicationFromJob ($jobPoster); |
|
290 | 290 | |
291 | - $this->authorize('update', $application); |
|
291 | + $this->authorize ('update', $application); |
|
292 | 292 | |
293 | - return view( |
|
293 | + return view ( |
|
294 | 294 | 'applicant/application_post_06', |
295 | 295 | [ |
296 | 296 | // Application Template Data. |
297 | 297 | 'application_step' => 6, |
298 | - 'application_template' => Lang::get('applicant/application_template'), |
|
298 | + 'application_template' => Lang::get ('applicant/application_template'), |
|
299 | 299 | // Used by tracker partial. |
300 | 300 | 'job' => $jobPoster, |
301 | 301 | 'job_application' => $application, |
302 | 302 | // Submission. |
303 | - 'form_submit_action' => route('job.application.submit', $jobPoster) |
|
303 | + 'form_submit_action' => route ('job.application.submit', $jobPoster) |
|
304 | 304 | ] |
305 | 305 | ); |
306 | 306 | } |
@@ -314,19 +314,19 @@ discard block |
||
314 | 314 | public function complete(JobPoster $jobPoster) |
315 | 315 | { |
316 | 316 | // Include Applicant Data. |
317 | - $applicant = Auth::user()->applicant; |
|
317 | + $applicant = Auth::user ()->applicant; |
|
318 | 318 | // Include Application Data. |
319 | - $application = $this->getApplicationFromJob($jobPoster); |
|
319 | + $application = $this->getApplicationFromJob ($jobPoster); |
|
320 | 320 | |
321 | 321 | // Ensure user has permissions to view application. |
322 | - $this->authorize('view', $application); |
|
322 | + $this->authorize ('view', $application); |
|
323 | 323 | |
324 | 324 | // Return the Completion View. |
325 | - return view( |
|
325 | + return view ( |
|
326 | 326 | 'applicant/application_post_complete', |
327 | 327 | [ |
328 | 328 | // Application Template Data. |
329 | - 'application_template' => Lang::get('applicant/application_template'), |
|
329 | + 'application_template' => Lang::get ('applicant/application_template'), |
|
330 | 330 | // Job Data. |
331 | 331 | 'job' => $jobPoster, |
332 | 332 | // Applicant Data. |
@@ -345,50 +345,50 @@ discard block |
||
345 | 345 | */ |
346 | 346 | public function updateBasics(Request $request, JobPoster $jobPoster) |
347 | 347 | { |
348 | - $applicant = Auth::user()->applicant; |
|
349 | - $application = $this->getApplicationFromJob($jobPoster); |
|
348 | + $applicant = Auth::user ()->applicant; |
|
349 | + $application = $this->getApplicationFromJob ($jobPoster); |
|
350 | 350 | |
351 | 351 | // Ensure user has permissions to update this application. |
352 | - $this->authorize('update', $application); |
|
352 | + $this->authorize ('update', $application); |
|
353 | 353 | |
354 | - $application->fill([ |
|
355 | - 'citizenship_declaration_id' => $request->input('citizenship_declaration_id'), |
|
356 | - 'veteran_status_id' => $request->input('veteran_status_id'), |
|
357 | - 'preferred_language_id' => $request->input('preferred_language_id'), |
|
358 | - 'language_requirement_confirmed' => $request->input('language_requirement_confirmed') |
|
354 | + $application->fill ([ |
|
355 | + 'citizenship_declaration_id' => $request->input ('citizenship_declaration_id'), |
|
356 | + 'veteran_status_id' => $request->input ('veteran_status_id'), |
|
357 | + 'preferred_language_id' => $request->input ('preferred_language_id'), |
|
358 | + 'language_requirement_confirmed' => $request->input ('language_requirement_confirmed') |
|
359 | 359 | ]); |
360 | - $application->save(); |
|
360 | + $application->save (); |
|
361 | 361 | |
362 | 362 | $questions = $jobPoster->job_poster_questions; |
363 | - $questionsInput = $request->input('questions'); |
|
363 | + $questionsInput = $request->input ('questions'); |
|
364 | 364 | foreach ($questions as $question) { |
365 | 365 | $answer = null; |
366 | 366 | if (isset($questionsInput[$question->id])) { |
367 | 367 | $answer = $questionsInput[$question->id]; |
368 | 368 | } |
369 | 369 | $answerObj = $application->job_application_answers |
370 | - ->firstWhere('job_poster_question_id', $question->id); |
|
370 | + ->firstWhere ('job_poster_question_id', $question->id); |
|
371 | 371 | if ($answerObj == null) { |
372 | - $answerObj = new JobApplicationAnswer(); |
|
372 | + $answerObj = new JobApplicationAnswer (); |
|
373 | 373 | $answerObj->job_poster_question_id = $question->id; |
374 | 374 | $answerObj->job_application_id = $application->id; |
375 | 375 | } |
376 | 376 | $answerObj->answer = $answer; |
377 | - $answerObj->save(); |
|
377 | + $answerObj->save (); |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | // Redirect to correct page. |
381 | - switch ($request->input('submit')) { |
|
381 | + switch ($request->input ('submit')) { |
|
382 | 382 | case 'save_and_quit': |
383 | 383 | case 'previous': |
384 | - return redirect()->route('applications.index'); |
|
384 | + return redirect ()->route ('applications.index'); |
|
385 | 385 | break; |
386 | 386 | case 'save_and_continue': |
387 | 387 | case 'next': |
388 | - return redirect()->route('job.application.edit.2', $jobPoster); |
|
388 | + return redirect ()->route ('job.application.edit.2', $jobPoster); |
|
389 | 389 | break; |
390 | 390 | default: |
391 | - return redirect()->back()->withInput(); |
|
391 | + return redirect ()->back ()->withInput (); |
|
392 | 392 | } |
393 | 393 | } |
394 | 394 | |
@@ -401,19 +401,19 @@ discard block |
||
401 | 401 | */ |
402 | 402 | public function updateExperience(Request $request, JobPoster $jobPoster) |
403 | 403 | { |
404 | - $applicant = Auth::user()->applicant; |
|
405 | - $application = $this->getApplicationFromJob($jobPoster); |
|
404 | + $applicant = Auth::user ()->applicant; |
|
405 | + $application = $this->getApplicationFromJob ($jobPoster); |
|
406 | 406 | |
407 | 407 | // Ensure user has permissions to update this application. |
408 | - $this->authorize('update', $application); |
|
408 | + $this->authorize ('update', $application); |
|
409 | 409 | |
410 | 410 | // Record that the user has saved their experience for this application. |
411 | 411 | $application->experience_saved = true; |
412 | - $application->save(); |
|
412 | + $application->save (); |
|
413 | 413 | |
414 | - $degrees = $request->input('degrees'); |
|
414 | + $degrees = $request->input ('degrees'); |
|
415 | 415 | |
416 | - $request->validate([ |
|
416 | + $request->validate ([ |
|
417 | 417 | 'degrees.new.*.degree_type_id' => 'required', |
418 | 418 | 'degrees.new.*.area_of_study' => 'required', |
419 | 419 | 'degrees.new.*.institution' => 'required', |
@@ -426,9 +426,9 @@ discard block |
||
426 | 426 | // Save new degrees. |
427 | 427 | if (isset($degrees['new'])) { |
428 | 428 | foreach ($degrees['new'] as $degreeInput) { |
429 | - $degree = new Degree(); |
|
429 | + $degree = new Degree (); |
|
430 | 430 | $degree->applicant_id = $applicant->id; |
431 | - $degree->fill([ |
|
431 | + $degree->fill ([ |
|
432 | 432 | 'degree_type_id' => $degreeInput['degree_type_id'], |
433 | 433 | 'area_of_study' => $degreeInput['area_of_study'], |
434 | 434 | 'institution' => $degreeInput['institution'], |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | 'end_date' => $degreeInput['end_date'], |
438 | 438 | 'blockcert_url' => $degreeInput['blockcert_url'], |
439 | 439 | ]); |
440 | - $degree->save(); |
|
440 | + $degree->save (); |
|
441 | 441 | } |
442 | 442 | } |
443 | 443 | |
@@ -445,9 +445,9 @@ discard block |
||
445 | 445 | if (isset($degrees['old'])) { |
446 | 446 | foreach ($degrees['old'] as $id => $degreeInput) { |
447 | 447 | // Ensure this degree belongs to this applicant. |
448 | - $degree = $applicant->degrees->firstWhere('id', $id); |
|
448 | + $degree = $applicant->degrees->firstWhere ('id', $id); |
|
449 | 449 | if ($degree != null) { |
450 | - $degree->fill([ |
|
450 | + $degree->fill ([ |
|
451 | 451 | 'degree_type_id' => $degreeInput['degree_type_id'], |
452 | 452 | 'area_of_study' => $degreeInput['area_of_study'], |
453 | 453 | 'institution' => $degreeInput['institution'], |
@@ -456,16 +456,16 @@ discard block |
||
456 | 456 | 'end_date' => $degreeInput['end_date'], |
457 | 457 | 'blockcert_url' => $degreeInput['blockcert_url'], |
458 | 458 | ]); |
459 | - $degree->save(); |
|
459 | + $degree->save (); |
|
460 | 460 | } else { |
461 | - Log::warning("Applicant $applicant->id attempted to update degree with invalid id: $id"); |
|
461 | + Log::warning ("Applicant $applicant->id attempted to update degree with invalid id: $id"); |
|
462 | 462 | } |
463 | 463 | } |
464 | 464 | } |
465 | 465 | |
466 | - $courses = $request->input('courses'); |
|
466 | + $courses = $request->input ('courses'); |
|
467 | 467 | |
468 | - $request->validate([ |
|
468 | + $request->validate ([ |
|
469 | 469 | 'courses.new.*.name' => 'required', |
470 | 470 | 'courses.new.*.institution' => 'required', |
471 | 471 | 'courses.new.*.course_status_id' => 'required', |
@@ -476,16 +476,16 @@ discard block |
||
476 | 476 | // Save new courses. |
477 | 477 | if (isset($courses['new'])) { |
478 | 478 | foreach ($courses['new'] as $courseInput) { |
479 | - $course = new Course(); |
|
479 | + $course = new Course (); |
|
480 | 480 | $course->applicant_id = $applicant->id; |
481 | - $course->fill([ |
|
481 | + $course->fill ([ |
|
482 | 482 | 'name' => $courseInput['name'], |
483 | 483 | 'institution' => $courseInput['institution'], |
484 | 484 | 'course_status_id' => $courseInput['course_status_id'], |
485 | 485 | 'start_date' => $courseInput['start_date'], |
486 | 486 | 'end_date' => $courseInput['end_date'] |
487 | 487 | ]); |
488 | - $course->save(); |
|
488 | + $course->save (); |
|
489 | 489 | } |
490 | 490 | } |
491 | 491 | |
@@ -493,25 +493,25 @@ discard block |
||
493 | 493 | if (isset($courses['old'])) { |
494 | 494 | foreach ($courses['old'] as $id => $courseInput) { |
495 | 495 | // Ensure this course belongs to this applicant. |
496 | - $course = $applicant->courses->firstWhere('id', $id); |
|
496 | + $course = $applicant->courses->firstWhere ('id', $id); |
|
497 | 497 | if ($course != null) { |
498 | - $course->fill([ |
|
498 | + $course->fill ([ |
|
499 | 499 | 'name' => $courseInput['name'], |
500 | 500 | 'institution' => $courseInput['institution'], |
501 | 501 | 'course_status_id' => $courseInput['course_status_id'], |
502 | 502 | 'start_date' => $courseInput['start_date'], |
503 | 503 | 'end_date' => $courseInput['end_date'] |
504 | 504 | ]); |
505 | - $course->save(); |
|
505 | + $course->save (); |
|
506 | 506 | } else { |
507 | - Log::warning("Applicant $applicant->id attempted to update course with invalid id: $id"); |
|
507 | + Log::warning ("Applicant $applicant->id attempted to update course with invalid id: $id"); |
|
508 | 508 | } |
509 | 509 | } |
510 | 510 | } |
511 | 511 | |
512 | - $work_experiences = $request->input('work_experiences'); |
|
512 | + $work_experiences = $request->input ('work_experiences'); |
|
513 | 513 | |
514 | - $request->validate([ |
|
514 | + $request->validate ([ |
|
515 | 515 | 'work_experiences.new.*.role' => 'required', |
516 | 516 | 'work_experiences.new.*.company' => 'required', |
517 | 517 | 'work_experiences.new.*.description' => 'required', |
@@ -522,16 +522,16 @@ discard block |
||
522 | 522 | // Save new work_experiences. |
523 | 523 | if (isset($work_experiences['new'])) { |
524 | 524 | foreach ($work_experiences['new'] as $workExperienceInput) { |
525 | - $workExperience = new WorkExperience(); |
|
525 | + $workExperience = new WorkExperience (); |
|
526 | 526 | $workExperience->applicant_id = $applicant->id; |
527 | - $workExperience->fill([ |
|
527 | + $workExperience->fill ([ |
|
528 | 528 | 'role' => $workExperienceInput['role'], |
529 | 529 | 'company' => $workExperienceInput['company'], |
530 | 530 | 'description' => $workExperienceInput['description'], |
531 | 531 | 'start_date' => $workExperienceInput['start_date'], |
532 | 532 | 'end_date' => $workExperienceInput['end_date'] |
533 | 533 | ]); |
534 | - $workExperience->save(); |
|
534 | + $workExperience->save (); |
|
535 | 535 | } |
536 | 536 | } |
537 | 537 | |
@@ -539,36 +539,36 @@ discard block |
||
539 | 539 | if (isset($work_experiences['old'])) { |
540 | 540 | foreach ($work_experiences['old'] as $id => $workExperienceInput) { |
541 | 541 | // Ensure this work_experience belongs to this applicant. |
542 | - $workExperience = $applicant->work_experiences->firstWhere('id', $id); |
|
542 | + $workExperience = $applicant->work_experiences->firstWhere ('id', $id); |
|
543 | 543 | if ($workExperience != null) { |
544 | - $workExperience->fill([ |
|
544 | + $workExperience->fill ([ |
|
545 | 545 | 'role' => $workExperienceInput['role'], |
546 | 546 | 'company' => $workExperienceInput['company'], |
547 | 547 | 'description' => $workExperienceInput['description'], |
548 | 548 | 'start_date' => $workExperienceInput['start_date'], |
549 | 549 | 'end_date' => $workExperienceInput['end_date'] |
550 | 550 | ]); |
551 | - $workExperience->save(); |
|
551 | + $workExperience->save (); |
|
552 | 552 | } else { |
553 | - Log::warning("Applicant $applicant->id attempted to update work_experience with invalid id: $id"); |
|
553 | + Log::warning ("Applicant $applicant->id attempted to update work_experience with invalid id: $id"); |
|
554 | 554 | } |
555 | 555 | } |
556 | 556 | } |
557 | 557 | |
558 | 558 | // Redirect to correct page. |
559 | - switch ($request->input('submit')) { |
|
559 | + switch ($request->input ('submit')) { |
|
560 | 560 | case 'save_and_quit': |
561 | - return redirect()->route('applications.index'); |
|
561 | + return redirect ()->route ('applications.index'); |
|
562 | 562 | break; |
563 | 563 | case 'save_and_continue': |
564 | 564 | case 'next': |
565 | - return redirect()->route('job.application.edit.3', $jobPoster); |
|
565 | + return redirect ()->route ('job.application.edit.3', $jobPoster); |
|
566 | 566 | break; |
567 | 567 | case 'previous': |
568 | - return redirect()->route('job.application.edit.1', $jobPoster); |
|
568 | + return redirect ()->route ('job.application.edit.1', $jobPoster); |
|
569 | 569 | break; |
570 | 570 | default: |
571 | - return redirect()->back()->withInput(); |
|
571 | + return redirect ()->back ()->withInput (); |
|
572 | 572 | } |
573 | 573 | } |
574 | 574 | |
@@ -581,34 +581,34 @@ discard block |
||
581 | 581 | */ |
582 | 582 | public function updateEssentialSkills(Request $request, JobPoster $jobPoster) |
583 | 583 | { |
584 | - $applicant = Auth::user()->applicant; |
|
585 | - $application = $this->getApplicationFromJob($jobPoster); |
|
584 | + $applicant = Auth::user ()->applicant; |
|
585 | + $application = $this->getApplicationFromJob ($jobPoster); |
|
586 | 586 | |
587 | 587 | // Ensure user has permissions to update this application. |
588 | - $this->authorize('update', $application); |
|
588 | + $this->authorize ('update', $application); |
|
589 | 589 | |
590 | - $skillDeclarations = $request->input('skill_declarations'); |
|
591 | - $claimedStatusId = SkillStatus::where('name', 'claimed')->firstOrFail()->id; |
|
590 | + $skillDeclarations = $request->input ('skill_declarations'); |
|
591 | + $claimedStatusId = SkillStatus::where ('name', 'claimed')->firstOrFail ()->id; |
|
592 | 592 | |
593 | 593 | // Save new skill declarartions. |
594 | 594 | if (isset($skillDeclarations['new'])) { |
595 | 595 | foreach ($skillDeclarations['new'] as $skillType => $typeInput) { |
596 | 596 | foreach ($typeInput as $criterion_id => $skillDeclarationInput) { |
597 | - $skillDeclaration = new SkillDeclaration(); |
|
597 | + $skillDeclaration = new SkillDeclaration (); |
|
598 | 598 | $skillDeclaration->applicant_id = $applicant->id; |
599 | - $skillDeclaration->skill_id = Criteria::find($criterion_id)->skill->id; |
|
599 | + $skillDeclaration->skill_id = Criteria::find ($criterion_id)->skill->id; |
|
600 | 600 | $skillDeclaration->skill_status_id = $claimedStatusId; |
601 | - $skillDeclaration->fill([ |
|
601 | + $skillDeclaration->fill ([ |
|
602 | 602 | 'description' => $skillDeclarationInput['description'], |
603 | 603 | 'skill_level_id' => isset($skillDeclarationInput['skill_level_id']) ? $skillDeclarationInput['skill_level_id'] : null, |
604 | 604 | ]); |
605 | - $skillDeclaration->save(); |
|
605 | + $skillDeclaration->save (); |
|
606 | 606 | |
607 | - $referenceIds = $this->getRelativeIds($skillDeclarationInput, 'references'); |
|
608 | - $skillDeclaration->references()->sync($referenceIds); |
|
607 | + $referenceIds = $this->getRelativeIds ($skillDeclarationInput, 'references'); |
|
608 | + $skillDeclaration->references ()->sync ($referenceIds); |
|
609 | 609 | |
610 | - $sampleIds = $this->getRelativeIds($skillDeclarationInput, 'samples'); |
|
611 | - $skillDeclaration->work_samples()->sync($sampleIds); |
|
610 | + $sampleIds = $this->getRelativeIds ($skillDeclarationInput, 'samples'); |
|
611 | + $skillDeclaration->work_samples ()->sync ($sampleIds); |
|
612 | 612 | } |
613 | 613 | } |
614 | 614 | } |
@@ -618,41 +618,41 @@ discard block |
||
618 | 618 | foreach ($skillDeclarations['old'] as $skillType => $typeInput) { |
619 | 619 | foreach ($typeInput as $id => $skillDeclarationInput) { |
620 | 620 | // Ensure this declaration belongs to this applicant. |
621 | - $skillDeclaration = $applicant->skill_declarations->firstWhere('id', $id); |
|
621 | + $skillDeclaration = $applicant->skill_declarations->firstWhere ('id', $id); |
|
622 | 622 | if ($skillDeclaration != null) { |
623 | 623 | // skill_id and skill_status cannot be changed. |
624 | - $skillDeclaration->fill([ |
|
624 | + $skillDeclaration->fill ([ |
|
625 | 625 | 'description' => $skillDeclarationInput['description'], |
626 | 626 | 'skill_level_id' => isset($skillDeclarationInput['skill_level_id']) ? $skillDeclarationInput['skill_level_id'] : null, |
627 | 627 | ]); |
628 | - $skillDeclaration->save(); |
|
628 | + $skillDeclaration->save (); |
|
629 | 629 | |
630 | - $referenceIds = $this->getRelativeIds($skillDeclarationInput, 'references'); |
|
631 | - $skillDeclaration->references()->sync($referenceIds); |
|
630 | + $referenceIds = $this->getRelativeIds ($skillDeclarationInput, 'references'); |
|
631 | + $skillDeclaration->references ()->sync ($referenceIds); |
|
632 | 632 | |
633 | - $sampleIds = $this->getRelativeIds($skillDeclarationInput, 'samples'); |
|
634 | - $skillDeclaration->work_samples()->sync($sampleIds); |
|
633 | + $sampleIds = $this->getRelativeIds ($skillDeclarationInput, 'samples'); |
|
634 | + $skillDeclaration->work_samples ()->sync ($sampleIds); |
|
635 | 635 | } else { |
636 | - Log::warning("Applicant $applicant->id attempted to update skill declaration with invalid id: $id"); |
|
636 | + Log::warning ("Applicant $applicant->id attempted to update skill declaration with invalid id: $id"); |
|
637 | 637 | } |
638 | 638 | } |
639 | 639 | } |
640 | 640 | } |
641 | 641 | |
642 | 642 | // Redirect to correct page. |
643 | - switch ($request->input('submit')) { |
|
643 | + switch ($request->input ('submit')) { |
|
644 | 644 | case 'save_and_quit': |
645 | - return redirect()->route('applications.index'); |
|
645 | + return redirect ()->route ('applications.index'); |
|
646 | 646 | break; |
647 | 647 | case 'save_and_continue': |
648 | 648 | case 'next': |
649 | - return redirect()->route('job.application.edit.4', $jobPoster); |
|
649 | + return redirect ()->route ('job.application.edit.4', $jobPoster); |
|
650 | 650 | break; |
651 | 651 | case 'previous': |
652 | - return redirect()->route('job.application.edit.2', $jobPoster); |
|
652 | + return redirect ()->route ('job.application.edit.2', $jobPoster); |
|
653 | 653 | break; |
654 | 654 | default: |
655 | - return redirect()->back()->withInput(); |
|
655 | + return redirect ()->back ()->withInput (); |
|
656 | 656 | } |
657 | 657 | } |
658 | 658 | |
@@ -665,34 +665,34 @@ discard block |
||
665 | 665 | */ |
666 | 666 | public function updateAssetSkills(Request $request, JobPoster $jobPoster) |
667 | 667 | { |
668 | - $applicant = Auth::user()->applicant; |
|
669 | - $application = $this->getApplicationFromJob($jobPoster); |
|
668 | + $applicant = Auth::user ()->applicant; |
|
669 | + $application = $this->getApplicationFromJob ($jobPoster); |
|
670 | 670 | |
671 | 671 | // Ensure user has permissions to update this application. |
672 | - $this->authorize('update', $application); |
|
672 | + $this->authorize ('update', $application); |
|
673 | 673 | |
674 | - $skillDeclarations = $request->input('skill_declarations'); |
|
675 | - $claimedStatusId = SkillStatus::where('name', 'claimed')->firstOrFail()->id; |
|
674 | + $skillDeclarations = $request->input ('skill_declarations'); |
|
675 | + $claimedStatusId = SkillStatus::where ('name', 'claimed')->firstOrFail ()->id; |
|
676 | 676 | |
677 | 677 | // Save new skill declarartions. |
678 | 678 | if (isset($skillDeclarations['new'])) { |
679 | 679 | foreach ($skillDeclarations['new'] as $skillType => $typeInput) { |
680 | 680 | foreach ($typeInput as $criterion_id => $skillDeclarationInput) { |
681 | - $skillDeclaration = new SkillDeclaration(); |
|
681 | + $skillDeclaration = new SkillDeclaration (); |
|
682 | 682 | $skillDeclaration->applicant_id = $applicant->id; |
683 | - $skillDeclaration->skill_id = Criteria::find($criterion_id)->skill->id; |
|
683 | + $skillDeclaration->skill_id = Criteria::find ($criterion_id)->skill->id; |
|
684 | 684 | $skillDeclaration->skill_status_id = $claimedStatusId; |
685 | - $skillDeclaration->fill([ |
|
685 | + $skillDeclaration->fill ([ |
|
686 | 686 | 'description' => $skillDeclarationInput['description'], |
687 | 687 | 'skill_level_id' => isset($skillDeclarationInput['skill_level_id']) ? $skillDeclarationInput['skill_level_id'] : null, |
688 | 688 | ]); |
689 | - $skillDeclaration->save(); |
|
689 | + $skillDeclaration->save (); |
|
690 | 690 | |
691 | - $referenceIds = $this->getRelativeIds($skillDeclarationInput, 'references'); |
|
692 | - $skillDeclaration->references()->sync($referenceIds); |
|
691 | + $referenceIds = $this->getRelativeIds ($skillDeclarationInput, 'references'); |
|
692 | + $skillDeclaration->references ()->sync ($referenceIds); |
|
693 | 693 | |
694 | - $sampleIds = $this->getRelativeIds($skillDeclarationInput, 'samples'); |
|
695 | - $skillDeclaration->work_samples()->sync($sampleIds); |
|
694 | + $sampleIds = $this->getRelativeIds ($skillDeclarationInput, 'samples'); |
|
695 | + $skillDeclaration->work_samples ()->sync ($sampleIds); |
|
696 | 696 | } |
697 | 697 | } |
698 | 698 | } |
@@ -702,41 +702,41 @@ discard block |
||
702 | 702 | foreach ($skillDeclarations['old'] as $skillType => $typeInput) { |
703 | 703 | foreach ($typeInput as $id => $skillDeclarationInput) { |
704 | 704 | // Ensure this declaration belongs to this applicant. |
705 | - $skillDeclaration = $applicant->skill_declarations->firstWhere('id', $id); |
|
705 | + $skillDeclaration = $applicant->skill_declarations->firstWhere ('id', $id); |
|
706 | 706 | if ($skillDeclaration != null) { |
707 | 707 | // skill_id and skill_status cannot be changed. |
708 | - $skillDeclaration->fill([ |
|
708 | + $skillDeclaration->fill ([ |
|
709 | 709 | 'description' => $skillDeclarationInput['description'], |
710 | 710 | 'skill_level_id' => isset($skillDeclarationInput['skill_level_id']) ? $skillDeclarationInput['skill_level_id'] : null, |
711 | 711 | ]); |
712 | - $skillDeclaration->save(); |
|
712 | + $skillDeclaration->save (); |
|
713 | 713 | |
714 | - $referenceIds = $this->getRelativeIds($skillDeclarationInput, 'references'); |
|
715 | - $skillDeclaration->references()->sync($referenceIds); |
|
714 | + $referenceIds = $this->getRelativeIds ($skillDeclarationInput, 'references'); |
|
715 | + $skillDeclaration->references ()->sync ($referenceIds); |
|
716 | 716 | |
717 | - $sampleIds = $this->getRelativeIds($skillDeclarationInput, 'samples'); |
|
718 | - $skillDeclaration->work_samples()->sync($sampleIds); |
|
717 | + $sampleIds = $this->getRelativeIds ($skillDeclarationInput, 'samples'); |
|
718 | + $skillDeclaration->work_samples ()->sync ($sampleIds); |
|
719 | 719 | } else { |
720 | - Log::warning("Applicant $applicant->id attempted to update skill declaration with invalid id: $id"); |
|
720 | + Log::warning ("Applicant $applicant->id attempted to update skill declaration with invalid id: $id"); |
|
721 | 721 | } |
722 | 722 | } |
723 | 723 | } |
724 | 724 | } |
725 | 725 | |
726 | 726 | // Redirect to correct page. |
727 | - switch ($request->input('submit')) { |
|
727 | + switch ($request->input ('submit')) { |
|
728 | 728 | case 'save_and_quit': |
729 | - return redirect()->route('applications.index'); |
|
729 | + return redirect ()->route ('applications.index'); |
|
730 | 730 | break; |
731 | 731 | case 'save_and_continue': |
732 | 732 | case 'next': |
733 | - return redirect()->route('job.application.edit.5', $jobPoster); |
|
733 | + return redirect ()->route ('job.application.edit.5', $jobPoster); |
|
734 | 734 | break; |
735 | 735 | case 'previous': |
736 | - return redirect()->route('job.application.edit.3', $jobPoster); |
|
736 | + return redirect ()->route ('job.application.edit.3', $jobPoster); |
|
737 | 737 | break; |
738 | 738 | default: |
739 | - return redirect()->back()->withInput(); |
|
739 | + return redirect ()->back ()->withInput (); |
|
740 | 740 | } |
741 | 741 | } |
742 | 742 | |
@@ -749,15 +749,15 @@ discard block |
||
749 | 749 | */ |
750 | 750 | public function submit(Request $request, JobPoster $jobPoster) |
751 | 751 | { |
752 | - $applicant = Auth::user()->applicant; |
|
753 | - $application = $this->getApplicationFromJob($jobPoster); |
|
752 | + $applicant = Auth::user ()->applicant; |
|
753 | + $application = $this->getApplicationFromJob ($jobPoster); |
|
754 | 754 | |
755 | 755 | // Ensure user has permissions to update this application. |
756 | - $this->authorize('update', $application); |
|
756 | + $this->authorize ('update', $application); |
|
757 | 757 | |
758 | 758 | // Only complete submission if submit button was pressed. |
759 | - if ($request->input('submit') == 'submit') { |
|
760 | - $request->validate([ |
|
759 | + if ($request->input ('submit') == 'submit') { |
|
760 | + $request->validate ([ |
|
761 | 761 | 'submission_signature' => [ |
762 | 762 | 'required', |
763 | 763 | 'string', |
@@ -771,33 +771,33 @@ discard block |
||
771 | 771 | ]); |
772 | 772 | |
773 | 773 | // Save any final info. |
774 | - $application->fill([ |
|
775 | - 'submission_signature' => $request->input('submission_signature'), |
|
776 | - 'submission_date' => $request->input('submission_date'), |
|
774 | + $application->fill ([ |
|
775 | + 'submission_signature' => $request->input ('submission_signature'), |
|
776 | + 'submission_date' => $request->input ('submission_date'), |
|
777 | 777 | ]); |
778 | 778 | |
779 | - $validator = new ApplicationValidator(); |
|
780 | - $validator->validate($application); |
|
779 | + $validator = new ApplicationValidator (); |
|
780 | + $validator->validate ($application); |
|
781 | 781 | |
782 | 782 | // Change status to 'submitted'. |
783 | - $application->application_status_id = ApplicationStatus::where('name', 'submitted')->firstOrFail()->id; |
|
783 | + $application->application_status_id = ApplicationStatus::where ('name', 'submitted')->firstOrFail ()->id; |
|
784 | 784 | } |
785 | 785 | |
786 | - $application->save(); |
|
786 | + $application->save (); |
|
787 | 787 | |
788 | 788 | // Redirect to correct page. |
789 | - switch ($request->input('submit')) { |
|
789 | + switch ($request->input ('submit')) { |
|
790 | 790 | case 'save_and_quit': |
791 | - return redirect()->route('applications.index'); |
|
791 | + return redirect ()->route ('applications.index'); |
|
792 | 792 | break; |
793 | 793 | case 'submit': |
794 | - return redirect()->route('job.application.complete', $jobPoster); |
|
794 | + return redirect ()->route ('job.application.complete', $jobPoster); |
|
795 | 795 | break; |
796 | 796 | case 'previous': |
797 | - return redirect()->route('job.application.edit.4', $jobPoster); |
|
797 | + return redirect ()->route ('job.application.edit.4', $jobPoster); |
|
798 | 798 | break; |
799 | 799 | default: |
800 | - return redirect()->back()->withInput(); |
|
800 | + return redirect ()->back ()->withInput (); |
|
801 | 801 | } |
802 | 802 | } |
803 | 803 | } |
@@ -19,29 +19,29 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function store(Request $request) |
21 | 21 | { |
22 | - $this->authorize('create', RatingGuideQuestion::class); |
|
22 | + $this->authorize ('create', RatingGuideQuestion::class); |
|
23 | 23 | |
24 | - $job_poster_id = (int)$request->json('job_poster_id'); |
|
25 | - $assessment_type_id = (int)$request->json('assessment_type_id'); |
|
26 | - $question = $request->json('question'); |
|
24 | + $job_poster_id = (int)$request->json ('job_poster_id'); |
|
25 | + $assessment_type_id = (int)$request->json ('assessment_type_id'); |
|
26 | + $question = $request->json ('question'); |
|
27 | 27 | |
28 | - JobPoster::findOrFail($job_poster_id); |
|
29 | - AssessmentType::findOrFail($assessment_type_id); |
|
28 | + JobPoster::findOrFail ($job_poster_id); |
|
29 | + AssessmentType::findOrFail ($assessment_type_id); |
|
30 | 30 | |
31 | - $ratingGuideQuestion = new RatingGuideQuestion([ |
|
31 | + $ratingGuideQuestion = new RatingGuideQuestion ([ |
|
32 | 32 | 'job_poster_id' => $job_poster_id, |
33 | 33 | 'assessment_type_id' => $assessment_type_id, |
34 | 34 | 'question' => $question, |
35 | 35 | ]); |
36 | 36 | // Check that this user is allowed to create an Assessment for this criterion. |
37 | - $this->authorize('update', $ratingGuideQuestion); |
|
37 | + $this->authorize ('update', $ratingGuideQuestion); |
|
38 | 38 | |
39 | - $ratingGuideQuestion->save(); |
|
40 | - $ratingGuideQuestion->refresh(); |
|
39 | + $ratingGuideQuestion->save (); |
|
40 | + $ratingGuideQuestion->refresh (); |
|
41 | 41 | |
42 | 42 | return [ |
43 | 43 | 'success' => "Successfully created rating guide question $ratingGuideQuestion->id", |
44 | - 'rating_guide_question' => $ratingGuideQuestion->toArray(), |
|
44 | + 'rating_guide_question' => $ratingGuideQuestion->toArray (), |
|
45 | 45 | ]; |
46 | 46 | } |
47 | 47 | |
@@ -53,12 +53,12 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function show(RatingGuideQuestion $ratingGuideQuestion) |
55 | 55 | { |
56 | - $this->authorize('view', $ratingGuideQuestion); |
|
57 | - $ratingGuideQuestion->load([ |
|
56 | + $this->authorize ('view', $ratingGuideQuestion); |
|
57 | + $ratingGuideQuestion->load ([ |
|
58 | 58 | 'job_poster', |
59 | 59 | 'assessment_type' |
60 | 60 | ]); |
61 | - return $ratingGuideQuestion->toArray(); |
|
61 | + return $ratingGuideQuestion->toArray (); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -71,23 +71,23 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function update(Request $request, RatingGuideQuestion $ratingGuideQuestion) |
73 | 73 | { |
74 | - $this->authorize('update', $ratingGuideQuestion); |
|
74 | + $this->authorize ('update', $ratingGuideQuestion); |
|
75 | 75 | |
76 | - $job_poster_id = (int)$request->json('job_poster_id'); |
|
77 | - $assessment_type_id = (int)$request->json('assessment_type_id'); |
|
78 | - $question = $request->json('question'); |
|
76 | + $job_poster_id = (int)$request->json ('job_poster_id'); |
|
77 | + $assessment_type_id = (int)$request->json ('assessment_type_id'); |
|
78 | + $question = $request->json ('question'); |
|
79 | 79 | |
80 | - JobPoster::findOrFail($job_poster_id); |
|
81 | - AssessmentType::findOrFail($assessment_type_id); |
|
80 | + JobPoster::findOrFail ($job_poster_id); |
|
81 | + AssessmentType::findOrFail ($assessment_type_id); |
|
82 | 82 | |
83 | 83 | $ratingGuideQuestion->job_poster_id = $job_poster_id; |
84 | 84 | $ratingGuideQuestion->assessment_type_id = $assessment_type_id; |
85 | 85 | $ratingGuideQuestion->question = $question; |
86 | - $ratingGuideQuestion->save(); |
|
86 | + $ratingGuideQuestion->save (); |
|
87 | 87 | |
88 | 88 | return [ |
89 | 89 | 'success' => "Successfully updated rating guide question $ratingGuideQuestion->id", |
90 | - 'rating_guide_question' => $ratingGuideQuestion->toArray(), |
|
90 | + 'rating_guide_question' => $ratingGuideQuestion->toArray (), |
|
91 | 91 | ]; |
92 | 92 | } |
93 | 93 | |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function destroy(RatingGuideQuestion $ratingGuideQuestion) |
101 | 101 | { |
102 | - $this->authorize('delete', $ratingGuideQuestion); |
|
103 | - $ratingGuideQuestion->delete(); |
|
102 | + $this->authorize ('delete', $ratingGuideQuestion); |
|
103 | + $ratingGuideQuestion->delete (); |
|
104 | 104 | |
105 | 105 | return [ |
106 | 106 | 'success' => "Successfully deleted rating guide question $ratingGuideQuestion->id" |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | public function authorize() |
19 | 19 | { |
20 | 20 | // Ensure the user can make answers, question exists, and user is the owner of the question it answers. |
21 | - if ($this->user()->can('create', RatingGuideAnswer::class)) { |
|
22 | - $questionId = (int) $this->input('rating_guide_question_id'); |
|
21 | + if ($this->user ()->can ('create', RatingGuideAnswer::class)) { |
|
22 | + $questionId = (int)$this->input ('rating_guide_question_id'); |
|
23 | 23 | if ($questionId) { |
24 | - $question = RatingGuideQuestion::find($questionId); |
|
25 | - return $question && $this->user()->can('update', $question); |
|
24 | + $question = RatingGuideQuestion::find ($questionId); |
|
25 | + return $question && $this->user ()->can ('update', $question); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | public function rules() |
38 | 38 | { |
39 | 39 | return [ |
40 | - 'rating_guide_question_id' => ['required', new ValidIdRule(RatingGuideQuestion::class)], |
|
41 | - 'criterion_id' => ['nullable', new ValidIdRule(Criteria::class)], |
|
40 | + 'rating_guide_question_id' => ['required', new ValidIdRule (RatingGuideQuestion::class)], |
|
41 | + 'criterion_id' => ['nullable', new ValidIdRule (Criteria::class)], |
|
42 | 42 | 'expected_answer' => 'nullable|string', |
43 | 43 | ]; |
44 | 44 | } |
@@ -12,11 +12,11 @@ |
||
12 | 12 | * @param \Closure $next |
13 | 13 | * @return mixed |
14 | 14 | */ |
15 | - public function handle($request, Closure $next) { |
|
15 | + public function handle($request, Closure $next){ |
|
16 | 16 | |
17 | - $response = $next($request); |
|
17 | + $response = $next ($request); |
|
18 | 18 | |
19 | - $response->headers->set('X-Frame-Options', 'SAMEORIGIN'); |
|
19 | + $response->headers->set ('X-Frame-Options', 'SAMEORIGIN'); |
|
20 | 20 | |
21 | 21 | return $response; |
22 | 22 | } |
@@ -65,9 +65,9 @@ discard block |
||
65 | 65 | */ |
66 | 66 | protected function defineGates(): void |
67 | 67 | { |
68 | - Gate::define('view-assessment-plan', function ($user, $jobPoster) { |
|
69 | - return $user->isAdmin() || |
|
70 | - $user->isManager() && $jobPoster->manager->user_id === $user->id; |
|
68 | + Gate::define ('view-assessment-plan', function ($user, $jobPoster){ |
|
69 | + return $user->isAdmin () || |
|
70 | + $user->isManager () && $jobPoster->manager->user_id === $user->id; |
|
71 | 71 | }); |
72 | 72 | } |
73 | 73 | |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function boot(): void |
84 | 84 | { |
85 | - $this->registerPolicies(); |
|
85 | + $this->registerPolicies (); |
|
86 | 86 | |
87 | - $this->defineGates(); |
|
87 | + $this->defineGates (); |
|
88 | 88 | } |
89 | 89 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @property \Illuminate\Database\Eloquent\Collection $projects |
26 | 26 | * @property \Illuminate\Database\Eloquent\Collection $skill_declaractions |
27 | 27 | */ |
28 | -class Reference extends BaseModel { |
|
28 | +class Reference extends BaseModel{ |
|
29 | 29 | |
30 | 30 | protected $casts = [ |
31 | 31 | 'name' => 'string', |
@@ -41,20 +41,20 @@ discard block |
||
41 | 41 | 'description' |
42 | 42 | ]; |
43 | 43 | |
44 | - public function relationship() { |
|
45 | - return $this->belongsTo(\App\Models\Lookup\Relationship::class); |
|
44 | + public function relationship(){ |
|
45 | + return $this->belongsTo (\App\Models\Lookup\Relationship::class); |
|
46 | 46 | } |
47 | 47 | |
48 | - public function applicant() { |
|
49 | - return $this->belongsTo(\App\Models\Applicant::class); |
|
48 | + public function applicant(){ |
|
49 | + return $this->belongsTo (\App\Models\Applicant::class); |
|
50 | 50 | } |
51 | 51 | |
52 | - public function projects() { |
|
53 | - return $this->belongsToMany(\App\Models\Project::class); |
|
52 | + public function projects(){ |
|
53 | + return $this->belongsToMany (\App\Models\Project::class); |
|
54 | 54 | } |
55 | 55 | |
56 | - public function skill_declarations() { |
|
57 | - return $this->belongsToMany(\App\Models\SkillDeclaration::class); |
|
56 | + public function skill_declarations(){ |
|
57 | + return $this->belongsToMany (\App\Models\SkillDeclaration::class); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | } |
@@ -37,15 +37,15 @@ |
||
37 | 37 | */ |
38 | 38 | protected $with = ['review_status']; |
39 | 39 | |
40 | - public function job_application() { |
|
41 | - return $this->belongsTo(JobApplication::class); |
|
40 | + public function job_application(){ |
|
41 | + return $this->belongsTo (JobApplication::class); |
|
42 | 42 | } |
43 | 43 | |
44 | - public function review_status() { |
|
45 | - return $this->belongsTo(ReviewStatus::class); |
|
44 | + public function review_status(){ |
|
45 | + return $this->belongsTo (ReviewStatus::class); |
|
46 | 46 | } |
47 | 47 | |
48 | - public function getStatusAttribute() { |
|
48 | + public function getStatusAttribute(){ |
|
49 | 49 | return $this->review_status->translation; |
50 | 50 | } |
51 | 51 | } |