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/Template/subtask/show.php

103 lines
5.4 KiB
PHP
Raw Normal View History

2014-11-23 20:13:38 +01:00
<?php if (! empty($subtasks)): ?>
2015-08-16 17:04:56 +02:00
<?php $first_position = $subtasks[0]['position']; ?>
<?php $last_position = $subtasks[count($subtasks) - 1]['position']; ?>
2014-11-23 20:13:38 +01:00
<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>
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>
<td>
2014-12-22 19:15:38 +01:00
<?php if (! isset($not_editable)): ?>
2015-08-16 17:04:56 +02:00
<?= $this->subtask->toggleStatus($subtask, 'task') ?>
2014-12-22 19:15:38 +01:00
<?php else: ?>
2015-04-21 17:56:16 +02:00
<?= $this->render('subtask/icons', array('subtask' => $subtask)) . $this->e($subtask['title']) ?>
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-08-16 17:04:56 +02:00
<?php if (! isset($not_editable)): ?>
<?= $this->url->link($this->e($subtask['name'] ?: $subtask['username']), 'user', 'show', array('user_id' => $subtask['user_id'])) ?>
<?php else: ?>
<?= $this->e($subtask['name'] ?: $subtask['username']) ?>
<?php endif ?>
2014-11-23 20:13:38 +01:00
<?php endif ?>
</td>
<td>
2015-08-16 17:04:56 +02:00
<ul class="no-bullet">
<li>
<?php if (! empty($subtask['time_spent'])): ?>
<strong><?= $this->e($subtask['time_spent']).'h' ?></strong> <?= t('spent') ?>
<?php endif ?>
2014-11-23 20:13:38 +01:00
2015-08-16 17:04:56 +02:00
<?php if (! empty($subtask['time_estimated'])): ?>
<strong><?= $this->e($subtask['time_estimated']).'h' ?></strong> <?= t('estimated') ?>
<?php endif ?>
</li>
<?php if (! isset($not_editable) && $subtask['user_id'] == $this->user->getId()): ?>
<li>
<?php if ($subtask['is_timer_started']): ?>
<i class="fa fa-pause"></i>
<?= $this->url->link(t('Stop timer'), 'timer', 'subtask', array('timer' => 'stop', 'project_id' => $task['project_id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'])) ?>
(<?= $this->dt->age($subtask['timer_start_date']) ?>)
<?php else: ?>
<i class="fa fa-play-circle-o"></i>
<?= $this->url->link(t('Start timer'), 'timer', 'subtask', array('timer' => 'start', 'project_id' => $task['project_id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'])) ?>
<?php endif ?>
</li>
<?php endif ?>
</ul>
2014-11-23 20:13:38 +01:00
</td>
<?php if (! isset($not_editable)): ?>
<td>
2015-01-16 14:23:05 +01:00
<ul>
2015-08-16 17:04:56 +02:00
<?php if ($subtask['position'] != $first_position): ?>
2015-04-21 17:56:16 +02:00
<li>
2015-08-16 17:04:56 +02:00
<?= $this->url->link(t('Move Up'), 'subtask', 'movePosition', array('project_id' => $project['id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'direction' => 'up'), true) ?>
2015-04-21 17:56:16 +02:00
</li>
<?php endif ?>
2015-08-16 17:04:56 +02:00
<?php if ($subtask['position'] != $last_position): ?>
2015-04-21 17:56:16 +02:00
<li>
2015-08-16 17:04:56 +02:00
<?= $this->url->link(t('Move Down'), 'subtask', 'movePosition', array('project_id' => $project['id'], 'task_id' => $subtask['task_id'], 'subtask_id' => $subtask['id'], 'direction' => 'down'), true) ?>
2015-04-21 17:56:16 +02:00
</li>
<?php endif ?>
2015-01-16 14:23:05 +01:00
<li>
2015-08-16 17:04:56 +02:00
<?= $this->url->link(t('Edit'), 'subtask', 'edit', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>
2015-01-16 14:23:05 +01:00
</li>
<li>
2015-08-16 17:04:56 +02:00
<?= $this->url->link(t('Remove'), 'subtask', 'confirm', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>
2015-01-16 14:23:05 +01:00
</li>
</ul>
2014-11-23 20:13:38 +01:00
</td>
<?php endif ?>
</tr>
<?php endforeach ?>
</table>
<?php if (! isset($not_editable)): ?>
2015-08-16 17:04:56 +02:00
<form method="post" action="<?= $this->url->href('subtask', 'save', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>" autocomplete="off">
<?= $this->form->csrf() ?>
<?= $this->form->hidden('task_id', array('task_id' => $task['id'])) ?>
<?= $this->form->text('title', array(), array(), array('required', 'placeholder="'.t('Type here to create a new sub-task').'"')) ?>
<?= $this->form->numeric('time_estimated', array(), array(), array('placeholder="'.t('Original estimate').'"')) ?>
<?= $this->form->select('user_id', $users_list, array(), array(), array('placeholder="'.t('Assignee').'"')) ?>
2014-11-23 20:13:38 +01:00
<input type="submit" value="<?= t('Add') ?>" class="btn btn-blue"/>
</form>
<?php endif ?>
</div>
<?php endif ?>