@@ -64,7 +64,7 @@ |
||
64 | 64 | |
65 | 65 | View::composer( |
66 | 66 | ['common/relatives','common/reference','common/relatives-projects', |
67 | - 'common/sample', 'common/skill', 'common/modals/create_reference'], |
|
67 | + 'common/sample', 'common/skill', 'common/modals/create_reference'], |
|
68 | 68 | 'App\Http\ViewComposers\RelativeComposer' |
69 | 69 | ); |
70 | 70 |
@@ -16,89 +16,89 @@ discard block |
||
16 | 16 | public function boot() |
17 | 17 | { |
18 | 18 | // Site Under Construction header bar. |
19 | - View::composer( |
|
19 | + View::composer ( |
|
20 | 20 | 'common/alert', |
21 | 21 | 'App\Http\ViewComposers\AlertComposer' |
22 | 22 | ); |
23 | 23 | |
24 | 24 | // Pass App locale to all views. |
25 | - View::share('appLocale', App::getLocale()); |
|
25 | + View::share ('appLocale', App::getLocale ()); |
|
26 | 26 | |
27 | 27 | // Governement of Canada header bar. |
28 | - View::composer( |
|
28 | + View::composer ( |
|
29 | 29 | 'common/goc', |
30 | 30 | 'App\Http\ViewComposers\GocComposer' |
31 | 31 | ); |
32 | 32 | |
33 | 33 | // Nav menu. |
34 | - View::composer( |
|
34 | + View::composer ( |
|
35 | 35 | '*', |
36 | 36 | 'App\Http\ViewComposers\MenuComposer' |
37 | 37 | ); |
38 | 38 | |
39 | 39 | // Sitewide Footer. |
40 | - View::composer( |
|
40 | + View::composer ( |
|
41 | 41 | 'common/footer', |
42 | 42 | 'App\Http\ViewComposers\FooterComposer' |
43 | 43 | ); |
44 | 44 | |
45 | - View::composer( |
|
45 | + View::composer ( |
|
46 | 46 | 'applicant/profile/menu', |
47 | 47 | 'App\Http\ViewComposers\ApplicantProfileMenuComposer' |
48 | 48 | ); |
49 | 49 | |
50 | - View::composer( |
|
50 | + View::composer ( |
|
51 | 51 | ['common/skill', 'common/relatives', 'applicant/job_post/criteria', 'common/modals/skills_need_help'], |
52 | 52 | 'App\Http\ViewComposers\SkillComposer' |
53 | 53 | ); |
54 | 54 | |
55 | - View::composer( |
|
55 | + View::composer ( |
|
56 | 56 | ['common/reference', 'common/modals/create_reference'], |
57 | 57 | 'App\Http\ViewComposers\ReferenceComposer' |
58 | 58 | ); |
59 | 59 | |
60 | - View::composer( |
|
60 | + View::composer ( |
|
61 | 61 | ['common/sample', 'common/modals/create_sample'], |
62 | 62 | 'App\Http\ViewComposers\WorkSampleComposer' |
63 | 63 | ); |
64 | 64 | |
65 | - View::composer( |
|
66 | - ['common/relatives','common/reference','common/relatives-projects', |
|
65 | + View::composer ( |
|
66 | + ['common/relatives', 'common/reference', 'common/relatives-projects', |
|
67 | 67 | 'common/sample', 'common/skill', 'common/modals/create_reference'], |
68 | 68 | 'App\Http\ViewComposers\RelativeComposer' |
69 | 69 | ); |
70 | 70 | |
71 | - View::composer( |
|
71 | + View::composer ( |
|
72 | 72 | 'common/lang_menu', |
73 | 73 | 'App\Http\ViewComposers\LangMenuComposer' |
74 | 74 | ); |
75 | 75 | |
76 | - View::composer( |
|
76 | + View::composer ( |
|
77 | 77 | ['applicant/application_post/common/tracker', 'applicant/application_post/common/tracker-ajax'], |
78 | 78 | 'App\Http\ViewComposers\ApplicationTrackerComposer' |
79 | 79 | ); |
80 | 80 | |
81 | - View::composer( |
|
81 | + View::composer ( |
|
82 | 82 | 'common/degree', |
83 | 83 | 'App\Http\ViewComposers\DegreeComposer' |
84 | 84 | ); |
85 | 85 | |
86 | - View::composer( |
|
86 | + View::composer ( |
|
87 | 87 | 'common/course', |
88 | 88 | 'App\Http\ViewComposers\CourseComposer' |
89 | 89 | ); |
90 | 90 | |
91 | - View::composer( |
|
91 | + View::composer ( |
|
92 | 92 | 'common/work', |
93 | 93 | 'App\Http\ViewComposers\WorkExperienceComposer' |
94 | 94 | ); |
95 | 95 | |
96 | - View::composer( |
|
96 | + View::composer ( |
|
97 | 97 | 'manager/notification', |
98 | 98 | 'App\Http\ViewComposers\DemoNotificationComposer' |
99 | 99 | ); |
100 | 100 | |
101 | - View::composer( |
|
101 | + View::composer ( |
|
102 | 102 | 'manager/*', |
103 | 103 | 'App\Http\ViewComposers\ManagerPortalComposer' |
104 | 104 | ); |
@@ -111,10 +111,10 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function register() : void |
113 | 113 | { |
114 | - $this->app->singleton(\App\Http\ViewComposers\CourseComposer::class); |
|
115 | - $this->app->singleton(\App\Http\ViewComposers\DegreeComposer::class); |
|
116 | - $this->app->singleton(\App\Http\ViewComposers\ReferenceComposer::class); |
|
117 | - $this->app->singleton(\App\Http\ViewComposers\SkillComposer::class); |
|
118 | - $this->app->singleton(\App\Http\ViewComposers\WorkSampleComposer::class); |
|
114 | + $this->app->singleton (\App\Http\ViewComposers\CourseComposer::class); |
|
115 | + $this->app->singleton (\App\Http\ViewComposers\DegreeComposer::class); |
|
116 | + $this->app->singleton (\App\Http\ViewComposers\ReferenceComposer::class); |
|
117 | + $this->app->singleton (\App\Http\ViewComposers\SkillComposer::class); |
|
118 | + $this->app->singleton (\App\Http\ViewComposers\WorkSampleComposer::class); |
|
119 | 119 | } |
120 | 120 | } |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | protected function mapWebRoutes() |
56 | 56 | { |
57 | 57 | Route::middleware('web') |
58 | - ->namespace($this->namespace) |
|
59 | - ->group(base_path('routes/web.php')); |
|
58 | + ->namespace($this->namespace) |
|
59 | + ->group(base_path('routes/web.php')); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | protected function mapApiRoutes() |
70 | 70 | { |
71 | 71 | Route::prefix('api') |
72 | - ->middleware('api') |
|
73 | - ->namespace($this->namespace) |
|
74 | - ->group(base_path('routes/api.php')); |
|
72 | + ->middleware('api') |
|
73 | + ->namespace($this->namespace) |
|
74 | + ->group(base_path('routes/api.php')); |
|
75 | 75 | } |
76 | 76 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | { |
29 | 29 | // |
30 | 30 | |
31 | - parent::boot(); |
|
31 | + parent::boot (); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function map() |
40 | 40 | { |
41 | - $this->mapApiRoutes(); |
|
41 | + $this->mapApiRoutes (); |
|
42 | 42 | |
43 | - $this->mapWebRoutes(); |
|
43 | + $this->mapWebRoutes (); |
|
44 | 44 | |
45 | 45 | // |
46 | 46 | } |
@@ -54,9 +54,9 @@ discard block |
||
54 | 54 | */ |
55 | 55 | protected function mapWebRoutes() |
56 | 56 | { |
57 | - Route::middleware('web') |
|
58 | - ->namespace($this->namespace) |
|
59 | - ->group(base_path('routes/web.php')); |
|
57 | + Route::middleware ('web') |
|
58 | + ->namespace ($this->namespace) |
|
59 | + ->group (base_path ('routes/web.php')); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | */ |
69 | 69 | protected function mapApiRoutes() |
70 | 70 | { |
71 | - Route::prefix('api') |
|
72 | - ->middleware('api') |
|
73 | - ->namespace($this->namespace) |
|
74 | - ->group(base_path('routes/api.php')); |
|
71 | + Route::prefix ('api') |
|
72 | + ->middleware ('api') |
|
73 | + ->namespace ($this->namespace) |
|
74 | + ->group (base_path ('routes/api.php')); |
|
75 | 75 | } |
76 | 76 | } |
@@ -198,12 +198,12 @@ |
||
198 | 198 | 'logout_link' => route('manager.logout'), |
199 | 199 | ]; |
200 | 200 | } elseif (WhichPortal::isAdminPortal()) { |
201 | - $loginModals = [ |
|
201 | + $loginModals = [ |
|
202 | 202 | 'modals' => Lang::get('common/login_modals'), |
203 | 203 | 'register_link' => route('register'), |
204 | 204 | 'login_link' => backpack_url('login'), |
205 | 205 | 'logout_link' => backpack_url('logout'), |
206 | - ]; |
|
206 | + ]; |
|
207 | 207 | } else { |
208 | 208 | $loginModals = [ |
209 | 209 | 'modals' => Lang::get('common/login_modals'), |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function compose(View $view) |
20 | 20 | { |
21 | - if (WhichPortal::isApplicantPortal()) { |
|
22 | - $menu = Lang::get('applicant/menu'); |
|
21 | + if (WhichPortal::isApplicantPortal ()) { |
|
22 | + $menu = Lang::get ('applicant/menu'); |
|
23 | 23 | |
24 | 24 | // Set active on the proper item |
25 | - switch (Route::currentRouteName()) { |
|
25 | + switch (Route::currentRouteName ()) { |
|
26 | 26 | case 'home': |
27 | 27 | $menu['items']['home']['active'] = true; |
28 | 28 | break; |
@@ -82,15 +82,15 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | // Set route links |
85 | - $menu['items']['home']['link'] = route('home'); |
|
86 | - $menu['items']['jobs']['link'] = route('jobs.index'); |
|
87 | - $menu['items']['applications']['link'] = route('applications.index'); |
|
88 | - $menu['items']['profile']['link'] = route('profile'); |
|
89 | - $menu['items']['faq']['link'] = route('faq'); |
|
90 | - $menu['items']['itp']['link'] = route('itp'); |
|
85 | + $menu['items']['home']['link'] = route ('home'); |
|
86 | + $menu['items']['jobs']['link'] = route ('jobs.index'); |
|
87 | + $menu['items']['applications']['link'] = route ('applications.index'); |
|
88 | + $menu['items']['profile']['link'] = route ('profile'); |
|
89 | + $menu['items']['faq']['link'] = route ('faq'); |
|
90 | + $menu['items']['itp']['link'] = route ('itp'); |
|
91 | 91 | |
92 | 92 | // Check if use is logged in, and remove invalid menu items |
93 | - if (Auth::check()) { |
|
93 | + if (Auth::check ()) { |
|
94 | 94 | unset($menu['items']['login']); |
95 | 95 | unset($menu['items']['register']); |
96 | 96 | // TODO set profile like using user slug |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | unset($menu['items']['applications']); |
100 | 100 | unset($menu['items']['profile']); |
101 | 101 | } |
102 | - } elseif (WhichPortal::isManagerPortal()) { |
|
103 | - $menu = Lang::get('manager/menu'); |
|
102 | + } elseif (WhichPortal::isManagerPortal ()) { |
|
103 | + $menu = Lang::get ('manager/menu'); |
|
104 | 104 | |
105 | 105 | // Set active on the proper item |
106 | - switch (Route::currentRouteName()) { |
|
106 | + switch (Route::currentRouteName ()) { |
|
107 | 107 | case 'manager.home': |
108 | 108 | $menu['items']['home']['active'] = true; |
109 | 109 | break; |
@@ -144,15 +144,15 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | // Set route links |
147 | - $menu['items']['home']['link'] = route('manager.home'); |
|
148 | - $menu['items']['jobs']['link'] = route('manager.jobs.index'); |
|
147 | + $menu['items']['home']['link'] = route ('manager.home'); |
|
148 | + $menu['items']['jobs']['link'] = route ('manager.jobs.index'); |
|
149 | 149 | // TODO: restore when job poster builder complete |
150 | 150 | // $menu['items']['create_job']['link'] = route('manager.jobs.create'); |
151 | - $menu['items']['profile']['link'] = route('manager.profile'); |
|
152 | - $menu['items']['faq']['link'] = route('manager.faq.section'); |
|
151 | + $menu['items']['profile']['link'] = route ('manager.profile'); |
|
152 | + $menu['items']['faq']['link'] = route ('manager.faq.section'); |
|
153 | 153 | |
154 | 154 | // Check if use is logged in, and remove invalid menu items |
155 | - if (Auth::check()) { |
|
155 | + if (Auth::check ()) { |
|
156 | 156 | unset($menu['items']['login']); |
157 | 157 | unset($menu['items']['register']); |
158 | 158 | // TODO set profile like using user slug |
@@ -162,13 +162,13 @@ discard block |
||
162 | 162 | unset($menu['items']['create_job']); |
163 | 163 | unset($menu['items']['profile']); |
164 | 164 | } |
165 | - } elseif (WhichPortal::isAdminPortal()) { |
|
165 | + } elseif (WhichPortal::isAdminPortal ()) { |
|
166 | 166 | // Use the manager menu, keeping only |
167 | - $menu = Lang::get('admin/menu'); |
|
167 | + $menu = Lang::get ('admin/menu'); |
|
168 | 168 | |
169 | 169 | |
170 | 170 | // Set active on the proper item |
171 | - switch (Route::currentRouteName()) { |
|
171 | + switch (Route::currentRouteName ()) { |
|
172 | 172 | case 'admin.home': |
173 | 173 | $menu['items']['home']['active'] = true; |
174 | 174 | break; |
@@ -178,10 +178,10 @@ discard block |
||
178 | 178 | } |
179 | 179 | |
180 | 180 | // Set route links |
181 | - $menu['items']['home']['link'] = backpack_url(); |
|
181 | + $menu['items']['home']['link'] = backpack_url (); |
|
182 | 182 | |
183 | 183 | // Check if use is logged in, and remove invalid menu items |
184 | - if (Auth::check()) { |
|
184 | + if (Auth::check ()) { |
|
185 | 185 | unset($menu['items']['login']); |
186 | 186 | unset($menu['items']['register']); |
187 | 187 | // TODO set profile like using user slug |
@@ -190,30 +190,30 @@ discard block |
||
190 | 190 | } |
191 | 191 | } |
192 | 192 | // Set login modals data |
193 | - if (WhichPortal::isManagerPortal()) { |
|
193 | + if (WhichPortal::isManagerPortal ()) { |
|
194 | 194 | $loginModals = [ |
195 | - 'modals' => Lang::get('common/login_modals'), |
|
196 | - 'register_link' => route('manager.register'), |
|
197 | - 'login_link' => route('manager.login'), |
|
198 | - 'logout_link' => route('manager.logout'), |
|
195 | + 'modals' => Lang::get ('common/login_modals'), |
|
196 | + 'register_link' => route ('manager.register'), |
|
197 | + 'login_link' => route ('manager.login'), |
|
198 | + 'logout_link' => route ('manager.logout'), |
|
199 | 199 | ]; |
200 | - } elseif (WhichPortal::isAdminPortal()) { |
|
200 | + } elseif (WhichPortal::isAdminPortal ()) { |
|
201 | 201 | $loginModals = [ |
202 | - 'modals' => Lang::get('common/login_modals'), |
|
203 | - 'register_link' => route('register'), |
|
204 | - 'login_link' => backpack_url('login'), |
|
205 | - 'logout_link' => backpack_url('logout'), |
|
202 | + 'modals' => Lang::get ('common/login_modals'), |
|
203 | + 'register_link' => route ('register'), |
|
204 | + 'login_link' => backpack_url ('login'), |
|
205 | + 'logout_link' => backpack_url ('logout'), |
|
206 | 206 | ]; |
207 | 207 | } else { |
208 | 208 | $loginModals = [ |
209 | - 'modals' => Lang::get('common/login_modals'), |
|
210 | - 'register_link' => route('register'), |
|
211 | - 'login_link' => route('login'), |
|
212 | - 'logout_link' => route('logout'), |
|
209 | + 'modals' => Lang::get ('common/login_modals'), |
|
210 | + 'register_link' => route ('register'), |
|
211 | + 'login_link' => route ('login'), |
|
212 | + 'logout_link' => route ('logout'), |
|
213 | 213 | ]; |
214 | 214 | } |
215 | 215 | |
216 | - $view->with('menu', $menu) |
|
217 | - ->with('login_modals', $loginModals); |
|
216 | + $view->with ('menu', $menu) |
|
217 | + ->with ('login_modals', $loginModals); |
|
218 | 218 | } |
219 | 219 | } |
@@ -6,11 +6,11 @@ |
||
6 | 6 | class Authenticate extends Middleware |
7 | 7 | { |
8 | 8 | /** |
9 | - * Get the path the user should be redirected to when they are not authenticated. |
|
10 | - * |
|
11 | - * @param \Illuminate\Http\Request $request |
|
12 | - * @return string |
|
13 | - */ |
|
9 | + * Get the path the user should be redirected to when they are not authenticated. |
|
10 | + * |
|
11 | + * @param \Illuminate\Http\Request $request |
|
12 | + * @return string |
|
13 | + */ |
|
14 | 14 | protected function redirectTo($request) |
15 | 15 | { |
16 | 16 | if (WhichPortal::isManagerPortal()) { |
@@ -13,10 +13,10 @@ |
||
13 | 13 | */ |
14 | 14 | protected function redirectTo($request) |
15 | 15 | { |
16 | - if (WhichPortal::isManagerPortal()) { |
|
17 | - return route('manager.login'); |
|
16 | + if (WhichPortal::isManagerPortal ()) { |
|
17 | + return route ('manager.login'); |
|
18 | 18 | } else { |
19 | - return route('login'); |
|
19 | + return route ('login'); |
|
20 | 20 | } |
21 | 21 | } |
22 | 22 | } |
@@ -50,6 +50,6 @@ |
||
50 | 50 | ) |
51 | 51 | ); |
52 | 52 | } |
53 | - return $response; |
|
53 | + return $response; |
|
54 | 54 | } |
55 | 55 | } |
@@ -35,12 +35,12 @@ |
||
35 | 35 | protected function addCookieToResponse($request, $response) |
36 | 36 | { |
37 | 37 | if ($this->addHttpCookie) { |
38 | - $config = config('session'); |
|
39 | - $response->headers->setCookie( |
|
40 | - new Cookie( |
|
38 | + $config = config ('session'); |
|
39 | + $response->headers->setCookie ( |
|
40 | + new Cookie ( |
|
41 | 41 | 'XSRF-TOKEN', |
42 | - $request->session()->token(), |
|
43 | - $this->availableAt(60 * $config['lifetime']), |
|
42 | + $request->session ()->token (), |
|
43 | + $this->availableAt (60 * $config['lifetime']), |
|
44 | 44 | $config['path'], |
45 | 45 | $config['domain'], |
46 | 46 | $config['secure'], |
@@ -12,11 +12,11 @@ |
||
12 | 12 | class CriteriaController extends Controller |
13 | 13 | { |
14 | 14 | /** |
15 | - * Converts a Criteria to the shape sent and received by the api. |
|
16 | - * |
|
17 | - * @param Criteria $model |
|
18 | - * @return void |
|
19 | - */ |
|
15 | + * Converts a Criteria to the shape sent and received by the api. |
|
16 | + * |
|
17 | + * @param Criteria $model |
|
18 | + * @return void |
|
19 | + */ |
|
20 | 20 | public function toApiArray(Criteria $model) |
21 | 21 | { |
22 | 22 | return array_merge($model->toArray(), $model->getTranslations()); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function toApiArray(Criteria $model) |
21 | 21 | { |
22 | - return array_merge($model->toArray(), $model->getTranslations()); |
|
22 | + return array_merge ($model->toArray (), $model->getTranslations ()); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | public function indexByJob(JobPoster $jobPoster) |
32 | 32 | { |
33 | 33 | $toApiArray = array($this, 'toApiArray'); |
34 | - $criteriaArray = Criteria::where('job_poster_id', $jobPoster->id)->get()->map($toApiArray); |
|
35 | - return response()->json($criteriaArray); |
|
34 | + $criteriaArray = Criteria::where ('job_poster_id', $jobPoster->id)->get ()->map ($toApiArray); |
|
35 | + return response ()->json ($criteriaArray); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -46,39 +46,39 @@ discard block |
||
46 | 46 | { |
47 | 47 | $toApiArray = array($this, 'toApiArray'); |
48 | 48 | |
49 | - $newCriteria = collect($request->input()); // TODO: switch to validated |
|
49 | + $newCriteria = collect ($request->input ()); // TODO: switch to validated |
|
50 | 50 | $oldCriteria = $jobPoster->criteria; |
51 | 51 | |
52 | 52 | $updatedIds = []; |
53 | 53 | |
54 | 54 | // First, delete old criteria that weren't resubmitted, and update those that were |
55 | 55 | foreach ($oldCriteria as $criteria) { |
56 | - $newData = $newCriteria->firstWhere('id', $criteria['id']); |
|
56 | + $newData = $newCriteria->firstWhere ('id', $criteria['id']); |
|
57 | 57 | if ($newData) { |
58 | 58 | $updatedIds[] = $criteria->id; |
59 | - $this->updateCriteria($criteria, $newData); |
|
59 | + $this->updateCriteria ($criteria, $newData); |
|
60 | 60 | } else { |
61 | - $this->deleteCriteria($criteria); |
|
61 | + $this->deleteCriteria ($criteria); |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | |
65 | 65 | $isUnsaved = function ($criteria, $savedIds): bool { |
66 | - return !array_key_exists('id', $criteria) || !in_array($criteria['id'], $savedIds); |
|
66 | + return !array_key_exists ('id', $criteria) || !in_array ($criteria['id'], $savedIds); |
|
67 | 67 | }; |
68 | 68 | |
69 | 69 | // Now, save any new criteria that remain |
70 | 70 | foreach ($newCriteria as $criteriaData) { |
71 | - if ($isUnsaved($criteriaData, $updatedIds)) { |
|
72 | - $criteria = new Criteria(); |
|
71 | + if ($isUnsaved ($criteriaData, $updatedIds)) { |
|
72 | + $criteria = new Criteria (); |
|
73 | 73 | $criteria->job_poster_id = $jobPoster->id; |
74 | - $fillableData = collect($criteriaData)->except(['id', 'job_poster_id'])->toArray(); |
|
75 | - $criteria->fill($fillableData); |
|
76 | - $this->createCriteria($criteria); |
|
74 | + $fillableData = collect ($criteriaData)->except (['id', 'job_poster_id'])->toArray (); |
|
75 | + $criteria->fill ($fillableData); |
|
76 | + $this->createCriteria ($criteria); |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 | |
80 | - $criteriaArray = Criteria::where('job_poster_id', $jobPoster->id)->get()->map($toApiArray); |
|
81 | - return response()->json($criteriaArray); |
|
80 | + $criteriaArray = Criteria::where ('job_poster_id', $jobPoster->id)->get ()->map ($toApiArray); |
|
81 | + return response ()->json ($criteriaArray); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -89,13 +89,13 @@ discard block |
||
89 | 89 | */ |
90 | 90 | protected function createCriteria(Criteria $criteria) |
91 | 91 | { |
92 | - $criteria->save(); |
|
92 | + $criteria->save (); |
|
93 | 93 | |
94 | - $notification = $this->makeAssessmentPlanNotification( |
|
94 | + $notification = $this->makeAssessmentPlanNotification ( |
|
95 | 95 | 'CREATE', |
96 | 96 | $criteria |
97 | 97 | ); |
98 | - $notification->save(); |
|
98 | + $notification->save (); |
|
99 | 99 | |
100 | 100 | return $criteria; |
101 | 101 | } |
@@ -113,19 +113,19 @@ discard block |
||
113 | 113 | if ($oldCriteria->skill_level_id != $newData['skill_level_id'] |
114 | 114 | || $oldCriteria->skill_id != $newData['skill_id'] |
115 | 115 | ) { |
116 | - $notification = $this->makeAssessmentPlanNotification( |
|
116 | + $notification = $this->makeAssessmentPlanNotification ( |
|
117 | 117 | 'UPDATE', |
118 | 118 | $oldCriteria, |
119 | 119 | $newData['skill_id'], |
120 | 120 | $newData['skill_level_id'], |
121 | 121 | $newData['criteria_type_id'] |
122 | 122 | ); |
123 | - $notification->save(); |
|
123 | + $notification->save (); |
|
124 | 124 | } |
125 | 125 | // Get just the data that can be changed |
126 | - $fillableData = collect($newData)->except(['id', 'job_poster_id'])->toArray(); |
|
127 | - $oldCriteria->fill($fillableData); |
|
128 | - $oldCriteria->save(); |
|
126 | + $fillableData = collect ($newData)->except (['id', 'job_poster_id'])->toArray (); |
|
127 | + $oldCriteria->fill ($fillableData); |
|
128 | + $oldCriteria->save (); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -136,15 +136,15 @@ discard block |
||
136 | 136 | */ |
137 | 137 | protected function deleteCriteria(Criteria $criteria): void |
138 | 138 | { |
139 | - $notification = $notification = $this->makeAssessmentPlanNotification( |
|
139 | + $notification = $notification = $this->makeAssessmentPlanNotification ( |
|
140 | 140 | 'DELETE', |
141 | 141 | $criteria |
142 | 142 | ); |
143 | - $notification->save(); |
|
143 | + $notification->save (); |
|
144 | 144 | |
145 | 145 | // Delete assessments related to this criteria. |
146 | - Assessment::where('criterion_id', $criteria->id)->delete(); |
|
147 | - $criteria->delete(); |
|
146 | + Assessment::where ('criterion_id', $criteria->id)->delete (); |
|
147 | + $criteria->delete (); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -163,8 +163,8 @@ discard block |
||
163 | 163 | $newSkillId = null, |
164 | 164 | $newSkillLevelId = null, |
165 | 165 | $newCriteriaTypeId = null |
166 | - ) { |
|
167 | - $notification = new AssessmentPlanNotification(); |
|
166 | + ){ |
|
167 | + $notification = new AssessmentPlanNotification (); |
|
168 | 168 | $notification->job_poster_id = $criteria->job_poster_id; |
169 | 169 | $notification->type = $type; |
170 | 170 | $notification->criteria_id = $criteria->id; |
@@ -29,7 +29,7 @@ |
||
29 | 29 | * Convert a job poster to the array expected by API requests, |
30 | 30 | * with all criteria, |
31 | 31 | * and with translation arrays in both languages. |
32 | - * |
|
32 | + * |
|
33 | 33 | * @param \App\Models\JobPoster $job Incoming Job Poster object. |
34 | 34 | * @return mixed[] |
35 | 35 | */ |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | public function __construct() |
23 | 23 | { |
24 | 24 | // This applies the appropriate policy to each resource route. |
25 | - $this->authorizeResource(JobPoster::class, 'job'); |
|
25 | + $this->authorizeResource (JobPoster::class, 'job'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -35,14 +35,14 @@ discard block |
||
35 | 35 | */ |
36 | 36 | private function jobToArray(JobPoster $job) |
37 | 37 | { |
38 | - $criteria = Criteria::where('job_poster_id', $job->id)->get(); |
|
38 | + $criteria = Criteria::where ('job_poster_id', $job->id)->get (); |
|
39 | 39 | |
40 | - $toApiArray = function ($model) { |
|
41 | - return array_merge($model->toArray(), $model->getTranslations()); |
|
40 | + $toApiArray = function ($model){ |
|
41 | + return array_merge ($model->toArray (), $model->getTranslations ()); |
|
42 | 42 | }; |
43 | - $criteriaTranslated = $criteria->map($toApiArray); |
|
43 | + $criteriaTranslated = $criteria->map ($toApiArray); |
|
44 | 44 | |
45 | - $jobArray = array_merge($job->toApiArray(), ['criteria' => $criteriaTranslated]); |
|
45 | + $jobArray = array_merge ($job->toApiArray (), ['criteria' => $criteriaTranslated]); |
|
46 | 46 | return $jobArray; |
47 | 47 | } |
48 | 48 | /** |
@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function store(StoreJobPoster $request) |
65 | 65 | { |
66 | - $data = $request->validated(); |
|
67 | - $job = new JobPoster(); |
|
68 | - $job->manager_id = $request->user()->manager->id; |
|
66 | + $data = $request->validated (); |
|
67 | + $job = new JobPoster (); |
|
68 | + $job->manager_id = $request->user ()->manager->id; |
|
69 | 69 | // Defaulting JPB created Jobs to monthly terms for now. |
70 | - $job->job_term_id = JobTerm::where('name', 'month')->value('id'); |
|
71 | - $job->fill($data); |
|
72 | - $job->save(); |
|
73 | - return response()->json($this->jobToArray($job)); |
|
70 | + $job->job_term_id = JobTerm::where ('name', 'month')->value ('id'); |
|
71 | + $job->fill ($data); |
|
72 | + $job->save (); |
|
73 | + return response ()->json ($this->jobToArray ($job)); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function show(JobPoster $job) |
83 | 83 | { |
84 | - return response()->json($this->jobToArray($job)); |
|
84 | + return response ()->json ($this->jobToArray ($job)); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -93,14 +93,14 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function update(UpdateJobPoster $request, JobPoster $job) |
95 | 95 | { |
96 | - $data = $request->validated(); |
|
96 | + $data = $request->validated (); |
|
97 | 97 | // Only values both in the JobPoster->fillable array, |
98 | 98 | // and returned by UpdateJobPoster->validatedData(), will be set. |
99 | - $job->fill($data); |
|
99 | + $job->fill ($data); |
|
100 | 100 | // Defaulting JPB updated jobs to monthly for now. |
101 | - $job->job_term_id = JobTerm::where('name', 'month')->value('id'); |
|
102 | - $job->save(); |
|
103 | - return response()->json($this->jobToArray($job->fresh())); |
|
101 | + $job->job_term_id = JobTerm::where ('name', 'month')->value ('id'); |
|
102 | + $job->save (); |
|
103 | + return response ()->json ($this->jobToArray ($job->fresh ())); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -125,18 +125,18 @@ discard block |
||
125 | 125 | // Check to avoid submitting for review multiple times. |
126 | 126 | if ($job->review_requested_at === null) { |
127 | 127 | // Update review request timestamp. |
128 | - $job->review_requested_at = new Date(); |
|
129 | - $job->save(); |
|
128 | + $job->review_requested_at = new Date (); |
|
129 | + $job->save (); |
|
130 | 130 | |
131 | 131 | // Send email. |
132 | - $reviewer_email = config('mail.reviewer_email'); |
|
132 | + $reviewer_email = config ('mail.reviewer_email'); |
|
133 | 133 | if (isset($reviewer_email)) { |
134 | - Mail::to($reviewer_email)->send(new JobPosterReviewRequested($job, Auth::user())); |
|
134 | + Mail::to ($reviewer_email)->send (new JobPosterReviewRequested ($job, Auth::user ())); |
|
135 | 135 | } else { |
136 | - Log::error('The reviewer email environment variable is not set.'); |
|
136 | + Log::error ('The reviewer email environment variable is not set.'); |
|
137 | 137 | } |
138 | 138 | } |
139 | 139 | |
140 | - return response()->json($this->jobToArray($job)); |
|
140 | + return response ()->json ($this->jobToArray ($job)); |
|
141 | 141 | } |
142 | 142 | } |
@@ -26,12 +26,12 @@ |
||
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
29 | - * Show the form for editing the applicant's experience |
|
30 | - * |
|
31 | - * @param \Illuminate\Http\Request $request Incoming request object. |
|
32 | - * @param \App\Models\Applicant $applicant Incoming applicant object. |
|
33 | - * @return \Illuminate\Http\Response |
|
34 | - */ |
|
29 | + * Show the form for editing the applicant's experience |
|
30 | + * |
|
31 | + * @param \Illuminate\Http\Request $request Incoming request object. |
|
32 | + * @param \App\Models\Applicant $applicant Incoming applicant object. |
|
33 | + * @return \Illuminate\Http\Response |
|
34 | + */ |
|
35 | 35 | public function edit(Request $request, Applicant $applicant) |
36 | 36 | { |
37 | 37 | return view('applicant/profile_02_experience', [ |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function editAuthenticated(Request $request) |
23 | 23 | { |
24 | - $applicant = $request->user()->applicant; |
|
25 | - return redirect(route('profile.experience.edit', $applicant)); |
|
24 | + $applicant = $request->user ()->applicant; |
|
25 | + return redirect (route ('profile.experience.edit', $applicant)); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function edit(Request $request, Applicant $applicant) |
36 | 36 | { |
37 | - return view('applicant/profile_02_experience', [ |
|
37 | + return view ('applicant/profile_02_experience', [ |
|
38 | 38 | 'applicant' => $applicant, |
39 | - 'profile' => Lang::get('applicant/profile_experience'), |
|
40 | - 'work_template' => Lang::get('common/work_experience'), |
|
41 | - 'form_submit_action' => route('profile.experience.update', $applicant) |
|
39 | + 'profile' => Lang::get ('applicant/profile_experience'), |
|
40 | + 'work_template' => Lang::get ('common/work_experience'), |
|
41 | + 'form_submit_action' => route ('profile.experience.update', $applicant) |
|
42 | 42 | ]); |
43 | 43 | } |
44 | 44 | |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function update(Request $request, Applicant $applicant) |
53 | 53 | { |
54 | - $input = $request->input(); |
|
54 | + $input = $request->input (); |
|
55 | 55 | |
56 | 56 | $degrees = $input['degrees']; |
57 | 57 | |
58 | - $request->validate([ |
|
58 | + $request->validate ([ |
|
59 | 59 | 'degrees.new.*.degree_type_id' => 'required', |
60 | 60 | 'degrees.new.*.area_of_study' => 'required', |
61 | 61 | 'degrees.new.*.institution' => 'required', |
@@ -72,16 +72,16 @@ discard block |
||
72 | 72 | // Check if no degrees were resubmitted, or if this specific one wasn't. |
73 | 73 | if (!isset($degrees['old']) || |
74 | 74 | !isset($degrees['old'][$oldDegree->id])) { |
75 | - $oldDegree->delete(); |
|
75 | + $oldDegree->delete (); |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | 79 | // Save new degrees. |
80 | 80 | if (isset($degrees['new'])) { |
81 | 81 | foreach ($degrees['new'] as $degreeInput) { |
82 | - $degree = new Degree(); |
|
82 | + $degree = new Degree (); |
|
83 | 83 | $degree->applicant_id = $applicant->id; |
84 | - $degree->fill([ |
|
84 | + $degree->fill ([ |
|
85 | 85 | 'degree_type_id' => $degreeInput['degree_type_id'], |
86 | 86 | 'area_of_study' => $degreeInput['area_of_study'], |
87 | 87 | 'institution' => $degreeInput['institution'], |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | 'end_date' => $degreeInput['end_date'], |
91 | 91 | 'blockcert_url' => $degreeInput['blockcert_url'], |
92 | 92 | ]); |
93 | - $degree->save(); |
|
93 | + $degree->save (); |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | |
@@ -98,9 +98,9 @@ discard block |
||
98 | 98 | if (isset($degrees['old'])) { |
99 | 99 | foreach ($degrees['old'] as $id => $degreeInput) { |
100 | 100 | // Ensure this degree belongs to this applicant. |
101 | - $degree = $applicant->degrees->firstWhere('id', $id); |
|
101 | + $degree = $applicant->degrees->firstWhere ('id', $id); |
|
102 | 102 | if ($degree != null) { |
103 | - $degree->fill([ |
|
103 | + $degree->fill ([ |
|
104 | 104 | 'degree_type_id' => $degreeInput['degree_type_id'], |
105 | 105 | 'area_of_study' => $degreeInput['area_of_study'], |
106 | 106 | 'institution' => $degreeInput['institution'], |
@@ -109,16 +109,16 @@ discard block |
||
109 | 109 | 'end_date' => $degreeInput['end_date'], |
110 | 110 | 'blockcert_url' => $degreeInput['blockcert_url'], |
111 | 111 | ]); |
112 | - $degree->save(); |
|
112 | + $degree->save (); |
|
113 | 113 | } else { |
114 | - Log::warning("Applicant $applicant->id attempted to update degree with invalid id: $id"); |
|
114 | + Log::warning ("Applicant $applicant->id attempted to update degree with invalid id: $id"); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | } |
118 | 118 | |
119 | 119 | $courses = $input['courses']; |
120 | 120 | |
121 | - $request->validate([ |
|
121 | + $request->validate ([ |
|
122 | 122 | 'courses.new.*.name' => 'required', |
123 | 123 | 'courses.new.*.institution' => 'required', |
124 | 124 | 'courses.new.*.course_status_id' => 'required', |
@@ -133,23 +133,23 @@ discard block |
||
133 | 133 | // Check if no courses were resubmitted, or if this specific one wasn't. |
134 | 134 | if (!isset($courses['old']) || |
135 | 135 | !isset($courses['old'][$oldCourse->id])) { |
136 | - $oldCourse->delete(); |
|
136 | + $oldCourse->delete (); |
|
137 | 137 | } |
138 | 138 | } |
139 | 139 | |
140 | 140 | // Save new courses. |
141 | 141 | if (isset($courses['new'])) { |
142 | 142 | foreach ($courses['new'] as $courseInput) { |
143 | - $course = new Course(); |
|
143 | + $course = new Course (); |
|
144 | 144 | $course->applicant_id = $applicant->id; |
145 | - $course->fill([ |
|
145 | + $course->fill ([ |
|
146 | 146 | 'name' => $courseInput['name'], |
147 | 147 | 'institution' => $courseInput['institution'], |
148 | 148 | 'course_status_id' => $courseInput['course_status_id'], |
149 | 149 | 'start_date' => $courseInput['start_date'], |
150 | 150 | 'end_date' => $courseInput['end_date'] |
151 | 151 | ]); |
152 | - $course->save(); |
|
152 | + $course->save (); |
|
153 | 153 | } |
154 | 154 | } |
155 | 155 | |
@@ -157,25 +157,25 @@ discard block |
||
157 | 157 | if (isset($courses['old'])) { |
158 | 158 | foreach ($courses['old'] as $id => $courseInput) { |
159 | 159 | // Ensure this course belongs to this applicant. |
160 | - $course = $applicant->courses->firstWhere('id', $id); |
|
160 | + $course = $applicant->courses->firstWhere ('id', $id); |
|
161 | 161 | if ($course != null) { |
162 | - $course->fill([ |
|
162 | + $course->fill ([ |
|
163 | 163 | 'name' => $courseInput['name'], |
164 | 164 | 'institution' => $courseInput['institution'], |
165 | 165 | 'course_status_id' => $courseInput['course_status_id'], |
166 | 166 | 'start_date' => $courseInput['start_date'], |
167 | 167 | 'end_date' => $courseInput['end_date'] |
168 | 168 | ]); |
169 | - $course->save(); |
|
169 | + $course->save (); |
|
170 | 170 | } else { |
171 | - Log::warning("Applicant $applicant->id attempted to update course with invalid id: $id"); |
|
171 | + Log::warning ("Applicant $applicant->id attempted to update course with invalid id: $id"); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
176 | 176 | $work_experiences = $input['work_experiences']; |
177 | 177 | |
178 | - $request->validate([ |
|
178 | + $request->validate ([ |
|
179 | 179 | 'work_experiences.new.*.role' => 'required', |
180 | 180 | 'work_experiences.new.*.company' => 'required', |
181 | 181 | 'work_experiences.new.*.description' => 'required', |
@@ -190,23 +190,23 @@ discard block |
||
190 | 190 | // Check if no work_experiences were resubmitted, or if this specific one wasn't. |
191 | 191 | if (!isset($work_experiences['old']) || |
192 | 192 | !isset($work_experiences['old'][$oldWorkExperience->id])) { |
193 | - $oldWorkExperience->delete(); |
|
193 | + $oldWorkExperience->delete (); |
|
194 | 194 | } |
195 | 195 | } |
196 | 196 | |
197 | 197 | // Save new work_experiences. |
198 | 198 | if (isset($work_experiences['new'])) { |
199 | 199 | foreach ($work_experiences['new'] as $workExperienceInput) { |
200 | - $workExperience = new WorkExperience(); |
|
200 | + $workExperience = new WorkExperience (); |
|
201 | 201 | $workExperience->applicant_id = $applicant->id; |
202 | - $workExperience->fill([ |
|
202 | + $workExperience->fill ([ |
|
203 | 203 | 'role' => $workExperienceInput['role'], |
204 | 204 | 'company' => $workExperienceInput['company'], |
205 | 205 | 'description' => $workExperienceInput['description'], |
206 | 206 | 'start_date' => $workExperienceInput['start_date'], |
207 | 207 | 'end_date' => $workExperienceInput['end_date'] |
208 | 208 | ]); |
209 | - $workExperience->save(); |
|
209 | + $workExperience->save (); |
|
210 | 210 | } |
211 | 211 | } |
212 | 212 | |
@@ -214,22 +214,22 @@ discard block |
||
214 | 214 | if (isset($work_experiences['old'])) { |
215 | 215 | foreach ($work_experiences['old'] as $id => $workExperienceInput) { |
216 | 216 | // Ensure this work_experience belongs to this applicant. |
217 | - $workExperience = $applicant->work_experiences->firstWhere('id', $id); |
|
217 | + $workExperience = $applicant->work_experiences->firstWhere ('id', $id); |
|
218 | 218 | if ($workExperience != null) { |
219 | - $workExperience->fill([ |
|
219 | + $workExperience->fill ([ |
|
220 | 220 | 'role' => $workExperienceInput['role'], |
221 | 221 | 'company' => $workExperienceInput['company'], |
222 | 222 | 'description' => $workExperienceInput['description'], |
223 | 223 | 'start_date' => $workExperienceInput['start_date'], |
224 | 224 | 'end_date' => $workExperienceInput['end_date'] |
225 | 225 | ]); |
226 | - $workExperience->save(); |
|
226 | + $workExperience->save (); |
|
227 | 227 | } else { |
228 | - Log::warning("Applicant $applicant->id attempted to update work_experience with invalid id: $id"); |
|
228 | + Log::warning ("Applicant $applicant->id attempted to update work_experience with invalid id: $id"); |
|
229 | 229 | } |
230 | 230 | } |
231 | 231 | } |
232 | 232 | |
233 | - return redirect(route('profile.experience.edit', $applicant)); |
|
233 | + return redirect (route ('profile.experience.edit', $applicant)); |
|
234 | 234 | } |
235 | 235 | } |
@@ -177,8 +177,8 @@ |
||
177 | 177 | 'type' => 'date_picker', |
178 | 178 | 'label' => 'Letter of Offer Issuance Date', |
179 | 179 | 'date_picker_options' => [ |
180 | - 'todayBtn' => 'linked', |
|
181 | - 'format' => 'yyyy-mm-dd', |
|
180 | + 'todayBtn' => 'linked', |
|
181 | + 'format' => 'yyyy-mm-dd', |
|
182 | 182 | ], |
183 | 183 | ]); |
184 | 184 | if ($this->crud->getCurrentEntry() && |
@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public function setup() : void |
22 | 22 | { |
23 | - $this->crud->setModel('App\Models\JobPoster'); |
|
24 | - $this->crud->setRoute('admin/job-poster'); |
|
25 | - $this->crud->setEntityNameStrings('Job Poster', 'Job Posters'); |
|
23 | + $this->crud->setModel ('App\Models\JobPoster'); |
|
24 | + $this->crud->setRoute ('admin/job-poster'); |
|
25 | + $this->crud->setEntityNameStrings ('Job Poster', 'Job Posters'); |
|
26 | 26 | |
27 | - if (!$this->request->has('order')) { |
|
28 | - $this->crud->orderBy('close_date_time', 'desc'); |
|
27 | + if (!$this->request->has ('order')) { |
|
28 | + $this->crud->orderBy ('close_date_time', 'desc'); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | |
@@ -33,60 +33,60 @@ discard block |
||
33 | 33 | { |
34 | 34 | // Required for order logic. |
35 | 35 | $locale = 'en'; |
36 | - if (null !== $this->request->input('locale')) { |
|
37 | - $locale = $this->request->input('locale'); |
|
36 | + if (null !== $this->request->input ('locale')) { |
|
37 | + $locale = $this->request->input ('locale'); |
|
38 | 38 | } |
39 | - App::setLocale($locale); |
|
39 | + App::setLocale ($locale); |
|
40 | 40 | |
41 | 41 | // Add the custom blade buttons found in resources/views/vendor/backpack/crud/buttons/. |
42 | - $this->crud->addButtonFromView('line', 'job_admin_edit', 'job_admin_edit', 'end'); |
|
43 | - $this->crud->addButtonFromView('line', 'spb_link', 'spb_link', 'end'); |
|
44 | - $this->crud->addButtonFromView('line', 'jpb_link', 'jpb_link', 'end'); |
|
45 | - $this->crud->addButtonFromView('line', 'job_poster_link', 'job_poster_link', 'end'); |
|
42 | + $this->crud->addButtonFromView ('line', 'job_admin_edit', 'job_admin_edit', 'end'); |
|
43 | + $this->crud->addButtonFromView ('line', 'spb_link', 'spb_link', 'end'); |
|
44 | + $this->crud->addButtonFromView ('line', 'jpb_link', 'jpb_link', 'end'); |
|
45 | + $this->crud->addButtonFromView ('line', 'job_poster_link', 'job_poster_link', 'end'); |
|
46 | 46 | |
47 | 47 | |
48 | - $this->crud->addColumn([ |
|
48 | + $this->crud->addColumn ([ |
|
49 | 49 | 'name' => 'id', |
50 | 50 | 'type' => 'number', |
51 | 51 | 'label' => 'ID' |
52 | 52 | ]); |
53 | - $this->crud->addColumn([ |
|
53 | + $this->crud->addColumn ([ |
|
54 | 54 | 'name' => 'title', |
55 | 55 | 'type' => 'text', |
56 | 56 | 'label' => 'Title', |
57 | 57 | 'searchLogic' => function ($query, $column, $searchTerm) use ($locale) : void { |
58 | - $query->orWhere('title->' . $locale, 'ilike', "%$searchTerm%"); |
|
58 | + $query->orWhere ('title->'.$locale, 'ilike', "%$searchTerm%"); |
|
59 | 59 | }, |
60 | 60 | 'orderLogic' => function ($query, $column, $columnDirection) use ($locale) { |
61 | - return $query->orderBy('title->' . $locale, $columnDirection)->select('*'); |
|
61 | + return $query->orderBy ('title->'.$locale, $columnDirection)->select ('*'); |
|
62 | 62 | } |
63 | 63 | ]); |
64 | - $this->crud->addColumn([ |
|
64 | + $this->crud->addColumn ([ |
|
65 | 65 | 'name' => 'status', |
66 | 66 | 'label' => 'Status', |
67 | 67 | 'type' => 'model_function', |
68 | 68 | 'function_name' => 'status' |
69 | 69 | ]); |
70 | - $this->crud->addColumn([ |
|
70 | + $this->crud->addColumn ([ |
|
71 | 71 | 'name' => 'published', |
72 | 72 | 'label' => 'Published', |
73 | 73 | 'type' => 'check', |
74 | 74 | ]); |
75 | - $this->crud->addColumn([ |
|
75 | + $this->crud->addColumn ([ |
|
76 | 76 | 'name' => 'manager_user_name', |
77 | 77 | 'type' => 'closure', |
78 | 78 | 'label' => 'Manager', |
79 | 79 | 'orderable' => false, |
80 | - 'function' => function ($entry) { |
|
81 | - return '<a href="' . route('manager.profile.edit', $entry->manager->user->id) . '" target="_blank">' . $entry->manager->user->full_name . '</a>'; |
|
80 | + 'function' => function ($entry){ |
|
81 | + return '<a href="'.route ('manager.profile.edit', $entry->manager->user->id).'" target="_blank">'.$entry->manager->user->full_name.'</a>'; |
|
82 | 82 | } |
83 | 83 | ]); |
84 | - $this->crud->addColumn([ |
|
84 | + $this->crud->addColumn ([ |
|
85 | 85 | 'name' => 'department.name', |
86 | 86 | 'label' => 'Department', |
87 | 87 | 'type' => 'text' |
88 | 88 | ]); |
89 | - $this->crud->addColumn([ |
|
89 | + $this->crud->addColumn ([ |
|
90 | 90 | 'name' => 'submitted_applications_count', |
91 | 91 | 'label' => 'Total Applications', |
92 | 92 | 'type' => 'model_function', |
@@ -94,19 +94,19 @@ discard block |
||
94 | 94 | ]); |
95 | 95 | |
96 | 96 | // Filters. |
97 | - $this->crud->addFilter([ |
|
97 | + $this->crud->addFilter ([ |
|
98 | 98 | 'name' => 'departments', |
99 | 99 | 'type' => 'select2_multiple', |
100 | 100 | 'label' => 'Departments' |
101 | - ], function () { |
|
102 | - return Department::all()->pluck('name', 'id')->toArray(); |
|
103 | - }, function ($values) { |
|
104 | - $this->crud->addClause('WhereHas', 'department', function ($query) use ($values) { |
|
105 | - foreach (json_decode($values) as $key => $value) { |
|
101 | + ], function (){ |
|
102 | + return Department::all ()->pluck ('name', 'id')->toArray (); |
|
103 | + }, function ($values){ |
|
104 | + $this->crud->addClause ('WhereHas', 'department', function ($query) use ($values) { |
|
105 | + foreach (json_decode ($values) as $key => $value) { |
|
106 | 106 | if ($key === 0) { |
107 | - $query->where('id', $value); |
|
107 | + $query->where ('id', $value); |
|
108 | 108 | } else { |
109 | - $query->orWhere('id', $value); |
|
109 | + $query->orWhere ('id', $value); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | }); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | public function setupUpdateOperation() |
117 | 117 | { |
118 | - $this->crud->addField([ |
|
118 | + $this->crud->addField ([ |
|
119 | 119 | 'name' => 'title', |
120 | 120 | 'label' => 'Title', |
121 | 121 | 'type' => 'text', |
@@ -123,22 +123,22 @@ discard block |
||
123 | 123 | 'readonly' => 'readonly' |
124 | 124 | ] |
125 | 125 | ]); |
126 | - $this->crud->addField([ |
|
126 | + $this->crud->addField ([ |
|
127 | 127 | 'name' => 'salary_min', |
128 | 128 | 'type' => 'number', |
129 | 129 | 'label' => 'Minimum Salary', |
130 | 130 | ]); |
131 | - $this->crud->addField([ |
|
131 | + $this->crud->addField ([ |
|
132 | 132 | 'name' => 'salary_max', |
133 | 133 | 'type' => 'number', |
134 | 134 | 'label' => 'Maximum Salary', |
135 | 135 | ]); |
136 | - $this->crud->addField([ |
|
136 | + $this->crud->addField ([ |
|
137 | 137 | 'name' => 'noc', |
138 | 138 | 'type' => 'number', |
139 | 139 | 'label' => 'NOC Code', |
140 | 140 | ]); |
141 | - $this->crud->addField([ |
|
141 | + $this->crud->addField ([ |
|
142 | 142 | 'name' => 'open_date_time', |
143 | 143 | 'label' => 'Open Date', |
144 | 144 | 'type' => 'date_picker', |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | 'format' => 'yyyy-mm-dd', |
148 | 148 | ], |
149 | 149 | ]); |
150 | - $this->crud->addField([ |
|
150 | + $this->crud->addField ([ |
|
151 | 151 | 'name' => 'close_date_time', |
152 | 152 | 'label' => 'Close Date', |
153 | 153 | 'type' => 'date_picker', |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | 'format' => 'yyyy-mm-dd', |
157 | 157 | ], |
158 | 158 | ]); |
159 | - $this->crud->addField([ |
|
159 | + $this->crud->addField ([ |
|
160 | 160 | 'name' => 'start_date_time', |
161 | 161 | 'label' => 'Start Date', |
162 | 162 | 'type' => 'date_picker', |
@@ -165,17 +165,17 @@ discard block |
||
165 | 165 | 'format' => 'yyyy-mm-dd', |
166 | 166 | ], |
167 | 167 | ]); |
168 | - $this->crud->addField([ |
|
168 | + $this->crud->addField ([ |
|
169 | 169 | 'name' => 'process_number', |
170 | 170 | 'type' => 'number', |
171 | 171 | 'label' => 'Process #', |
172 | 172 | ]); |
173 | - $this->crud->addField([ |
|
173 | + $this->crud->addField ([ |
|
174 | 174 | 'name' => 'priority_clearance_number', |
175 | 175 | 'type' => 'number', |
176 | 176 | 'label' => 'Priority Clearance #', |
177 | 177 | ]); |
178 | - $this->crud->addField([ |
|
178 | + $this->crud->addField ([ |
|
179 | 179 | 'name' => 'loo_issuance_date', |
180 | 180 | 'type' => 'date_picker', |
181 | 181 | 'label' => 'Letter of Offer Issuance Date', |
@@ -184,10 +184,10 @@ discard block |
||
184 | 184 | 'format' => 'yyyy-mm-dd', |
185 | 185 | ], |
186 | 186 | ]); |
187 | - if ($this->crud->getCurrentEntry() && |
|
188 | - !$this->crud->getCurrentEntry()->published |
|
187 | + if ($this->crud->getCurrentEntry () && |
|
188 | + !$this->crud->getCurrentEntry ()->published |
|
189 | 189 | ) { |
190 | - $this->crud->addField([ |
|
190 | + $this->crud->addField ([ |
|
191 | 191 | 'name' => 'published', |
192 | 192 | 'label' => 'Publish', |
193 | 193 | 'type' => 'checkbox' |
@@ -197,20 +197,20 @@ discard block |
||
197 | 197 | |
198 | 198 | public function update() |
199 | 199 | { |
200 | - $open_date = $this->crud->request->request->get('open_date_time'); |
|
201 | - $close_date = $this->crud->request->request->get('close_date_time'); |
|
202 | - $start_date = $this->crud->request->request->get('start_date_time'); |
|
203 | - $this->crud->request->request->remove('open_date_time'); |
|
204 | - $this->crud->request->request->remove('close_date_time'); |
|
205 | - $this->crud->request->request->remove('start_date_time'); |
|
200 | + $open_date = $this->crud->request->request->get ('open_date_time'); |
|
201 | + $close_date = $this->crud->request->request->get ('close_date_time'); |
|
202 | + $start_date = $this->crud->request->request->get ('start_date_time'); |
|
203 | + $this->crud->request->request->remove ('open_date_time'); |
|
204 | + $this->crud->request->request->remove ('close_date_time'); |
|
205 | + $this->crud->request->request->remove ('start_date_time'); |
|
206 | 206 | // Manipulates the input fields to save the "end of day" timestamp for |
207 | 207 | // open/close/start dates. |
208 | - $this->crud->request->request->add([ |
|
209 | - 'open_date_time' => ptDayStartToUtcTime($open_date), |
|
210 | - 'close_date_time' => ptDayEndToUtcTime($close_date), |
|
211 | - 'start_date_time' => ptDayStartToUtcTime($start_date), |
|
208 | + $this->crud->request->request->add ([ |
|
209 | + 'open_date_time' => ptDayStartToUtcTime ($open_date), |
|
210 | + 'close_date_time' => ptDayEndToUtcTime ($close_date), |
|
211 | + 'start_date_time' => ptDayStartToUtcTime ($start_date), |
|
212 | 212 | ]); |
213 | - $response = $this->traitUpdate(); |
|
213 | + $response = $this->traitUpdate (); |
|
214 | 214 | |
215 | 215 | return $response; |
216 | 216 | } |