1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kanboard_ynh.git synced 2024-09-03 19:36:17 +02:00
kanboard_ynh/sources/app/Templates/subtask_show.php

70 lines
2.7 KiB
PHP
Raw Normal View History

2014-10-22 19:59:09 +02:00
<?php if (! empty($subtasks)): ?>
<div id="subtasks" class="task-show-section">
2014-07-20 12:26:15 +02:00
2014-10-22 19:59:09 +02:00
<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>
2014-07-20 12:26:15 +02:00
<?php endif ?>
2014-10-22 19:59:09 +02:00
</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 ?>
2014-07-20 12:26:15 +02:00
2014-10-22 19:59:09 +02:00
<?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>
2014-07-20 12:26:15 +02:00
<?php endif ?>
2014-10-22 19:59:09 +02:00
</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 ?>