Add subtasks
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Add a comment') ?></h2>
|
||||
<h2><?= t('Remove a comment') ?></h2>
|
||||
</div>
|
||||
|
||||
<div class="confirm">
|
||||
|
||||
17
app/Templates/file_show.php
Normal file
17
app/Templates/file_show.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Attachments') ?></h2>
|
||||
</div>
|
||||
|
||||
<ul class="task-show-files">
|
||||
<?php foreach ($files as $file): ?>
|
||||
<li>
|
||||
<a href="?controller=file&action=download&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>"><?= Helper\escape($file['name']) ?></a>
|
||||
<span class="task-show-file-actions">
|
||||
<?php if ($file['is_image']): ?>
|
||||
<a href="?controller=file&action=open&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>" class="popover"><?= t('open') ?></a>,
|
||||
<?php endif ?>
|
||||
<a href="?controller=file&action=confirm&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>"><?= t('remove') ?></a>
|
||||
</span>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
25
app/Templates/subtask_create.php
Normal file
25
app/Templates/subtask_create.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Add a sub-task') ?></h2>
|
||||
</div>
|
||||
|
||||
<form method="post" action="?controller=subtask&action=save&task_id=<?= $task['id'] ?>" autocomplete="off">
|
||||
|
||||
<?= Helper\form_hidden('task_id', $values) ?>
|
||||
|
||||
<?= Helper\form_label(t('Title'), 'title') ?>
|
||||
<?= Helper\form_text('title', $values, $errors, array('required autofocus')) ?><br/>
|
||||
|
||||
<?= Helper\form_label(t('Assignee'), 'user_id') ?>
|
||||
<?= Helper\form_select('user_id', $users_list, $values, $errors) ?><br/>
|
||||
|
||||
<?= Helper\form_label(t('Original Estimate'), 'time_estimated') ?>
|
||||
<?= Helper\form_numeric('time_estimated', $values, $errors) ?> <?= t('hours') ?><br/>
|
||||
|
||||
<?= Helper\form_checkbox('another_subtask', t('Create another sub-task'), 1, isset($values['another_subtask']) && $values['another_subtask'] == 1) ?>
|
||||
|
||||
<div class="form-actions">
|
||||
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
||||
<?= t('or') ?>
|
||||
<a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
|
||||
</div>
|
||||
</form>
|
||||
30
app/Templates/subtask_edit.php
Normal file
30
app/Templates/subtask_edit.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Edit a sub-task') ?></h2>
|
||||
</div>
|
||||
|
||||
<form method="post" action="?controller=subtask&action=update&task_id=<?= $task['id'] ?>&subtask_id=<?= $subtask['id'] ?>" autocomplete="off">
|
||||
|
||||
<?= Helper\form_hidden('id', $values) ?>
|
||||
<?= Helper\form_hidden('task_id', $values) ?>
|
||||
|
||||
<?= Helper\form_label(t('Title'), 'title') ?>
|
||||
<?= Helper\form_text('title', $values, $errors, array('required autofocus')) ?><br/>
|
||||
|
||||
<?= Helper\form_label(t('Status'), 'status') ?>
|
||||
<?= Helper\form_select('status', $status_list, $values, $errors) ?><br/>
|
||||
|
||||
<?= Helper\form_label(t('Assignee'), 'user_id') ?>
|
||||
<?= Helper\form_select('user_id', $users_list, $values, $errors) ?><br/>
|
||||
|
||||
<?= Helper\form_label(t('Original Estimate'), 'time_estimated') ?>
|
||||
<?= Helper\form_numeric('time_estimated', $values, $errors) ?> <?= t('hours') ?><br/>
|
||||
|
||||
<?= Helper\form_label(t('Time Spent'), 'time_spent') ?>
|
||||
<?= Helper\form_numeric('time_spent', $values, $errors) ?> <?= t('hours') ?><br/>
|
||||
|
||||
<div class="form-actions">
|
||||
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
|
||||
<?= t('or') ?>
|
||||
<a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('cancel') ?></a>
|
||||
</div>
|
||||
</form>
|
||||
16
app/Templates/subtask_remove.php
Normal file
16
app/Templates/subtask_remove.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Remove a sub-task') ?></h2>
|
||||
</div>
|
||||
|
||||
<div class="confirm">
|
||||
<p class="alert alert-info">
|
||||
<?= t('Do you really want to remove this sub-task?') ?>
|
||||
</p>
|
||||
|
||||
<p><strong><?= Helper\escape($subtask['title']) ?></strong></p>
|
||||
|
||||
<div class="form-actions">
|
||||
<a href="?controller=subtask&action=remove&task_id=<?= $task['id'] ?>&subtask_id=<?= $subtask['id'] ?>" class="btn btn-red"><?= t('Yes') ?></a>
|
||||
<?= t('or') ?> <a href="?controller=task&action=show&task_id=<?= $task['id'] ?>#subtasks"><?= t('cancel') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
60
app/Templates/subtask_show.php
Normal file
60
app/Templates/subtask_show.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<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>
|
||||
<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['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 endif ?>
|
||||
</td>
|
||||
<td>
|
||||
<a href="?controller=subtask&action=edit&task_id=<?= $task['id'] ?>&subtask_id=<?= $subtask['id'] ?>"><?= t('Edit') ?></a>
|
||||
<?= t('or') ?>
|
||||
<a href="?controller=subtask&action=confirm&task_id=<?= $task['id'] ?>&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>
|
||||
@@ -62,23 +62,14 @@
|
||||
|
||||
<?php if (! empty($files)): ?>
|
||||
<div id="attachments" class="task-show-section">
|
||||
<div class="page-header">
|
||||
<h2><?= t('Attachments') ?></h2>
|
||||
</div>
|
||||
<?= Helper\template('file_show', array('task' => $task, 'files' => $files)) ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<ul class="task-show-files">
|
||||
<?php foreach ($files as $file): ?>
|
||||
<li>
|
||||
<a href="?controller=file&action=download&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>"><?= Helper\escape($file['name']) ?></a>
|
||||
<span class="task-show-file-actions">
|
||||
<?php if ($file['is_image']): ?>
|
||||
<a href="?controller=file&action=open&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>" class="popover"><?= t('open') ?></a>,
|
||||
<?php endif ?>
|
||||
<a href="?controller=file&action=confirm&file_id=<?= $file['id'] ?>&task_id=<?= $task['id'] ?>"><?= t('remove') ?></a>
|
||||
</span>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
|
||||
<?php if (! empty($subtasks)): ?>
|
||||
<div id="subtasks" class="task-show-section">
|
||||
<?= Helper\template('subtask_show', array('task' => $task, 'subtasks' => $subtasks)) ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<li><a href="?controller=task&action=show&task_id=<?= $task['id'] ?>"><?= t('Summary') ?></a></li>
|
||||
<li><a href="?controller=task&action=edit&task_id=<?= $task['id'] ?>"><?= t('Edit the task') ?></a></li>
|
||||
<li><a href="?controller=task&action=editDescription&task_id=<?= $task['id'] ?>"><?= t('Edit the description') ?></a></li>
|
||||
<li><a href="?controller=subtask&action=create&task_id=<?= $task['id'] ?>"><?= t('Add a sub-task') ?></a></li>
|
||||
<li><a href="?controller=comment&action=create&task_id=<?= $task['id'] ?>"><?= t('Add a comment') ?></a></li>
|
||||
<li><a href="?controller=file&action=create&task_id=<?= $task['id'] ?>"><?= t('Attach a document') ?></a></li>
|
||||
<li><a href="?controller=task&action=duplicate&project_id=<?= $task['project_id'] ?>&task_id=<?= $task['id'] ?>"><?= t('Duplicate') ?></a></li>
|
||||
|
||||
Reference in New Issue
Block a user