summaryrefslogtreecommitdiff
path: root/app/Template
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-03-28 18:00:18 -0400
committerFrederic Guillot <fred@kanboard.net>2015-03-28 18:00:18 -0400
commit9bfab51e00608b6e008aa71f6df74104b28fc662 (patch)
treec390346c8ed384c78bf85bbdd950d70bd9a9ab51 /app/Template
parenteb6853c163e9059bbbc89a1a741d4a25c8e04153 (diff)
Add currency rates for budget calculation
Diffstat (limited to 'app/Template')
-rw-r--r--app/Template/budget/breakdown.php2
-rw-r--r--app/Template/config/sidebar.php3
-rw-r--r--app/Template/currency/index.php56
3 files changed, 60 insertions, 1 deletions
diff --git a/app/Template/budget/breakdown.php b/app/Template/budget/breakdown.php
index d4168406..0a3c63d7 100644
--- a/app/Template/budget/breakdown.php
+++ b/app/Template/budget/breakdown.php
@@ -22,7 +22,7 @@
<tr>
<td><?= $this->a($this->e($record['task_title']), 'task', 'show', array('project_id' => $project['id'], 'task_id' => $record['task_id'])) ?></td>
<td><?= $this->a($this->e($record['subtask_title']), 'task', 'show', array('project_id' => $project['id'], 'task_id' => $record['task_id'])) ?></td>
- <td><?= $this->e($record['name'] ?: $record['username']) ?></td>
+ <td><?= $this->a($this->e($record['name'] ?: $record['username']), 'user', 'show', array('user_id' => $record['user_id'])) ?></td>
<td><?= n($record['cost']) ?></td>
<td><?= n($record['time_spent']).' '.t('hours') ?></td>
<td><?= dt('%B %e, %Y', $record['start']) ?></td>
diff --git a/app/Template/config/sidebar.php b/app/Template/config/sidebar.php
index 89f2c203..2e81d48a 100644
--- a/app/Template/config/sidebar.php
+++ b/app/Template/config/sidebar.php
@@ -14,6 +14,9 @@
<?= $this->a(t('Link settings'), 'link', 'index') ?>
</li>
<li>
+ <?= $this->a(t('Currency rates'), 'currency', 'index') ?>
+ </li>
+ <li>
<?= $this->a(t('Webhooks'), 'config', 'webhook') ?>
</li>
<li>
diff --git a/app/Template/currency/index.php b/app/Template/currency/index.php
new file mode 100644
index 00000000..7839a142
--- /dev/null
+++ b/app/Template/currency/index.php
@@ -0,0 +1,56 @@
+<div class="page-header">
+ <h2><?= t('Currency rates') ?></h2>
+</div>
+
+<?php if (! empty($rates)): ?>
+
+<table class="table-stripped">
+ <tr>
+ <th class="column-35"><?= t('Currency') ?></th>
+ <th><?= t('Rate') ?></th>
+ </tr>
+ <?php foreach ($rates as $rate): ?>
+ <tr>
+ <td>
+ <strong><?= $this->e($rate['currency']) ?></strong>
+ </td>
+ <td>
+ <?= n($rate['rate']) ?>
+ </td>
+ </tr>
+ <?php endforeach ?>
+</table>
+
+<hr/>
+<h3><?= t('Change reference currency') ?></h3>
+<?php endif ?>
+<form method="post" action="<?= $this->u('currency', 'reference') ?>" autocomplete="off">
+
+ <?= $this->formCsrf() ?>
+
+ <?= $this->formLabel(t('Reference currency'), 'application_currency') ?>
+ <?= $this->formSelect('application_currency', $currencies, $config_values, $errors) ?><br/>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ </div>
+</form>
+
+<hr/>
+<h3><?= t('Add a new currency rate') ?></h3>
+<form method="post" action="<?= $this->u('currency', 'create') ?>" autocomplete="off">
+
+ <?= $this->formCsrf() ?>
+
+ <?= $this->formLabel(t('Currency'), 'currency') ?>
+ <?= $this->formSelect('currency', $currencies, $values, $errors) ?><br/>
+
+ <?= $this->formLabel(t('Rate'), 'rate') ?>
+ <?= $this->formText('rate', $values, $errors, array(), 'form-numeric') ?><br/>
+
+ <div class="form-actions">
+ <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
+ </div>
+</form>
+
+<p class="alert alert-info"><?= t('Currency rates are used to calculate project budget.') ?></p>