From 4f32352fe62e47ad5ea760eb00493bdc061b2407 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 7 Jun 2015 20:06:31 -0400 Subject: Add user filter/condition for notifications --- app/Console/TaskOverdueNotification.php | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'app/Console') diff --git a/app/Console/TaskOverdueNotification.php b/app/Console/TaskOverdueNotification.php index 86a7d1b9..3d254ae4 100644 --- a/app/Console/TaskOverdueNotification.php +++ b/app/Console/TaskOverdueNotification.php @@ -19,25 +19,7 @@ class TaskOverdueNotification extends Base protected function execute(InputInterface $input, OutputInterface $output) { - $projects = array(); - $tasks = $this->taskFinder->getOverdueTasks(); - - // Group tasks by project - foreach ($tasks as $task) { - $projects[$task['project_id']][] = $task; - } - - // Send notifications for each project - foreach ($projects as $project_id => $project_tasks) { - - $users = $this->notification->getUsersList($project_id); - - $this->notification->sendEmails( - 'task_due', - $users, - array('tasks' => $project_tasks, 'project' => $project_tasks[0]['project_name']) - ); - } + $tasks = $this->notification->sendOverdueTaskNotifications(); if ($input->getOption('show')) { $this->showTable($output, $tasks); -- cgit v1.2.3