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 | |||
89 | if ($user->access_level == 'TS' || $user->access_level == 'Int TS') { |
||
90 | $years = 6; |
||
91 | } elseif ($user->access_level == 'S' || $user->clearance == 'S') { |
||
92 | $years = 10; |
||
93 | } elseif ($user->clearance = 'TS' || $user->clearance = 'Int TS') { |
||
|
|||
94 | $years = 6; |
||
95 | } |
||
96 | |||
97 | $calculatedDays = Carbon::now()->diffInDays( |
||
98 | Carbon::createFromFormat('Y-m-d', $user->inv_close)->addYears($years), false); |
||
99 | |||
100 | return $calculatedDays; |
||
101 | } |
||
102 | |||
103 | /** |
||
104 | * @param int $calculatedDays |
||
105 | * @param $user |
||
106 | * @param $builtUser |
||
107 | */ |
||
108 | private function buildUserArray($calculatedDays, Collection $builtUser, User $user) |
||
118 | |||
119 | /** |
||
120 | * @param Collection $userArray |
||
121 | */ |
||
122 | private function sortUserCollection($userArray) |
||
128 | } |
||
129 |