diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-05-24 16:02:25 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-05-24 16:02:25 -0400 |
commit | eeac2329baab1fdae7cbf6c707ed2ffd8beb4c1b (patch) | |
tree | 511c2fe47f8fbb1ea90e59e7a7a7f5e3530aa9ed /app/Template/budget | |
parent | 65e9e5d1bed9f88ecfd43eb2c1e780a7c22c151f (diff) |
Helpers refactoring
Diffstat (limited to 'app/Template/budget')
-rw-r--r-- | app/Template/budget/breakdown.php | 10 | ||||
-rw-r--r-- | app/Template/budget/create.php | 26 | ||||
-rw-r--r-- | app/Template/budget/index.php | 8 | ||||
-rw-r--r-- | app/Template/budget/remove.php | 4 |
4 files changed, 24 insertions, 24 deletions
diff --git a/app/Template/budget/breakdown.php b/app/Template/budget/breakdown.php index 51044c46..3275a66a 100644 --- a/app/Template/budget/breakdown.php +++ b/app/Template/budget/breakdown.php @@ -1,8 +1,8 @@ <div class="page-header"> <h2><?= t('Budget') ?></h2> <ul> - <li><?= $this->a(t('Budget lines'), 'budget', 'create', array('project_id' => $project['id'])) ?></li> - <li><?= $this->a(t('Cost breakdown'), 'budget', 'breakdown', array('project_id' => $project['id'])) ?></li> + <li><?= $this->url->link(t('Budget lines'), 'budget', 'create', array('project_id' => $project['id'])) ?></li> + <li><?= $this->url->link(t('Cost breakdown'), 'budget', 'breakdown', array('project_id' => $project['id'])) ?></li> </ul> </div> @@ -20,9 +20,9 @@ </tr> <?php foreach ($paginator->getCollection() as $record): ?> <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->a($this->e($record['name'] ?: $record['username']), 'user', 'show', array('user_id' => $record['user_id'])) ?></td> + <td><?= $this->url->link($this->e($record['task_title']), 'task', 'show', array('project_id' => $project['id'], 'task_id' => $record['task_id'])) ?></td> + <td><?= $this->url->link($this->e($record['subtask_title']), 'task', 'show', array('project_id' => $project['id'], 'task_id' => $record['task_id'])) ?></td> + <td><?= $this->url->link($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/budget/create.php b/app/Template/budget/create.php index 5b2976f4..d64bbc48 100644 --- a/app/Template/budget/create.php +++ b/app/Template/budget/create.php @@ -1,8 +1,8 @@ <div class="page-header"> <h2><?= t('Budget') ?></h2> <ul> - <li><?= $this->a(t('Budget lines'), 'budget', 'create', array('project_id' => $project['id'])) ?></li> - <li><?= $this->a(t('Cost breakdown'), 'budget', 'breakdown', array('project_id' => $project['id'])) ?></li> + <li><?= $this->url->link(t('Budget lines'), 'budget', 'create', array('project_id' => $project['id'])) ?></li> + <li><?= $this->url->link(t('Cost breakdown'), 'budget', 'breakdown', array('project_id' => $project['id'])) ?></li> </ul> </div> @@ -20,7 +20,7 @@ <td><?= dt('%B %e, %Y', strtotime($line['date'])) ?></td> <td><?= $this->e($line['comment']) ?></td> <td> - <?= $this->a(t('Remove'), 'budget', 'confirm', array('project_id' => $project['id'], 'budget_id' => $line['id'])) ?> + <?= $this->url->link(t('Remove'), 'budget', 'confirm', array('project_id' => $project['id'], 'budget_id' => $line['id'])) ?> </td> </tr> <?php endforeach ?> @@ -29,21 +29,21 @@ <h3><?= t('New budget line') ?></h3> <?php endif ?> -<form method="post" action="<?= $this->u('budget', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off"> +<form method="post" action="<?= $this->url->href('budget', 'save', array('project_id' => $project['id'])) ?>" autocomplete="off"> - <?= $this->formCsrf() ?> + <?= $this->form->csrf() ?> - <?= $this->formHidden('id', $values) ?> - <?= $this->formHidden('project_id', $values) ?> + <?= $this->form->hidden('id', $values) ?> + <?= $this->form->hidden('project_id', $values) ?> - <?= $this->formLabel(t('Amount'), 'amount') ?> - <?= $this->formText('amount', $values, $errors, array('required'), 'form-numeric') ?> + <?= $this->form->label(t('Amount'), 'amount') ?> + <?= $this->form->text('amount', $values, $errors, array('required'), 'form-numeric') ?> - <?= $this->formLabel(t('Date'), 'date') ?> - <?= $this->formText('date', $values, $errors, array('required'), 'form-date') ?> + <?= $this->form->label(t('Date'), 'date') ?> + <?= $this->form->text('date', $values, $errors, array('required'), 'form-date') ?> - <?= $this->formLabel(t('Comment'), 'comment') ?> - <?= $this->formText('comment', $values, $errors) ?> + <?= $this->form->label(t('Comment'), 'comment') ?> + <?= $this->form->text('comment', $values, $errors) ?> <div class="form-actions"> <input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/> diff --git a/app/Template/budget/index.php b/app/Template/budget/index.php index 01525829..d9fefc67 100644 --- a/app/Template/budget/index.php +++ b/app/Template/budget/index.php @@ -1,11 +1,11 @@ -<?= $this->js('assets/js/vendor/d3.v3.4.8.min.js') ?> -<?= $this->js('assets/js/vendor/dimple.v2.1.2.min.js') ?> +<?= $this->asset->js('assets/js/vendor/d3.v3.4.8.min.js') ?> +<?= $this->asset->js('assets/js/vendor/dimple.v2.1.2.min.js') ?> <div class="page-header"> <h2><?= t('Budget') ?></h2> <ul> - <li><?= $this->a(t('Budget lines'), 'budget', 'create', array('project_id' => $project['id'])) ?></li> - <li><?= $this->a(t('Cost breakdown'), 'budget', 'breakdown', array('project_id' => $project['id'])) ?></li> + <li><?= $this->url->link(t('Budget lines'), 'budget', 'create', array('project_id' => $project['id'])) ?></li> + <li><?= $this->url->link(t('Cost breakdown'), 'budget', 'breakdown', array('project_id' => $project['id'])) ?></li> </ul> </div> diff --git a/app/Template/budget/remove.php b/app/Template/budget/remove.php index 97f9c3dc..a5b906a1 100644 --- a/app/Template/budget/remove.php +++ b/app/Template/budget/remove.php @@ -6,8 +6,8 @@ <p class="alert alert-info"><?= t('Do you really want to remove this budget line?') ?></p> <div class="form-actions"> - <?= $this->a(t('Yes'), 'budget', 'remove', array('project_id' => $project['id'], 'budget_id' => $budget_id), true, 'btn btn-red') ?> + <?= $this->url->link(t('Yes'), 'budget', 'remove', array('project_id' => $project['id'], 'budget_id' => $budget_id), true, 'btn btn-red') ?> <?= t('or') ?> - <?= $this->a(t('cancel'), 'budget', 'create', array('project_id' => $project['id'])) ?> + <?= $this->url->link(t('cancel'), 'budget', 'create', array('project_id' => $project['id'])) ?> </div> </div>
\ No newline at end of file |