@@ -20,13 +20,13 @@ |
||
| 20 | 20 | * |
| 21 | 21 | * @return void |
| 22 | 22 | */ |
| 23 | - public function compose(View $view) : void |
|
| 23 | + public function compose (View $view) : void |
|
| 24 | 24 | { |
| 25 | 25 | if (!$this->relationships) { |
| 26 | - $this->relationships = Relationship::all(); |
|
| 26 | + $this->relationships = Relationship::all (); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - $view->with('relationships', $this->relationships); |
|
| 30 | - $view->with('reference_template', Lang::get('common/references')); |
|
| 29 | + $view->with ('relationships', $this->relationships); |
|
| 30 | + $view->with ('reference_template', Lang::get ('common/references')); |
|
| 31 | 31 | } |
| 32 | 32 | } |
@@ -20,13 +20,13 @@ |
||
| 20 | 20 | * |
| 21 | 21 | * @return void |
| 22 | 22 | */ |
| 23 | - public function compose(View $view) : void |
|
| 23 | + public function compose (View $view) : void |
|
| 24 | 24 | { |
| 25 | 25 | if (!$this->courseStatuses) { |
| 26 | - $this->courseStatuses = CourseStatus::all(); |
|
| 26 | + $this->courseStatuses = CourseStatus::all (); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - $view->with('course_status', $this->courseStatuses); |
|
| 30 | - $view->with('course_template', Lang::get('common/course')); |
|
| 29 | + $view->with ('course_status', $this->courseStatuses); |
|
| 30 | + $view->with ('course_template', Lang::get ('common/course')); |
|
| 31 | 31 | } |
| 32 | 32 | } |
@@ -13,8 +13,8 @@ |
||
| 13 | 13 | * @param View $view |
| 14 | 14 | * @return void |
| 15 | 15 | */ |
| 16 | - public function compose(View $view) |
|
| 16 | + public function compose (View $view) |
|
| 17 | 17 | { |
| 18 | - $view->with('goc', Lang::get('common/goc')); |
|
| 18 | + $view->with ('goc', Lang::get ('common/goc')); |
|
| 19 | 19 | } |
| 20 | 20 | } |
@@ -17,31 +17,31 @@ |
||
| 17 | 17 | * @param \App\Models\JobApplication $application Incoming Application. |
| 18 | 18 | * @return \Illuminate\Http\Response |
| 19 | 19 | */ |
| 20 | - public function updateForApplication(Request $request, JobApplication $application) |
|
| 20 | + public function updateForApplication (Request $request, JobApplication $application) |
|
| 21 | 21 | { |
| 22 | - $request->validate([ |
|
| 22 | + $request->validate ([ |
|
| 23 | 23 | 'review_status_id' => [ |
| 24 | 24 | 'nullable', |
| 25 | - Rule::in(ReviewStatus::all()->pluck('id')->toArray()) |
|
| 25 | + Rule::in (ReviewStatus::all ()->pluck ('id')->toArray ()) |
|
| 26 | 26 | ], |
| 27 | 27 | 'notes' => 'nullable|string' |
| 28 | 28 | ]); |
| 29 | 29 | |
| 30 | 30 | $review = $application->application_review; |
| 31 | 31 | if ($review === null) { |
| 32 | - $review = new ApplicationReview(); |
|
| 33 | - $review->job_application()->associate($application); |
|
| 32 | + $review = new ApplicationReview (); |
|
| 33 | + $review->job_application ()->associate ($application); |
|
| 34 | 34 | } |
| 35 | - $review->fill([ |
|
| 36 | - 'review_status_id' => $request->input('review_status_id'), |
|
| 37 | - 'notes' => $request->input('notes'), |
|
| 35 | + $review->fill ([ |
|
| 36 | + 'review_status_id' => $request->input ('review_status_id'), |
|
| 37 | + 'notes' => $request->input ('notes'), |
|
| 38 | 38 | ]); |
| 39 | - $review->save(); |
|
| 39 | + $review->save (); |
|
| 40 | 40 | |
| 41 | - if ($request->ajax()) { |
|
| 42 | - return $review->fresh()->toJson(); |
|
| 41 | + if ($request->ajax ()) { |
|
| 42 | + return $review->fresh ()->toJson (); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - return redirect()->back(); |
|
| 45 | + return redirect ()->back (); |
|
| 46 | 46 | } |
| 47 | 47 | } |
@@ -12,13 +12,13 @@ |
||
| 12 | 12 | * |
| 13 | 13 | * @return View |
| 14 | 14 | */ |
| 15 | - public function __invoke() |
|
| 15 | + public function __invoke () |
|
| 16 | 16 | { |
| 17 | - return view( |
|
| 17 | + return view ( |
|
| 18 | 18 | 'applicant/static_faq', |
| 19 | 19 | [ |
| 20 | - 'faq' => Lang::get('applicant/faq'), |
|
| 21 | - 'breadcrumb_home' => route('home'), |
|
| 20 | + 'faq' => Lang::get ('applicant/faq'), |
|
| 21 | + 'breadcrumb_home' => route ('home'), |
|
| 22 | 22 | 'applicant_sidebar_active' => 'active', |
| 23 | 23 | ] |
| 24 | 24 | ); |
@@ -20,41 +20,41 @@ |
||
| 20 | 20 | * @param \App\Models\JobPoster $jobPoster Job Poster to retrieve assessment plan for. |
| 21 | 21 | * @return mixed[] |
| 22 | 22 | */ |
| 23 | - public function getForJob(JobPoster $jobPoster) |
|
| 23 | + public function getForJob (JobPoster $jobPoster) |
|
| 24 | 24 | { |
| 25 | - if (Gate::denies('view-assessment-plan', $jobPoster)) { |
|
| 26 | - abort(403); |
|
| 25 | + if (Gate::denies ('view-assessment-plan', $jobPoster)) { |
|
| 26 | + abort (403); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - $criteria = Criteria::where('job_poster_id', $jobPoster->id)->get(); |
|
| 29 | + $criteria = Criteria::where ('job_poster_id', $jobPoster->id)->get (); |
|
| 30 | 30 | $criteriaTranslated = []; |
| 31 | 31 | foreach ($criteria as $criterion) { |
| 32 | 32 | // TODO: getTranslationsArray probably makes DB calls every loop. Find a way to profile & optimize. |
| 33 | - $criteriaTranslated[] = array_merge($criterion->toArray(), $criterion->getTranslationsArray()); |
|
| 33 | + $criteriaTranslated[] = array_merge ($criterion->toArray (), $criterion->getTranslationsArray ()); |
|
| 34 | 34 | } |
| 35 | - $criteriaIds = $criteria->pluck('id'); |
|
| 36 | - $assessments = Assessment::whereIn('criterion_id', $criteriaIds)->get(); |
|
| 35 | + $criteriaIds = $criteria->pluck ('id'); |
|
| 36 | + $assessments = Assessment::whereIn ('criterion_id', $criteriaIds)->get (); |
|
| 37 | 37 | // Check for newly created assessment plan, and initialize any empty criteria to have the |
| 38 | 38 | // "Narrative Review" option set. |
| 39 | - $assessmentCriteriaIds = $assessments->pluck('criterion_id'); |
|
| 40 | - $emptyAssessments = array_diff($criteriaIds->toArray(), $assessmentCriteriaIds->toArray()); |
|
| 39 | + $assessmentCriteriaIds = $assessments->pluck ('criterion_id'); |
|
| 40 | + $emptyAssessments = array_diff ($criteriaIds->toArray (), $assessmentCriteriaIds->toArray ()); |
|
| 41 | 41 | if (!empty($emptyAssessments)) { |
| 42 | - $narrativeReview = AssessmentType::where('key', 'narrative_assessment')->first(); |
|
| 42 | + $narrativeReview = AssessmentType::where ('key', 'narrative_assessment')->first (); |
|
| 43 | 43 | foreach ($emptyAssessments as $criterionId) { |
| 44 | - Assessment::create([ |
|
| 44 | + Assessment::create ([ |
|
| 45 | 45 | 'criterion_id' => $criterionId, |
| 46 | 46 | 'assessment_type_id' => $narrativeReview->id |
| 47 | 47 | ]); |
| 48 | 48 | } |
| 49 | - $assessments = Assessment::whereIn('criterion_id', $criteriaIds)->get(); |
|
| 49 | + $assessments = Assessment::whereIn ('criterion_id', $criteriaIds)->get (); |
|
| 50 | 50 | } |
| 51 | - $questions = RatingGuideQuestion::where('job_poster_id', $jobPoster->id)->get(); |
|
| 52 | - $answers = RatingGuideAnswer::whereIn('rating_guide_question_id', $questions->pluck('id'))->get(); |
|
| 51 | + $questions = RatingGuideQuestion::where ('job_poster_id', $jobPoster->id)->get (); |
|
| 52 | + $answers = RatingGuideAnswer::whereIn ('rating_guide_question_id', $questions->pluck ('id'))->get (); |
|
| 53 | 53 | return [ |
| 54 | 54 | 'criteria' => $criteriaTranslated, |
| 55 | - 'assessments' => $assessments->toArray(), |
|
| 56 | - 'rating_guide_questions' => $questions->toArray(), |
|
| 57 | - 'rating_guide_answers' => $answers->toArray() |
|
| 55 | + 'assessments' => $assessments->toArray (), |
|
| 56 | + 'rating_guide_questions' => $questions->toArray (), |
|
| 57 | + 'rating_guide_answers' => $answers->toArray () |
|
| 58 | 58 | ]; |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -16,35 +16,35 @@ discard block |
||
| 16 | 16 | * @param \Illuminate\Http\Request $request Incoming request. |
| 17 | 17 | * @return \Illuminate\Http\Response |
| 18 | 18 | */ |
| 19 | - public function store(Request $request) |
|
| 19 | + public function store (Request $request) |
|
| 20 | 20 | { |
| 21 | - $this->authorize('create', Assessment::class); |
|
| 21 | + $this->authorize ('create', Assessment::class); |
|
| 22 | 22 | |
| 23 | 23 | try { |
| 24 | - $criterion_id = (int)$request->json('criterion_id'); |
|
| 25 | - $assessment_type_id = (int)$request->json('assessment_type_id'); |
|
| 26 | - $criteria = Criteria::findOrFail($criterion_id); |
|
| 27 | - AssessmentType::findOrFail($assessment_type_id); |
|
| 24 | + $criterion_id = (int) $request->json ('criterion_id'); |
|
| 25 | + $assessment_type_id = (int) $request->json ('assessment_type_id'); |
|
| 26 | + $criteria = Criteria::findOrFail ($criterion_id); |
|
| 27 | + AssessmentType::findOrFail ($assessment_type_id); |
|
| 28 | 28 | |
| 29 | - $assessment = new Assessment([ |
|
| 29 | + $assessment = new Assessment ([ |
|
| 30 | 30 | 'criterion_id' => $criterion_id, |
| 31 | 31 | 'assessment_type_id' => $assessment_type_id |
| 32 | 32 | ]); |
| 33 | 33 | // Check that this user is allowed to create an Assessment for this criterion. |
| 34 | - $this->authorize('update', $assessment); |
|
| 34 | + $this->authorize ('update', $assessment); |
|
| 35 | 35 | |
| 36 | - $assessment->save(); |
|
| 37 | - $assessment->refresh(); |
|
| 38 | - $assessment['criteria'] = $criteria->toArray(); |
|
| 36 | + $assessment->save (); |
|
| 37 | + $assessment->refresh (); |
|
| 38 | + $assessment['criteria'] = $criteria->toArray (); |
|
| 39 | 39 | } catch (\Exception $e) { |
| 40 | - return response()->json([ |
|
| 41 | - 'error' => $e->getMessage() |
|
| 40 | + return response ()->json ([ |
|
| 41 | + 'error' => $e->getMessage () |
|
| 42 | 42 | ], 400); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | return [ |
| 46 | 46 | 'success' => "Successfully created assessment $assessment->id", |
| 47 | - 'assessment' => $assessment->toArray() |
|
| 47 | + 'assessment' => $assessment->toArray () |
|
| 48 | 48 | ]; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -54,12 +54,12 @@ discard block |
||
| 54 | 54 | * @param \App\Models\Assessment $assessment Incoming object. |
| 55 | 55 | * @return \Illuminate\Http\Response |
| 56 | 56 | */ |
| 57 | - public function show(Assessment $assessment) |
|
| 57 | + public function show (Assessment $assessment) |
|
| 58 | 58 | { |
| 59 | - $this->authorize('view', $assessment); |
|
| 60 | - $criteria = Criteria::find($assessment->id); |
|
| 61 | - $assessment['criteria'] = $criteria->toArray(); |
|
| 62 | - return $assessment->toArray(); |
|
| 59 | + $this->authorize ('view', $assessment); |
|
| 60 | + $criteria = Criteria::find ($assessment->id); |
|
| 61 | + $assessment['criteria'] = $criteria->toArray (); |
|
| 62 | + return $assessment->toArray (); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
@@ -69,28 +69,28 @@ discard block |
||
| 69 | 69 | * @param \App\Models\Assessment $assessment Incoming object. |
| 70 | 70 | * @return \Illuminate\Http\Response |
| 71 | 71 | */ |
| 72 | - public function update(Request $request, Assessment $assessment) |
|
| 72 | + public function update (Request $request, Assessment $assessment) |
|
| 73 | 73 | { |
| 74 | - $this->authorize('update', $assessment); |
|
| 74 | + $this->authorize ('update', $assessment); |
|
| 75 | 75 | try { |
| 76 | - $criterion_id = (int)$request->json('criterion_id'); |
|
| 77 | - $assessment_type_id = (int)$request->json('assessment_type_id'); |
|
| 78 | - $criteria = Criteria::findOrFail($criterion_id); |
|
| 79 | - AssessmentType::findOrFail($assessment_type_id); |
|
| 76 | + $criterion_id = (int) $request->json ('criterion_id'); |
|
| 77 | + $assessment_type_id = (int) $request->json ('assessment_type_id'); |
|
| 78 | + $criteria = Criteria::findOrFail ($criterion_id); |
|
| 79 | + AssessmentType::findOrFail ($assessment_type_id); |
|
| 80 | 80 | |
| 81 | 81 | $assessment->criterion_id = $criterion_id; |
| 82 | 82 | $assessment->assessment_type_id = $assessment_type_id; |
| 83 | - $assessment->save(); |
|
| 84 | - $assessment['criteria'] = $criteria->toArray(); |
|
| 83 | + $assessment->save (); |
|
| 84 | + $assessment['criteria'] = $criteria->toArray (); |
|
| 85 | 85 | } catch (\Exception $e) { |
| 86 | - return response()->json([ |
|
| 87 | - 'error' => $e->getMessage() |
|
| 86 | + return response ()->json ([ |
|
| 87 | + 'error' => $e->getMessage () |
|
| 88 | 88 | ], 400); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | return [ |
| 92 | 92 | 'success' => "Successfully updated assessment $assessment->id", |
| 93 | - 'assessment' => $assessment->toArray(), |
|
| 93 | + 'assessment' => $assessment->toArray (), |
|
| 94 | 94 | ]; |
| 95 | 95 | } |
| 96 | 96 | |
@@ -100,10 +100,10 @@ discard block |
||
| 100 | 100 | * @param \App\Models\Assessment $assessment Incoming object. |
| 101 | 101 | * @return \Illuminate\Http\Response |
| 102 | 102 | */ |
| 103 | - public function destroy(Assessment $assessment) |
|
| 103 | + public function destroy (Assessment $assessment) |
|
| 104 | 104 | { |
| 105 | - $this->authorize('delete', $assessment); |
|
| 106 | - $assessment->delete(); |
|
| 105 | + $this->authorize ('delete', $assessment); |
|
| 106 | + $assessment->delete (); |
|
| 107 | 107 | |
| 108 | 108 | return [ |
| 109 | 109 | 'success' => "Successfully deleted assessment $assessment->id" |
@@ -14,15 +14,15 @@ discard block |
||
| 14 | 14 | * @param \Illuminate\Http\Request $request Incoming request. |
| 15 | 15 | * @return mixed |
| 16 | 16 | */ |
| 17 | - public function index(Request $request) |
|
| 17 | + public function index (Request $request) |
|
| 18 | 18 | { |
| 19 | 19 | $notificationsArray = []; |
| 20 | - if ($request->has('job_poster_id') && $request->user() != null) { |
|
| 21 | - $jobPosterId = $request->input('job_poster_id'); |
|
| 22 | - $notifications = AssessmentPlanNotification::where('job_poster_id', $jobPosterId)->get(); |
|
| 20 | + if ($request->has ('job_poster_id') && $request->user () != null) { |
|
| 21 | + $jobPosterId = $request->input ('job_poster_id'); |
|
| 22 | + $notifications = AssessmentPlanNotification::where ('job_poster_id', $jobPosterId)->get (); |
|
| 23 | 23 | foreach ($notifications as $notification) { |
| 24 | - if ($request->user()->can('view', $notification)) { |
|
| 25 | - $notificationsArray[] = $notification->toArray(); |
|
| 24 | + if ($request->user ()->can ('view', $notification)) { |
|
| 25 | + $notificationsArray[] = $notification->toArray (); |
|
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | } |
@@ -35,10 +35,10 @@ discard block |
||
| 35 | 35 | * @param \App\Models\AssessmentPlanNotification $assessmentPlanNotification Incoming object. |
| 36 | 36 | * @return mixed |
| 37 | 37 | */ |
| 38 | - public function show(AssessmentPlanNotification $assessmentPlanNotification) |
|
| 38 | + public function show (AssessmentPlanNotification $assessmentPlanNotification) |
|
| 39 | 39 | { |
| 40 | - $this->authorize('view', $assessmentPlanNotification); |
|
| 41 | - return $assessmentPlanNotification->toArray(); |
|
| 40 | + $this->authorize ('view', $assessmentPlanNotification); |
|
| 41 | + return $assessmentPlanNotification->toArray (); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -49,17 +49,17 @@ discard block |
||
| 49 | 49 | * @throws \InvalidArgumentException For missing $question. |
| 50 | 50 | * @return mixed |
| 51 | 51 | */ |
| 52 | - public function update(Request $request, AssessmentPlanNotification $assessmentPlanNotification) |
|
| 52 | + public function update (Request $request, AssessmentPlanNotification $assessmentPlanNotification) |
|
| 53 | 53 | { |
| 54 | - $this->authorize('update', $assessmentPlanNotification); |
|
| 55 | - $assessmentPlanNotification->fill([ |
|
| 56 | - 'acknowledged' => $request->input('acknowledged') |
|
| 54 | + $this->authorize ('update', $assessmentPlanNotification); |
|
| 55 | + $assessmentPlanNotification->fill ([ |
|
| 56 | + 'acknowledged' => $request->input ('acknowledged') |
|
| 57 | 57 | ]); |
| 58 | - $assessmentPlanNotification->save(); |
|
| 58 | + $assessmentPlanNotification->save (); |
|
| 59 | 59 | |
| 60 | 60 | return [ |
| 61 | 61 | 'success' => "Successfully updated assessment plan notification $assessmentPlanNotification->id", |
| 62 | - 'assessment_plan_notification' => $assessmentPlanNotification->toArray(), |
|
| 62 | + 'assessment_plan_notification' => $assessmentPlanNotification->toArray (), |
|
| 63 | 63 | ]; |
| 64 | 64 | } |
| 65 | 65 | |
@@ -69,10 +69,10 @@ discard block |
||
| 69 | 69 | * @param \App\Models\AssessmentPlanNotification $assessmentPlanNotification Incoming object. |
| 70 | 70 | * @return mixed |
| 71 | 71 | */ |
| 72 | - public function destroy(AssessmentPlanNotification $assessmentPlanNotification) |
|
| 72 | + public function destroy (AssessmentPlanNotification $assessmentPlanNotification) |
|
| 73 | 73 | { |
| 74 | - $this->authorize('delete', $assessmentPlanNotification); |
|
| 75 | - $assessmentPlanNotification->delete(); |
|
| 74 | + $this->authorize ('delete', $assessmentPlanNotification); |
|
| 75 | + $assessmentPlanNotification->delete (); |
|
| 76 | 76 | |
| 77 | 77 | return [ |
| 78 | 78 | 'success' => "Successfully deleted assessment plan notification $assessmentPlanNotification->id" |
@@ -17,62 +17,62 @@ discard block |
||
| 17 | 17 | * |
| 18 | 18 | * @return void |
| 19 | 19 | */ |
| 20 | - public function setup() : void |
|
| 20 | + public function setup () : void |
|
| 21 | 21 | { |
| 22 | - $this->crud->setModel('App\Models\JobPoster'); |
|
| 23 | - $this->crud->setRoute('admin/job-poster'); |
|
| 24 | - $this->crud->setEntityNameStrings('Job Poster', 'Job Posters'); |
|
| 22 | + $this->crud->setModel ('App\Models\JobPoster'); |
|
| 23 | + $this->crud->setRoute ('admin/job-poster'); |
|
| 24 | + $this->crud->setEntityNameStrings ('Job Poster', 'Job Posters'); |
|
| 25 | 25 | |
| 26 | - if (!$this->request->has('order')) { |
|
| 27 | - $this->crud->orderBy('close_date_time', 'desc'); |
|
| 26 | + if (!$this->request->has ('order')) { |
|
| 27 | + $this->crud->orderBy ('close_date_time', 'desc'); |
|
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - public function setupListOperation() |
|
| 31 | + public function setupListOperation () |
|
| 32 | 32 | { |
| 33 | 33 | // Add the custom blade buttons found in resources/views/vendor/backpack/crud/buttons/. |
| 34 | - $this->crud->addButtonFromView('line', 'job_admin_edit', 'job_admin_edit', 'end'); |
|
| 35 | - $this->crud->addButtonFromView('line', 'spb_link', 'spb_link', 'end'); |
|
| 36 | - $this->crud->addButtonFromView('line', 'jpb_link', 'jpb_link', 'end'); |
|
| 37 | - $this->crud->addButtonFromView('line', 'job_poster_link', 'job_poster_link', 'end'); |
|
| 34 | + $this->crud->addButtonFromView ('line', 'job_admin_edit', 'job_admin_edit', 'end'); |
|
| 35 | + $this->crud->addButtonFromView ('line', 'spb_link', 'spb_link', 'end'); |
|
| 36 | + $this->crud->addButtonFromView ('line', 'jpb_link', 'jpb_link', 'end'); |
|
| 37 | + $this->crud->addButtonFromView ('line', 'job_poster_link', 'job_poster_link', 'end'); |
|
| 38 | 38 | |
| 39 | 39 | |
| 40 | - $this->crud->addColumn([ |
|
| 40 | + $this->crud->addColumn ([ |
|
| 41 | 41 | 'name' => 'id', |
| 42 | 42 | 'type' => 'number', |
| 43 | 43 | 'label' => 'ID' |
| 44 | 44 | ]); |
| 45 | - $this->crud->addColumn([ |
|
| 45 | + $this->crud->addColumn ([ |
|
| 46 | 46 | 'name' => 'title', |
| 47 | 47 | 'type' => 'text', |
| 48 | 48 | 'label' => 'Title' |
| 49 | 49 | ]); |
| 50 | - $this->crud->addColumn([ |
|
| 50 | + $this->crud->addColumn ([ |
|
| 51 | 51 | 'name' => 'status', |
| 52 | 52 | 'label' => 'Status', |
| 53 | 53 | 'type' => 'model_function', |
| 54 | 54 | 'function_name' => 'status' |
| 55 | 55 | ]); |
| 56 | - $this->crud->addColumn([ |
|
| 56 | + $this->crud->addColumn ([ |
|
| 57 | 57 | 'name' => 'published', |
| 58 | 58 | 'label' => 'Published', |
| 59 | 59 | 'type' => 'check', |
| 60 | 60 | ]); |
| 61 | - $this->crud->addColumn([ |
|
| 61 | + $this->crud->addColumn ([ |
|
| 62 | 62 | 'name' => 'manager_user_name', |
| 63 | 63 | 'type' => 'closure', |
| 64 | 64 | 'label' => 'Manager', |
| 65 | 65 | 'orderable' => false, |
| 66 | 66 | 'function' => function ($entry) { |
| 67 | - return '<a href="' . route('manager.profile.edit', $entry->manager->user->id) . '" target="_blank">' . $entry->manager->user->full_name . '</a>'; |
|
| 67 | + return '<a href="'.route ('manager.profile.edit', $entry->manager->user->id).'" target="_blank">'.$entry->manager->user->full_name.'</a>'; |
|
| 68 | 68 | } |
| 69 | 69 | ]); |
| 70 | - $this->crud->addColumn([ |
|
| 70 | + $this->crud->addColumn ([ |
|
| 71 | 71 | 'name' => 'department.name', |
| 72 | 72 | 'label' => 'Department', |
| 73 | 73 | 'type' => 'text' |
| 74 | 74 | ]); |
| 75 | - $this->crud->addColumn([ |
|
| 75 | + $this->crud->addColumn ([ |
|
| 76 | 76 | 'name' => 'submitted_applications_count', |
| 77 | 77 | 'label' => 'Total Applications', |
| 78 | 78 | 'type' => 'model_function', |
@@ -80,28 +80,28 @@ discard block |
||
| 80 | 80 | ]); |
| 81 | 81 | |
| 82 | 82 | // Filters. |
| 83 | - $this->crud->addFilter([ |
|
| 83 | + $this->crud->addFilter ([ |
|
| 84 | 84 | 'name' => 'departments', |
| 85 | 85 | 'type' => 'select2_multiple', |
| 86 | 86 | 'label' => 'Departments' |
| 87 | 87 | ], function () { |
| 88 | - return Department::all()->pluck('name', 'id')->toArray(); |
|
| 88 | + return Department::all ()->pluck ('name', 'id')->toArray (); |
|
| 89 | 89 | }, function ($values) { |
| 90 | - $this->crud->addClause('WhereHas', 'department', function ($query) use ($values) { |
|
| 91 | - foreach (json_decode($values) as $key => $value) { |
|
| 90 | + $this->crud->addClause ('WhereHas', 'department', function ($query) use ($values) { |
|
| 91 | + foreach (json_decode ($values) as $key => $value) { |
|
| 92 | 92 | if ($key === 0) { |
| 93 | - $query->where('id', $value); |
|
| 93 | + $query->where ('id', $value); |
|
| 94 | 94 | } else { |
| 95 | - $query->orWhere('id', $value); |
|
| 95 | + $query->orWhere ('id', $value); |
|
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | }); |
| 99 | 99 | }); |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - public function setupUpdateOperation() |
|
| 102 | + public function setupUpdateOperation () |
|
| 103 | 103 | { |
| 104 | - $this->crud->addField([ |
|
| 104 | + $this->crud->addField ([ |
|
| 105 | 105 | 'name' => 'title', |
| 106 | 106 | 'label' => 'Title', |
| 107 | 107 | 'type' => 'text', |
@@ -109,22 +109,22 @@ discard block |
||
| 109 | 109 | 'readonly' => 'readonly' |
| 110 | 110 | ] |
| 111 | 111 | ]); |
| 112 | - $this->crud->addField([ |
|
| 112 | + $this->crud->addField ([ |
|
| 113 | 113 | 'name' => 'salary_min', |
| 114 | 114 | 'type' => 'number', |
| 115 | 115 | 'label' => 'Minimum Salary', |
| 116 | 116 | ]); |
| 117 | - $this->crud->addField([ |
|
| 117 | + $this->crud->addField ([ |
|
| 118 | 118 | 'name' => 'salary_max', |
| 119 | 119 | 'type' => 'number', |
| 120 | 120 | 'label' => 'Maximum Salary', |
| 121 | 121 | ]); |
| 122 | - $this->crud->addField([ |
|
| 122 | + $this->crud->addField ([ |
|
| 123 | 123 | 'name' => 'noc', |
| 124 | 124 | 'type' => 'number', |
| 125 | 125 | 'label' => 'NOC Code', |
| 126 | 126 | ]); |
| 127 | - $this->crud->addField([ |
|
| 127 | + $this->crud->addField ([ |
|
| 128 | 128 | 'name' => 'open_date_time', |
| 129 | 129 | 'label' => 'Open Date', |
| 130 | 130 | 'type' => 'date_picker', |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | 'format' => 'yyyy-mm-dd', |
| 134 | 134 | ], |
| 135 | 135 | ]); |
| 136 | - $this->crud->addField([ |
|
| 136 | + $this->crud->addField ([ |
|
| 137 | 137 | 'name' => 'close_date_time', |
| 138 | 138 | 'label' => 'Close Date', |
| 139 | 139 | 'type' => 'date_picker', |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | 'format' => 'yyyy-mm-dd', |
| 143 | 143 | ], |
| 144 | 144 | ]); |
| 145 | - $this->crud->addField([ |
|
| 145 | + $this->crud->addField ([ |
|
| 146 | 146 | 'name' => 'start_date_time', |
| 147 | 147 | 'label' => 'Start Date', |
| 148 | 148 | 'type' => 'date_picker', |
@@ -151,17 +151,17 @@ discard block |
||
| 151 | 151 | 'format' => 'yyyy-mm-dd', |
| 152 | 152 | ], |
| 153 | 153 | ]); |
| 154 | - $this->crud->addField([ |
|
| 154 | + $this->crud->addField ([ |
|
| 155 | 155 | 'name' => 'process_number', |
| 156 | 156 | 'type' => 'number', |
| 157 | 157 | 'label' => 'Process #', |
| 158 | 158 | ]); |
| 159 | - $this->crud->addField([ |
|
| 159 | + $this->crud->addField ([ |
|
| 160 | 160 | 'name' => 'priority_clearance_number', |
| 161 | 161 | 'type' => 'number', |
| 162 | 162 | 'label' => 'Priority Clearance #', |
| 163 | 163 | ]); |
| 164 | - $this->crud->addField([ |
|
| 164 | + $this->crud->addField ([ |
|
| 165 | 165 | 'name' => 'loo_issuance_date', |
| 166 | 166 | 'type' => 'date_picker', |
| 167 | 167 | 'label' => 'Letter of Offer Issuance Date', |
@@ -170,10 +170,10 @@ discard block |
||
| 170 | 170 | 'format' => 'yyyy-mm-dd', |
| 171 | 171 | ], |
| 172 | 172 | ]); |
| 173 | - if ($this->crud->getCurrentEntry() && |
|
| 174 | - !$this->crud->getCurrentEntry()->published |
|
| 173 | + if ($this->crud->getCurrentEntry () && |
|
| 174 | + !$this->crud->getCurrentEntry ()->published |
|
| 175 | 175 | ) { |
| 176 | - $this->crud->addField([ |
|
| 176 | + $this->crud->addField ([ |
|
| 177 | 177 | 'name' => 'published', |
| 178 | 178 | 'label' => 'Publish', |
| 179 | 179 | 'type' => 'checkbox' |
@@ -181,22 +181,22 @@ discard block |
||
| 181 | 181 | } |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | - public function update() |
|
| 184 | + public function update () |
|
| 185 | 185 | { |
| 186 | - $open_date = $this->crud->request->request->get('open_date_time'); |
|
| 187 | - $close_date = $this->crud->request->request->get('close_date_time'); |
|
| 188 | - $start_date = $this->crud->request->request->get('start_date_time'); |
|
| 189 | - $this->crud->request->request->remove('open_date_time'); |
|
| 190 | - $this->crud->request->request->remove('close_date_time'); |
|
| 191 | - $this->crud->request->request->remove('start_date_time'); |
|
| 186 | + $open_date = $this->crud->request->request->get ('open_date_time'); |
|
| 187 | + $close_date = $this->crud->request->request->get ('close_date_time'); |
|
| 188 | + $start_date = $this->crud->request->request->get ('start_date_time'); |
|
| 189 | + $this->crud->request->request->remove ('open_date_time'); |
|
| 190 | + $this->crud->request->request->remove ('close_date_time'); |
|
| 191 | + $this->crud->request->request->remove ('start_date_time'); |
|
| 192 | 192 | // Manipulates the input fields to save the "end of day" timestamp for |
| 193 | 193 | // open/close/start dates. |
| 194 | - $this->crud->request->request->add([ |
|
| 195 | - 'open_date_time' => ptDayStartToUtcTime($open_date), |
|
| 196 | - 'close_date_time' => ptDayEndToUtcTime($close_date), |
|
| 197 | - 'start_date_time' => ptDayStartToUtcTime($start_date), |
|
| 194 | + $this->crud->request->request->add ([ |
|
| 195 | + 'open_date_time' => ptDayStartToUtcTime ($open_date), |
|
| 196 | + 'close_date_time' => ptDayEndToUtcTime ($close_date), |
|
| 197 | + 'start_date_time' => ptDayStartToUtcTime ($start_date), |
|
| 198 | 198 | ]); |
| 199 | - $response = $this->traitUpdate(); |
|
| 199 | + $response = $this->traitUpdate (); |
|
| 200 | 200 | |
| 201 | 201 | return $response; |
| 202 | 202 | } |