From d67d7c54e65e80d1b484490e42dbecb969aa7686 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 3 Oct 2015 12:09:27 -0400 Subject: Add web notifications --- app/Template/user/create_local.php | 2 +- app/Template/user/create_remote.php | 2 +- app/Template/user/notifications.php | 27 +++++++++------------------ app/Template/user/sidebar.php | 2 +- 4 files changed, 12 insertions(+), 21 deletions(-) (limited to 'app/Template/user') diff --git a/app/Template/user/create_local.php b/app/Template/user/create_local.php index 3c8b43b0..98c38f0d 100644 --- a/app/Template/user/create_local.php +++ b/app/Template/user/create_local.php @@ -37,7 +37,7 @@ form->label(t('Language'), 'language') ?> form->select('language', $languages, $values, $errors) ?>
- form->checkbox('notifications_enabled', t('Enable notifications'), 1, isset($values['notifications_enabled']) && $values['notifications_enabled'] == 1 ? true : false) ?> + form->checkbox('notifications_enabled', t('Enable email notifications'), 1, isset($values['notifications_enabled']) && $values['notifications_enabled'] == 1 ? true : false) ?> form->checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?> form->checkbox('is_project_admin', t('Project Administrator'), 1, isset($values['is_project_admin']) && $values['is_project_admin'] == 1 ? true : false) ?> diff --git a/app/Template/user/create_remote.php b/app/Template/user/create_remote.php index 559d3d72..49d1548c 100644 --- a/app/Template/user/create_remote.php +++ b/app/Template/user/create_remote.php @@ -40,7 +40,7 @@ form->label(t('Language'), 'language') ?> form->select('language', $languages, $values, $errors) ?>
- form->checkbox('notifications_enabled', t('Enable notifications'), 1, isset($values['notifications_enabled']) && $values['notifications_enabled'] == 1 ? true : false) ?> + form->checkbox('notifications_enabled', t('Enable email notifications'), 1, isset($values['notifications_enabled']) && $values['notifications_enabled'] == 1 ? true : false) ?> form->checkbox('is_admin', t('Administrator'), 1, isset($values['is_admin']) && $values['is_admin'] == 1 ? true : false) ?> form->checkbox('is_project_admin', t('Project Administrator'), 1, isset($values['is_project_admin']) && $values['is_project_admin'] == 1 ? true : false) ?> form->checkbox('disable_login_form', t('Disallow login form'), 1, isset($values['disable_login_form']) && $values['disable_login_form'] == 1) ?> diff --git a/app/Template/user/notifications.php b/app/Template/user/notifications.php index a425705d..7223013c 100644 --- a/app/Template/user/notifications.php +++ b/app/Template/user/notifications.php @@ -1,33 +1,24 @@
form->csrf() ?> - form->checkbox('notifications_enabled', t('Enable email notifications'), '1', $notifications['notifications_enabled'] == 1) ?>
+ form->checkbox('notifications_enabled', t('Enable notifications'), '1', $notifications['notifications_enabled'] == 1) ?>

- - - - 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) ?>
+

+ form->checkboxes('notification_types', $types, $notifications) ?>
+

+ form->radios('notifications_filter', $filters, $notifications) ?> +
-



- -
- $project_name): ?> - form->checkbox('projects['.$project_id.']', $project_name, '1', isset($notifications['project_'.$project_id])) ?>
- -
+

+ form->checkboxes('notification_projects', $projects, $notifications) ?>
diff --git a/app/Template/user/sidebar.php b/app/Template/user/sidebar.php index 640c8b80..ca1e0621 100644 --- a/app/Template/user/sidebar.php +++ b/app/Template/user/sidebar.php @@ -51,7 +51,7 @@ url->link(t('Public access'), 'user', 'share', array('user_id' => $user['id'])) ?>
  • app->getRouterController() === 'user' && $this->app->getRouterAction() === 'notifications' ? 'class="active"' : '' ?>> - url->link(t('Email notifications'), 'user', 'notifications', array('user_id' => $user['id'])) ?> + url->link(t('Notifications'), 'user', 'notifications', array('user_id' => $user['id'])) ?>
  • app->getRouterController() === 'user' && $this->app->getRouterAction() === 'external' ? 'class="active"' : '' ?>> url->link(t('External accounts'), 'user', 'external', array('user_id' => $user['id'])) ?> -- cgit v1.2.3