Add subtasks restrictions and time tracking

This commit is contained in:
Frederic Guillot
2015-02-04 22:19:32 -05:00
parent 2d070627d7
commit b24b1e7e4e
38 changed files with 522 additions and 51 deletions

View File

@@ -18,7 +18,7 @@
<?= $this->a($this->e($subtask['project_name']), 'board', 'show', array('project_id' => $subtask['project_id'])) ?>
</td>
<td>
<?= $this->e($subtask['status_name']) ?>
<?= $this->toggleSubtaskStatus($subtask, 'dashboard') ?>
</td>
<td>
<?= $this->a($this->e($subtask['title']), 'task', 'show', array('task_id' => $subtask['task_id'], 'project_id' => $subtask['project_id'])) ?>

View File

@@ -1,14 +1,7 @@
<section id="tooltip-subtasks">
<?php foreach ($subtasks as $subtask): ?>
<?= $this->a(
trim($this->render('subtask/icons', array('subtask' => $subtask))) . $this->e($subtask['title']),
'board',
'toggleSubtask',
array('task_id' => $subtask['task_id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])
) ?>
<?= $this->toggleSubtaskStatus($subtask, 'board') ?>
<?= $this->e(empty($subtask['username']) ? '' : ' ['.$this->getFullname($subtask).']') ?>
<br/>
<?php endforeach ?>
</section>

View File

@@ -26,6 +26,9 @@
<?= $this->formText('project_categories', $values, $errors) ?><br/>
<p class="form-help"><?= t('Example: "Bug, Feature Request, Improvement"') ?></p>
<?= $this->formCheckbox('subtask_restriction', t('Allow only one subtask in progress at the same time for a user'), 1, $values['subtask_restriction'] == 1) ?>
<?= $this->formCheckbox('subtask_time_tracking', t('Enable time tracking for subtasks'), 1, $values['subtask_time_tracking'] == 1) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-blue"/>
</div>

View File

@@ -12,9 +12,6 @@
<?= $this->formLabel(t('Title'), 'title') ?>
<?= $this->formText('title', $values, $errors, array('required', 'autofocus', 'maxlength="50"')) ?><br/>
<?= $this->formLabel(t('Status'), 'status') ?>
<?= $this->formSelect('status', $status_list, $values, $errors) ?><br/>
<?= $this->formLabel(t('Assignee'), 'user_id') ?>
<?= $this->formSelect('user_id', $users_list, $values, $errors) ?><br/>

View File

@@ -0,0 +1,19 @@
<div class="page-header">
<h2><?= t('You already have one subtask in progress') ?></h2>
</div>
<form action="<?= $this->u('subtask', 'changeRestrictionStatus', array('task_id' => $task['id'], 'project_id' => $task['project_id'], 'subtask_id' => $subtask['id'])) ?>" method="post">
<?= $this->formCsrf() ?>
<?= $this->formHidden('redirect', array('redirect' => $redirect)) ?>
<p><?= t('Select the new status of the subtask: "%s"', $subtask_inprogress['title']) ?></p>
<?= $this->formRadios('status', $status_list) ?>
<?= $this->formHidden('id', $subtask_inprogress) ?>
<div class="form-actions">
<input type="submit" value="<?= t('Save') ?>" class="btn btn-red"/>
<?= t('or') ?>
<a href="#" class="close-popover"><?= t('cancel') ?></a>
</div>
</form>

View File

@@ -20,15 +20,14 @@
<td><?= $this->e($subtask['title']) ?></td>
<td>
<?php if (! isset($not_editable)): ?>
<?= $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'])) ?>
<?= $this->toggleSubtaskStatus($subtask, 'task') ?>
<?php else: ?>
<?= $this->render('subtask/icons', array('subtask' => $subtask)) . $this->e($subtask['status_name']) ?>
<?php endif ?>
</td>
<td>
<?php if (! empty($subtask['username'])): ?>
<?= $this->e($subtask['name'] ?: $subtask['username']) ?>
<?= $this->a($this->e($subtask['name'] ?: $subtask['username']), 'user', 'show', array('user_id' => $subtask['user_id'])) ?>
<?php endif ?>
</td>
<td>

View File

@@ -28,6 +28,9 @@
<li>
<?= $this->a(t('Persistent connections'), 'user', 'sessions', array('user_id' => $user['id'])) ?>
</li>
<li>
<?= $this->a(t('Time tracking'), 'user', 'timesheet', array('user_id' => $user['id'])) ?>
</li>
<?php endif ?>
<?php if ($this->userSession->isAdmin()): ?>

View File

@@ -0,0 +1,27 @@
<div class="page-header">
<h2><?= t('Time Tracking') ?></h2>
</div>
<h3><?= t('Subtask timesheet') ?></h3>
<?php if ($subtask_paginator->isEmpty()): ?>
<p class="alert"><?= t('There is nothing to show.') ?></p>
<?php else: ?>
<table class="table-fixed">
<tr>
<th class="column-20"><?= $subtask_paginator->order('Task', 'task_title') ?></th>
<th class="column-20"><?= $subtask_paginator->order('Subtask', 'subtask_title') ?></th>
<th><?= $subtask_paginator->order(t('Start'), 'start') ?></th>
<th><?= $subtask_paginator->order(t('End'), 'end') ?></th>
</tr>
<?php foreach ($subtask_paginator->getCollection() as $record): ?>
<tr>
<td><?= $this->a($this->e($record['task_title']), 'task', 'show', array('project_id' => $record['project_id'], 'task_id' => $record['task_id'])) ?></td>
<td><?= $this->a($this->e($record['subtask_title']), 'task', 'show', array('project_id' => $record['project_id'], 'task_id' => $record['task_id'])) ?></td>
<td><?= dt('%B %e, %Y at %k:%M %p', $record['start']) ?></td>
<td><?= dt('%B %e, %Y at %k:%M %p', $record['end']) ?></td>
</tr>
<?php endforeach ?>
</table>
<?= $subtask_paginator ?>
<?php endif ?>