summaryrefslogtreecommitdiff
path: root/app/Model/OverdueNotification.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-03-04 16:31:34 -0500
committerFrederic Guillot <fred@kanboard.net>2016-03-04 16:31:34 -0500
commita7c157df3c0005d7c875ce972056b0c8b8872a26 (patch)
tree95a17e65d73d0b65a98bc571e4bf661952a1f656 /app/Model/OverdueNotification.php
parentabe9371f32e55c3806c8dde41d1f555e5159752d (diff)
Remove model OverdueNotification
Diffstat (limited to 'app/Model/OverdueNotification.php')
-rw-r--r--app/Model/OverdueNotification.php58
1 files changed, 0 insertions, 58 deletions
diff --git a/app/Model/OverdueNotification.php b/app/Model/OverdueNotification.php
deleted file mode 100644
index 84565548..00000000
--- a/app/Model/OverdueNotification.php
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-
-namespace Kanboard\Model;
-
-/**
- * Task Overdue Notification model
- *
- * @package model
- * @author Frederic Guillot
- */
-class OverdueNotification extends Base
-{
- /**
- * Send overdue tasks
- *
- * @access public
- */
- public function sendOverdueTaskNotifications()
- {
- $tasks = $this->taskFinder->getOverdueTasks();
-
- foreach ($this->groupByColumn($tasks, 'project_id') as $project_id => $project_tasks) {
- $users = $this->userNotification->getUsersWithNotificationEnabled($project_id);
-
- foreach ($users as $user) {
- $this->sendUserOverdueTaskNotifications($user, $project_tasks);
- }
- }
-
- return $tasks;
- }
-
- /**
- * Send overdue tasks for a given user
- *
- * @access public
- * @param array $user
- * @param array $tasks
- */
- public function sendUserOverdueTaskNotifications(array $user, array $tasks)
- {
- $user_tasks = array();
-
- foreach ($tasks as $task) {
- if ($this->userNotificationFilter->shouldReceiveNotification($user, array('task' => $task))) {
- $user_tasks[] = $task;
- }
- }
-
- if (! empty($user_tasks)) {
- $this->userNotification->sendUserNotification(
- $user,
- Task::EVENT_OVERDUE,
- array('tasks' => $user_tasks, 'project_name' => $tasks[0]['project_name'])
- );
- }
- }
-}