Skip to content
Permalink
Browse files

Add Ticket Reference to Tasks

If a Task has a related ticket, put a link to get to the ticket from within the task as well as add a ticket column to the tasks queue.

This fixes Issue #5093
  • Loading branch information...
aydreeihn committed Oct 10, 2019
1 parent f628ccf commit af97900a4e69ff498c7ed675a448b9ddfbf75a15
Showing with 22 additions and 3 deletions.
  1. +12 −2 include/staff/tasks.inc.php
  2. +10 −1 include/staff/templates/task-view.tmpl.php
@@ -34,6 +34,11 @@
'width' => '8%',
'heading' => __('Number'),
),
'ticket' => array(
'width' => '16%',
'heading' => __('Ticket'),
'sort_col' => 'ticket__number',
),
'date' => array(
'width' => '20%',
'heading' => __('Date Created'),
@@ -157,7 +162,7 @@
$tasks->values('id', 'number', 'created', 'staff_id', 'team_id',
'staff__firstname', 'staff__lastname', 'team__name',
'dept__name', 'cdata__title', 'flags');
'dept__name', 'cdata__title', 'flags', 'ticket__number', 'ticket__ticket_id');
// Apply requested quick filter
$queue_sort_key = sprintf(':Q%s:%s:sort', ObjectModel::OBJECT_TYPE_TASK, $queue_name);
@@ -406,6 +411,11 @@ class="%s">%s</a></th>',
href="tasks.php?id=<?php echo $T['id']; ?>"
data-preview="#tasks/<?php echo $T['id']; ?>/preview"
><?php echo $number; ?></a></td>
<td nowrap>
<a class="preview"
href="tickets.php?id=<?php echo $T['ticket__ticket_id']; ?>"
data-preview="#tickets/<?php echo $T['ticket__ticket_id']; ?>/preview"
><?php echo $T['ticket__number']; ?></a></td>
<td align="center" nowrap><?php echo
Format::datetime($T[$date_col ?: 'created']); ?></td>
<td><a <?php if ($flag) { ?> class="Icon <?php echo $flag; ?>Ticket" title="<?php echo ucfirst($flag); ?> Ticket" <?php } ?>
@@ -432,7 +442,7 @@ class="icon-fixed-width icon-comments-alt"></i>&nbsp;';
</tbody>
<tfoot>
<tr>
<td colspan="6">
<td colspan="7">
<?php if($total && $thisstaff->canManageTickets()){ ?>
<?php echo __('Select');?>:&nbsp;
<a id="selectAll" href="#ckb"><?php echo __('All');?></a>&nbsp;&nbsp;
@@ -13,6 +13,7 @@
$iscloseable = $task->isCloseable();
$canClose = ($role->hasPerm(TaskModel::PERM_CLOSE) && $iscloseable === true);
$actions = array();
$object = $task->ticket;
if ($task->isOpen() && $role->hasPerm(Task::PERM_ASSIGN)) {
@@ -121,9 +122,17 @@
href="tasks.php?id=<?php echo $task->getId(); ?>"><i
class="icon-refresh"></i>&nbsp;<?php
echo sprintf(__('Task #%s'), $task->getNumber()); ?></a>
<?php if ($object) { ?>
&nbsp;/&nbsp;
<a class="preview"
href="tickets.php?id=<?php echo $object->getId(); ?>"
data-preview="#tickets/<?php echo $object->getId(); ?>/preview"
><?php echo sprintf(__('Ticket #%s'), $object->getNumber()); ?></a>
<?php } ?>
</h2>
<?php
} ?>
}
?>
</div>
<div class="flush-right">
<?php

0 comments on commit af97900

Please sign in to comment.
You can’t perform that action at this time.