1 | <?php |
||
11 | class ActionItemsComposer |
||
12 | { |
||
13 | /** |
||
14 | * Bind data to the view. |
||
15 | * |
||
16 | * @param View $view |
||
17 | * |
||
18 | * @return void |
||
19 | */ |
||
20 | public function compose(View $view) |
||
30 | |||
31 | /** |
||
32 | * @return \Illuminate\Database\Eloquent\Collection|static[] |
||
33 | */ |
||
34 | private function getDueTraining() |
||
50 | |||
51 | /** |
||
52 | * @return \Illuminate\Database\Eloquent\Collection|static[] |
||
53 | */ |
||
54 | private function getExpiringVisits() |
||
62 | |||
63 | /** |
||
64 | * @return Collection |
||
65 | */ |
||
66 | private function getEligibilityRenewal() |
||
79 | |||
80 | /** |
||
81 | * @param $user |
||
82 | * |
||
83 | * @return int |
||
84 | */ |
||
85 | private function calculateDaysToRenewClearance($user) |
||
86 | { |
||
87 | $years = 100; |
||
88 | if ($user->clearance == 'TS' || $user->clearance == 'Int TS' || $user->clearance == 'SCI') { |
||
89 | $years = 6; |
||
90 | } elseif ($user->clearance == 'S' || $user->clearance == 'Int S') { |
||
91 | $years = 10; |
||
92 | } |
||
93 | |||
94 | if ($user->cont_eval) |
||
95 | $calculatedDays = Carbon::now()->diffInDays( |
||
96 | Carbon::createFromFormat('Y-m-d', $user->cont_eval_date)->addYears($years), false); |
||
97 | else |
||
98 | $calculatedDays = Carbon::now()->diffInDays( |
||
99 | Carbon::createFromFormat('Y-m-d', $user->inv_close)->addYears($years), false); |
||
100 | |||
101 | return $calculatedDays; |
||
102 | } |
||
103 | |||
104 | /** |
||
105 | * @param int $calculatedDays |
||
106 | * @param $user |
||
107 | * @param $builtUser |
||
108 | */ |
||
109 | private function buildUserArray($calculatedDays, Collection $builtUser, User $user) |
||
119 | |||
120 | /** |
||
121 | * @param Collection $userArray |
||
122 | */ |
||
123 | private function sortUserCollection($userArray) |
||
129 | } |
||
130 |