Avoid passing application_url argument to all notification templates

This commit is contained in:
Frederic Guillot 2017-02-19 12:14:54 -05:00
parent 778c9d8212
commit dc7c7667ec
24 changed files with 23 additions and 27 deletions

View File

@ -88,7 +88,6 @@ class TaskEmail extends Base
$this->getParam('subject'),
$this->template->render('notification/task_create', array(
'task' => $data['task'],
'application_url' => $this->configModel->get('application_url'),
))
);

View File

@ -116,7 +116,7 @@ class TaskEmailNoActivity extends Base
$user['email'],
$user['name'] ?: $user['username'],
$this->getParam('subject'),
$this->template->render('notification/task_create', array('task' => $task, 'application_url' => $this->configModel->get('application_url')))
$this->template->render('notification/task_create', array('task' => $task))
);
return true;

View File

@ -62,10 +62,7 @@ class MailNotification extends Base implements NotificationInterface
*/
public function getMailContent($event_name, array $event_data)
{
return $this->template->render(
'notification/'.str_replace('.', '_', $event_name),
$event_data + array('application_url' => $this->configModel->get('application_url'))
);
return $this->template->render('notification/'.str_replace('.', '_', $event_name), $event_data);
}
/**

View File

@ -8,4 +8,4 @@
<?= $this->text->markdown($comment['comment'], true) ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -4,4 +4,4 @@
<?= $this->text->markdown($comment['comment'], true) ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -4,4 +4,4 @@
<?= $this->text->markdown($comment['comment'], true) ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -4,4 +4,4 @@
<?= $this->text->markdown($comment['comment'], true) ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -1,7 +1,7 @@
<hr/>
Kanboard
<?php if (isset($application_url) && ! empty($application_url)): ?>
<?php if ($this->app->config('application_url') != ''): ?>
- <?= $this->url->absoluteLink(t('view the task on Kanboard'), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
- <?= $this->url->absoluteLink(t('view the board on Kanboard'), 'BoardViewController', 'show', array('project_id' => $task['project_id'])) ?>
<?php endif ?>

View File

@ -14,4 +14,4 @@
</li>
</ul>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -8,4 +8,4 @@
<li><?= t('Assignee:') ?> <?= $this->text->e($subtask['name'] ?: $subtask['username'] ?: '?') ?></li>
</ul>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -18,4 +18,4 @@
</li>
</ul>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -17,4 +17,4 @@
<?= $this->text->markdown($task['description'], true) ?: t('There is no description.') ?>
<?php endif ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -2,4 +2,4 @@
<p><?= t('The task #%d have been closed.', $task['id']) ?></p>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -40,4 +40,4 @@
<?= $this->text->markdown($task['description'], true) ?>
<?php endif ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -2,4 +2,4 @@
<p><?= t('New attachment added "%s"', $file['name']) ?></p>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -8,4 +8,4 @@
) ?>
</p>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -8,4 +8,4 @@
) ?>
</p>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -8,4 +8,4 @@
<li><?= t('Task position:').' '.$this->text->e($task['position']) ?></li>
</ul>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -8,4 +8,4 @@
<li><?= t('Task position:').' '.$this->text->e($task['position']) ?></li>
</ul>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -16,4 +16,4 @@
<li><?= t('Task position:').' '.$this->text->e($task['position']) ?></li>
</ul>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -2,4 +2,4 @@
<p><?= t('The task #%d have been opened.', $task['id']) ?></p>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -1,4 +1,4 @@
<h2><?= $this->text->e($task['title']) ?> (#<?= $task['id'] ?>)</h2>
<?= $this->render('task/changes', array('changes' => $changes, 'task' => $task, 'public' => true)) ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -4,4 +4,4 @@
<h2><?= t('Description') ?></h2>
<?= $this->text->markdown($task['description'], true) ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $application_url)) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>

View File

@ -43,4 +43,4 @@
<?= $this->text->markdown($task['description'], true) ?>
<?php endif ?>
<?= $this->render('notification/footer', array('task' => $task, 'application_url' => $this->app->config('application_url'))) ?>
<?= $this->render('notification/footer', array('task' => $task)) ?>