Add email notifications

This commit is contained in:
Frédéric Guillot
2014-08-15 17:23:41 -07:00
parent c539bdc8ab
commit 9eeded33f6
240 changed files with 23410 additions and 308 deletions

View File

@@ -6,6 +6,7 @@
<?= Helper\form_csrf() ?>
<?= Helper\form_hidden('id', $values) ?>
<?= Helper\form_hidden('task_id', $values) ?>
<?= Helper\form_textarea('comment', $values, $errors, array('autofocus', 'required', 'placeholder="'.t('Leave a comment').'"'), 'comment-textarea') ?><br/>
<div class="form-actions">

View File

@@ -31,14 +31,25 @@
<div class="page-header">
<h2><?= t('User settings') ?></h2>
</div>
<section class="settings">
<ul>
<li>
<strong><?= t('My default project:') ?> </strong>
<?= (isset($user['default_project_id']) && isset($projects[$user['default_project_id']])) ? Helper\escape($projects[$user['default_project_id']]) : t('None') ?>,
<a href="?controller=user&amp;action=edit&amp;user_id=<?= $user['id'] ?>"><?= t('edit') ?></a>
</li>
</ul>
<section>
<h3 id="notifications"><?= t('Email notifications') ?></h3>
<form method="post" action="?controller=config&amp;action=notifications" autocomplete="off">
<?= Helper\form_csrf() ?>
<?= Helper\form_checkbox('notifications_enabled', t('Enable email notifications'), '1', $notifications['notifications_enabled'] == 1) ?><br/>
<p><?= t('I want to receive notifications only for those projects:') ?><br/><br/></p>
<div class="form-checkbox-group">
<?php foreach ($user_projects as $project_id => $project_name): ?>
<?= Helper\form_checkbox('projects['.$project_id.']', $project_name, '1', isset($notifications['project_'.$project_id])) ?>
<?php endforeach ?>
</div>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div>
</form>
</section>
<?php if ($user['is_admin']): ?>

View File

@@ -0,0 +1,8 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h3><?= t('New comment posted by %s', $comment['username']) ?></h3>
<?= Helper\parse($comment['comment']) ?>
<hr/>
<p>Kanboard</p>

View File

@@ -0,0 +1,8 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h3><?= t('Comment updated') ?></h3>
<?= Helper\parse($comment['comment']) ?>
<hr/>
<p>Kanboard</p>

View File

@@ -0,0 +1,6 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h3><?= t('New attachment added "%s"', $file['name']) ?></h3>
<hr/>
<p>Kanboard</p>

View File

@@ -0,0 +1,18 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h3><?= t('New sub-task') ?></h3>
<ul>
<li><?= t('Title:') ?> <?= Helper\escape($subtask['title']) ?></li>
<li><?= t('Status:') ?> <?= Helper\escape($subtask['status_name']) ?></li>
<li><?= t('Assignee:') ?> <?= Helper\escape($subtask['name'] ?: $subtask['username'] ?: '?') ?></li>
<li>
<?= t('Time tracking:') ?>
<?php if (! empty($subtask['time_estimated'])): ?>
<strong><?= Helper\escape($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
<?php endif ?>
</li>
</ul>
<hr/>
<p>Kanboard</p>

View File

@@ -0,0 +1,22 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<h3><?= t('Sub-task updated') ?></h3>
<ul>
<li><?= t('Title:') ?> <?= Helper\escape($subtask['title']) ?></li>
<li><?= t('Status:') ?> <?= Helper\escape($subtask['status_name']) ?></li>
<li><?= t('Assignee:') ?> <?= Helper\escape($subtask['name'] ?: $subtask['username'] ?: '?') ?></li>
<li>
<?= t('Time tracking:') ?>
<?php if (! empty($subtask['time_spent'])): ?>
<strong><?= Helper\escape($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?>
<?php endif ?>
<?php if (! empty($subtask['time_estimated'])): ?>
<strong><?= Helper\escape($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
<?php endif ?>
</li>
</ul>
<hr/>
<p>Kanboard</p>

View File

@@ -0,0 +1,6 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<p><?= t('The task #%d have been closed.', $task['id']) ?></p>
<hr/>
<p>Kanboard</p>

View File

@@ -0,0 +1,44 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<ul>
<li>
<?= dt('Created on %B %e, %Y at %k:%M %p', $task['date_creation']) ?>
</li>
<?php if ($task['date_due']): ?>
<li>
<strong><?= dt('Must be done before %B %e, %Y', $task['date_due']) ?></strong>
</li>
<?php endif ?>
<?php if ($task['creator_username']): ?>
<li>
<?= t('Created by %s', $task['creator_username']) ?>
</li>
<?php endif ?>
<li>
<strong>
<?php if ($task['assignee_username']): ?>
<?= t('Assigned to %s', $task['assignee_username']) ?>
<?php else: ?>
<?= t('There is nobody assigned') ?>
<?php endif ?>
</strong>
</li>
<li>
<?= t('Column on the board:') ?>
<strong><?= Helper\escape($task['column_title']) ?></strong>
</li>
<li><?= t('Task position:').' '.Helper\escape($task['position']) ?></li>
<?php if ($task['category_name']): ?>
<li>
<?= t('Category:') ?> <strong><?= Helper\escape($task['category_name']) ?></strong>
</li>
<?php endif ?>
</ul>
<?php if (! empty($task['description'])): ?>
<h2><?= t('Description') ?></h2>
<?= Helper\parse($task['description']) ?>
<?php endif ?>
<hr/>
<p>Kanboard</p>

View File

@@ -0,0 +1,10 @@
<h2><?= t('List of due tasks for the project "%s"', $project) ?></h2>
<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>
<?php endforeach ?>
</ul>
<hr/>
<p>Kanboard</p>

View File

@@ -0,0 +1,6 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<p><?= t('The task #%d have been opened.', $task['id']) ?></p>
<hr/>
<p>Kanboard</p>

View File

@@ -0,0 +1,44 @@
<h2><?= Helper\escape($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<ul>
<li>
<?= dt('Created on %B %e, %Y at %k:%M %p', $task['date_creation']) ?>
</li>
<?php if ($task['date_due']): ?>
<li>
<strong><?= dt('Must be done before %B %e, %Y', $task['date_due']) ?></strong>
</li>
<?php endif ?>
<?php if ($task['creator_username']): ?>
<li>
<?= t('Created by %s', $task['creator_username']) ?>
</li>
<?php endif ?>
<li>
<strong>
<?php if ($task['assignee_username']): ?>
<?= t('Assigned to %s', $task['assignee_username']) ?>
<?php else: ?>
<?= t('There is nobody assigned') ?>
<?php endif ?>
</strong>
</li>
<li>
<?= t('Column on the board:') ?>
<strong><?= Helper\escape($task['column_title']) ?></strong>
</li>
<li><?= t('Task position:').' '.Helper\escape($task['position']) ?></li>
<?php if ($task['category_name']): ?>
<li>
<?= t('Category:') ?> <strong><?= Helper\escape($task['category_name']) ?></strong>
</li>
<?php endif ?>
</ul>
<?php if (! empty($task['description'])): ?>
<h2><?= t('Description') ?></h2>
<?= Helper\parse($task['description']) ?: t('There is no description.') ?>
<?php endif ?>
<hr/>
<p>Kanboard</p>