summaryrefslogtreecommitdiff
path: root/app/Templates/subtask_show.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-09-08 23:19:40 +0200
committerFrédéric Guillot <fred@kanboard.net>2014-09-08 23:19:40 +0200
commite383c069f1aeba49ea9905f77a51bf663e614b0e (patch)
tree8164aa9e1fad104997e53c6e261bec991631dbbb /app/Templates/subtask_show.php
parent8c6df9ef0cea757d25cbbcc6fa7cee86d8739627 (diff)
Add public view for tasks
Diffstat (limited to 'app/Templates/subtask_show.php')
-rw-r--r--app/Templates/subtask_show.php122
1 files changed, 66 insertions, 56 deletions
diff --git a/app/Templates/subtask_show.php b/app/Templates/subtask_show.php
index 968473af..ffabbff4 100644
--- a/app/Templates/subtask_show.php
+++ b/app/Templates/subtask_show.php
@@ -1,60 +1,70 @@
-<div class="page-header">
- <h2><?= t('Sub-Tasks') ?></h2>
-</div>
+<?php if (! empty($subtasks)): ?>
+<div id="subtasks" class="task-show-section">
-<?php
-
-$total_spent = 0;
-$total_estimated = 0;
-$total_remaining = 0;
-
-?>
-
-<table class="subtasks-table">
- <tr>
- <th width="40%"><?= t('Title') ?></th>
- <th><?= t('Status') ?></th>
- <th><?= t('Assignee') ?></th>
- <th><?= t('Time tracking') ?></th>
- <th><?= t('Actions') ?></th>
- </tr>
- <?php foreach ($subtasks as $subtask): ?>
- <tr>
- <td><?= Helper\escape($subtask['title']) ?></td>
- <td><?= Helper\escape($subtask['status_name']) ?></td>
- <td>
- <?php if (! empty($subtask['username'])): ?>
- <?= Helper\escape($subtask['name'] ?: $subtask['username']) ?>
- <?php endif ?>
- </td>
- <td>
- <?php if (! empty($subtask['time_spent'])): ?>
- <strong><?= Helper\escape($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?>
+ <div class="page-header">
+ <h2><?= t('Sub-Tasks') ?></h2>
+ </div>
+
+ <?php
+
+ $total_spent = 0;
+ $total_estimated = 0;
+ $total_remaining = 0;
+
+ ?>
+
+ <table class="subtasks-table">
+ <tr>
+ <th width="40%"><?= t('Title') ?></th>
+ <th><?= t('Status') ?></th>
+ <th><?= t('Assignee') ?></th>
+ <th><?= t('Time tracking') ?></th>
+ <?php if (! isset($not_editable)): ?>
+ <th><?= t('Actions') ?></th>
<?php endif ?>
+ </tr>
+ <?php foreach ($subtasks as $subtask): ?>
+ <tr>
+ <td><?= Helper\escape($subtask['title']) ?></td>
+ <td><?= Helper\escape($subtask['status_name']) ?></td>
+ <td>
+ <?php if (! empty($subtask['username'])): ?>
+ <?= Helper\escape($subtask['name'] ?: $subtask['username']) ?>
+ <?php endif ?>
+ </td>
+ <td>
+ <?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 if (! empty($subtask['time_estimated'])): ?>
+ <strong><?= Helper\escape($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
+ <?php endif ?>
+ </td>
+ <?php if (! isset($not_editable)): ?>
+ <td>
+ <a href="?controller=subtask&amp;action=edit&amp;task_id=<?= $task['id'] ?>&amp;subtask_id=<?= $subtask['id'] ?>"><?= t('Edit') ?></a>
+ <?= t('or') ?>
+ <a href="?controller=subtask&amp;action=confirm&amp;task_id=<?= $task['id'] ?>&amp;subtask_id=<?= $subtask['id'] ?>"><?= t('Remove') ?></a>
+ </td>
<?php endif ?>
- </td>
- <td>
- <a href="?controller=subtask&amp;action=edit&amp;task_id=<?= $task['id'] ?>&amp;subtask_id=<?= $subtask['id'] ?>"><?= t('Edit') ?></a>
- <?= t('or') ?>
- <a href="?controller=subtask&amp;action=confirm&amp;task_id=<?= $task['id'] ?>&amp;subtask_id=<?= $subtask['id'] ?>"><?= t('Remove') ?></a>
- </td>
- </tr>
- <?php
- $total_estimated += $subtask['time_estimated'];
- $total_spent += $subtask['time_spent'];
- $total_remaining = $total_estimated - $total_spent;
- ?>
- <?php endforeach ?>
-</table>
-
-<div class="subtasks-time-tracking">
- <h4><?= t('Time tracking') ?></h4>
- <ul>
- <li><?= t('Estimate:') ?> <strong><?= Helper\escape($total_estimated) ?></strong> <?= t('hours') ?></li>
- <li><?= t('Spent:') ?> <strong><?= Helper\escape($total_spent) ?></strong> <?= t('hours') ?></li>
- <li><?= t('Remaining:') ?> <strong><?= Helper\escape($total_remaining > 0 ? $total_remaining : 0) ?></strong> <?= t('hours') ?></li>
- </ul>
-</div> \ No newline at end of file
+ </tr>
+ <?php
+ $total_estimated += $subtask['time_estimated'];
+ $total_spent += $subtask['time_spent'];
+ $total_remaining = $total_estimated - $total_spent;
+ ?>
+ <?php endforeach ?>
+ </table>
+
+ <div class="subtasks-time-tracking">
+ <h4><?= t('Time tracking') ?></h4>
+ <ul>
+ <li><?= t('Estimate:') ?> <strong><?= Helper\escape($total_estimated) ?></strong> <?= t('hours') ?></li>
+ <li><?= t('Spent:') ?> <strong><?= Helper\escape($total_spent) ?></strong> <?= t('hours') ?></li>
+ <li><?= t('Remaining:') ?> <strong><?= Helper\escape($total_remaining > 0 ? $total_remaining : 0) ?></strong> <?= t('hours') ?></li>
+ </ul>
+ </div>
+
+</div>
+<?php endif ?> \ No newline at end of file