@@ 97-110 (lines=14) @@ | ||
94 | /** |
|
95 | * Send all overdue tasks for one user in one email. |
|
96 | */ |
|
97 | public function sendGroupOverdueTaskNotifications() |
|
98 | { |
|
99 | $tasks = $this->taskFinderModel->getOverdueTasks(); |
|
100 | ||
101 | foreach ($this->groupByColumn($tasks, 'owner_id') as $user_tasks) { |
|
102 | $users = $this->userNotificationModel->getUsersWithNotificationEnabled($user_tasks[0]['project_id']); |
|
103 | ||
104 | foreach ($users as $user) { |
|
105 | $this->sendUserOverdueTaskNotifications($user, $user_tasks); |
|
106 | } |
|
107 | } |
|
108 | ||
109 | return $tasks; |
|
110 | } |
|
111 | ||
112 | /** |
|
113 | * Send all overdue tasks in one email to project manager(s). |
|
@@ 141-154 (lines=14) @@ | ||
138 | /** |
|
139 | * Send overdue tasks. |
|
140 | */ |
|
141 | public function sendOverdueTaskNotifications() |
|
142 | { |
|
143 | $tasks = $this->taskFinderModel->getOverdueTasks(); |
|
144 | ||
145 | foreach ($this->groupByColumn($tasks, 'project_id') as $project_id => $project_tasks) { |
|
146 | $users = $this->userNotificationModel->getUsersWithNotificationEnabled($project_id); |
|
147 | ||
148 | foreach ($users as $user) { |
|
149 | $this->sendUserOverdueTaskNotifications($user, $project_tasks); |
|
150 | } |
|
151 | } |
|
152 | ||
153 | return $tasks; |
|
154 | } |
|
155 | ||
156 | /** |
|
157 | * Send overdue tasks for a given user. |