diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-06-07 20:06:31 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-06-07 20:06:31 -0400 |
commit | 4f32352fe62e47ad5ea760eb00493bdc061b2407 (patch) | |
tree | 8d5f087907dd5cba196dbfc06e626b3146659e1f /app/Template | |
parent | 9d9e3afba2054bfa23ba6f019b7c8885c2d8415e (diff) |
Add user filter/condition for notifications
Diffstat (limited to 'app/Template')
-rw-r--r-- | app/Template/notification/task_overdue.php (renamed from app/Template/notification/task_due.php) | 4 | ||||
-rw-r--r-- | app/Template/user/notifications.php | 16 |
2 files changed, 15 insertions, 5 deletions
diff --git a/app/Template/notification/task_due.php b/app/Template/notification/task_overdue.php index 7482424a..dc2659dc 100644 --- a/app/Template/notification/task_due.php +++ b/app/Template/notification/task_overdue.php @@ -1,4 +1,4 @@ -<h2><?= t('List of due tasks for the project "%s"', $project) ?></h2> +<h2><?= t('Overdue tasks for the project "%s"', $project_name) ?></h2> <ul> <?php foreach ($tasks as $task): ?> @@ -16,5 +16,3 @@ </li> <?php endforeach ?> </ul> - -<?= $this->render('notification/footer', array('task' => $task)) ?> diff --git a/app/Template/user/notifications.php b/app/Template/user/notifications.php index df5cbb9b..a425705d 100644 --- a/app/Template/user/notifications.php +++ b/app/Template/user/notifications.php @@ -5,15 +5,27 @@ <form method="post" action="<?= $this->url->href('user', 'notifications', array('user_id' => $user['id'])) ?>" autocomplete="off"> <?= $this->form->csrf() ?> + <?= $this->form->checkbox('notifications_enabled', t('Enable email notifications'), '1', $notifications['notifications_enabled'] == 1) ?><br> - <?= $this->form->checkbox('notifications_enabled', t('Enable email notifications'), '1', $notifications['notifications_enabled'] == 1) ?><br/> + <hr> + + <?= t('I want to receive notifications for:') ?> + + <?= $this->form->radios('notifications_filter', array( + \Model\Notification::FILTER_NONE => t('All tasks'), + \Model\Notification::FILTER_ASSIGNEE => t('Only for tasks assigned to me'), + \Model\Notification::FILTER_CREATOR => t('Only for tasks created by me'), + \Model\Notification::FILTER_BOTH => t('Only for tasks created by me and assigned to me'), + ), $notifications) ?><br> + + <hr> <?php if (! empty($projects)): ?> <p><?= t('I want to receive notifications only for those projects:') ?><br/><br/></p> <div class="form-checkbox-group"> <?php foreach ($projects as $project_id => $project_name): ?> - <?= $this->form->checkbox('projects['.$project_id.']', $project_name, '1', isset($notifications['project_'.$project_id])) ?><br/> + <?= $this->form->checkbox('projects['.$project_id.']', $project_name, '1', isset($notifications['project_'.$project_id])) ?><br> <?php endforeach ?> </div> <?php endif ?> |