Add sortable Priority column on overview table interface

This commit is contained in:
Justin C. Klein Keane
2016-04-20 14:24:05 -04:00
parent aea8784ab5
commit 1239920063
2 changed files with 8 additions and 22 deletions

View File

@@ -35,6 +35,7 @@ class TaskFinder extends Base
Task::TABLE.'.date_started', Task::TABLE.'.date_started',
Task::TABLE.'.project_id', Task::TABLE.'.project_id',
Task::TABLE.'.color_id', Task::TABLE.'.color_id',
Task::TABLE.'.priority',
Task::TABLE.'.time_spent', Task::TABLE.'.time_spent',
Task::TABLE.'.time_estimated', Task::TABLE.'.time_estimated',
Project::TABLE.'.name AS project_name', Project::TABLE.'.name AS project_name',
@@ -67,6 +68,7 @@ class TaskFinder extends Base
'tasks.date_creation', 'tasks.date_creation',
'tasks.project_id', 'tasks.project_id',
'tasks.color_id', 'tasks.color_id',
'tasks.priority',
'tasks.time_spent', 'tasks.time_spent',
'tasks.time_estimated', 'tasks.time_estimated',
'projects.name AS project_name' 'projects.name AS project_name'
@@ -138,7 +140,6 @@ class TaskFinder extends Base
Project::TABLE.'.name AS project_name' Project::TABLE.'.name AS project_name'
) )
->join(User::TABLE, 'id', 'owner_id', Task::TABLE) ->join(User::TABLE, 'id', 'owner_id', Task::TABLE)
->left(User::TABLE, 'uc', 'id', Task::TABLE, 'creator_id')
->join(Category::TABLE, 'id', 'category_id', Task::TABLE) ->join(Category::TABLE, 'id', 'category_id', Task::TABLE)
->join(Column::TABLE, 'id', 'column_id', Task::TABLE) ->join(Column::TABLE, 'id', 'column_id', Task::TABLE)
->join(Swimlane::TABLE, 'id', 'swimlane_id', Task::TABLE) ->join(Swimlane::TABLE, 'id', 'swimlane_id', Task::TABLE)
@@ -363,27 +364,6 @@ class TaskFinder extends Base
return $rq->fetch(PDO::FETCH_ASSOC); return $rq->fetch(PDO::FETCH_ASSOC);
} }
/**
* Get iCal query
*
* @access public
* @return \PicoDb\Table
*/
public function getICalQuery()
{
return $this->db->table(Task::TABLE)
->left(User::TABLE, 'ua', 'id', Task::TABLE, 'owner_id')
->left(User::TABLE, 'uc', 'id', Task::TABLE, 'creator_id')
->columns(
Task::TABLE.'.*',
'ua.email AS assignee_email',
'ua.name AS assignee_name',
'ua.username AS assignee_username',
'uc.email AS creator_email',
'uc.username AS creator_username'
);
}
/** /**
* Count all tasks for a given project and status * Count all tasks for a given project and status
* *

View File

@@ -9,6 +9,7 @@
<th class="column-5"><?= $paginator->order('Id', 'tasks.id') ?></th> <th class="column-5"><?= $paginator->order('Id', 'tasks.id') ?></th>
<th class="column-20"><?= $paginator->order(t('Project'), 'project_name') ?></th> <th class="column-20"><?= $paginator->order(t('Project'), 'project_name') ?></th>
<th><?= $paginator->order(t('Task'), 'title') ?></th> <th><?= $paginator->order(t('Task'), 'title') ?></th>
<th class="column-5"><?= $paginator->order('Priority', 'tasks.priority') ?></th>
<th class="column-20"><?= t('Time tracking') ?></th> <th class="column-20"><?= t('Time tracking') ?></th>
<th class="column-20"><?= $paginator->order(t('Due date'), 'date_due') ?></th> <th class="column-20"><?= $paginator->order(t('Due date'), 'date_due') ?></th>
</tr> </tr>
@@ -23,6 +24,11 @@
<td> <td>
<?= $this->url->link($this->text->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?> <?= $this->url->link($this->text->e($task['title']), 'task', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id'])) ?>
</td> </td>
<td>
<?php if ($task['priority'] > 0): ?>
<?= $this->text->e($task['priority'])?>
<?php endif?>
</td>
<td> <td>
<?php if (! empty($task['time_spent'])): ?> <?php if (! empty($task['time_spent'])): ?>
<strong><?= $this->text->e($task['time_spent']).'h' ?></strong> <?= t('spent') ?> <strong><?= $this->text->e($task['time_spent']).'h' ?></strong> <?= t('spent') ?>