2014-11-23 20:13:38 +01:00
|
|
|
<?php if (! empty($subtasks)): ?>
|
|
|
|
<div id="subtasks" class="task-show-section">
|
|
|
|
|
|
|
|
<div class="page-header">
|
|
|
|
<h2><?= t('Sub-Tasks') ?></h2>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<table class="subtasks-table">
|
|
|
|
<tr>
|
2015-01-16 14:23:05 +01:00
|
|
|
<th class="column-40"><?= t('Title') ?></th>
|
|
|
|
<th class="column-15"><?= t('Status') ?></th>
|
2014-11-23 20:13:38 +01:00
|
|
|
<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>
|
2015-01-16 14:23:05 +01:00
|
|
|
<td><?= $this->e($subtask['title']) ?></td>
|
2014-11-23 20:13:38 +01:00
|
|
|
<td>
|
2014-12-22 19:15:38 +01:00
|
|
|
<?php if (! isset($not_editable)): ?>
|
2015-01-16 14:23:05 +01:00
|
|
|
<?= $this->a(trim($this->render('subtask/icons', array('subtask' => $subtask))) . $this->e($subtask['status_name']),
|
|
|
|
'subtask', 'toggleStatus', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>
|
2014-12-22 19:15:38 +01:00
|
|
|
<?php else: ?>
|
2015-01-16 14:23:05 +01:00
|
|
|
<?= $this->render('subtask/icons', array('subtask' => $subtask)) . $this->e($subtask['status_name']) ?>
|
2014-12-22 19:15:38 +01:00
|
|
|
<?php endif ?>
|
|
|
|
</td>
|
2014-11-23 20:13:38 +01:00
|
|
|
<td>
|
|
|
|
<?php if (! empty($subtask['username'])): ?>
|
2015-01-16 14:23:05 +01:00
|
|
|
<?= $this->e($subtask['name'] ?: $subtask['username']) ?>
|
2014-11-23 20:13:38 +01:00
|
|
|
<?php endif ?>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<?php if (! empty($subtask['time_spent'])): ?>
|
2015-01-16 14:23:05 +01:00
|
|
|
<strong><?= $this->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?>
|
2014-11-23 20:13:38 +01:00
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
<?php if (! empty($subtask['time_estimated'])): ?>
|
2015-01-16 14:23:05 +01:00
|
|
|
<strong><?= $this->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
|
2014-11-23 20:13:38 +01:00
|
|
|
<?php endif ?>
|
|
|
|
</td>
|
|
|
|
<?php if (! isset($not_editable)): ?>
|
|
|
|
<td>
|
2015-01-16 14:23:05 +01:00
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<?= $this->a(t('Edit'), 'subtask', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<?= $this->a(t('Remove'), 'subtask', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2014-11-23 20:13:38 +01:00
|
|
|
</td>
|
|
|
|
<?php endif ?>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<?php if (! isset($not_editable)): ?>
|
2015-01-16 14:23:05 +01:00
|
|
|
<form method="post" action="<?= $this->u('subtask', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
|
|
|
|
<?= $this->formCsrf() ?>
|
|
|
|
<?= $this->formHidden('task_id', array('task_id' => $task['id'])) ?>
|
|
|
|
<?= $this->formText('title', array(), array(), array('required', 'placeholder="'.t('Type here to create a new sub-task').'"')) ?>
|
2014-11-23 20:13:38 +01:00
|
|
|
<input type="submit" value="<?= t('Add') ?>" class="btn btn-blue"/>
|
|
|
|
</form>
|
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<?php endif ?>
|