diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-09-18 15:56:43 +0200 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-09-18 15:56:43 +0200 |
commit | 7e6d35f829d63ce08f600d5d207b55244a16bdb3 (patch) | |
tree | 2017c3bcd60174989e01ed7e56b0a770b3aa69f2 /app | |
parent | c343a747431fa50cebdd7f622c8a0ddd262a9782 (diff) |
Fix bug: overdue tasks email notification
Diffstat (limited to 'app')
-rw-r--r-- | app/Model/Task.php | 4 | ||||
-rw-r--r-- | app/Templates/notification_task_due.php | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/app/Model/Task.php b/app/Model/Task.php index ddeb8a2b..84310d3c 100644 --- a/app/Model/Task.php +++ b/app/Model/Task.php @@ -69,7 +69,7 @@ class Task extends Base * @access public * @return array */ - public function getTasksDue() + public function getOverdueTasks() { $tasks = $this->db->table(self::TABLE) ->columns( @@ -85,7 +85,7 @@ class Task extends Base ->join(User::TABLE, 'id', 'owner_id') ->eq(Project::TABLE.'.is_active', 1) ->eq(self::TABLE.'.is_active', 1) - ->neq(self::TABLE.'.date_due', '') + ->neq(self::TABLE.'.date_due', 0) ->lte(self::TABLE.'.date_due', mktime(23, 59, 59)) ->findAll(); diff --git a/app/Templates/notification_task_due.php b/app/Templates/notification_task_due.php index 3a7089cf..25ecc9f1 100644 --- a/app/Templates/notification_task_due.php +++ b/app/Templates/notification_task_due.php @@ -2,7 +2,13 @@ <ul> <?php foreach ($tasks as $task): ?> - <li>(<strong>#<?= $task['id'] ?></strong>) <?= Helper\escape($task['title']) ?> (<strong><?= t('Assigned to %s', $task['assignee_name'] ?: $task['assignee_username']) ?></strong>)</li> + <li> + (<strong>#<?= $task['id'] ?></strong>) + <?= Helper\escape($task['title']) ?> + <?php if ($task['assignee_username']): ?> + (<strong><?= t('Assigned to %s', $task['assignee_name'] ?: $task['assignee_username']) ?></strong>) + <?php endif ?> + </li> <?php endforeach ?> </ul> |