[rt-users] Changing default format of ticket list in queue?
Matt Zagrabelny
mzagrabe at d.umn.edu
Mon Jan 30 12:27:11 EST 2017
Hi Alex,
On Mon, Jan 30, 2017 at 11:18 AM, Alex Hall <ahall at autodist.com> wrote:
> Hi all,
> Where would I go to change the default format for the list of tickets shown
> when you click a queue name?
I presume you are talking about the Queue List?
Can this be done on a queue-by-queue basis, or
> only as a modification to some template in share/html?
I don't think there is anything out of the box that will do what you
want. That being said, we use a callback to tweak the output for just
a single queue.
Note: the path may be different for the callback file location due to
us running 4.2.
# cat /opt/rt4/local/plugins/RT-Site-UMN-Duluth-QueueListTweaks/html/Callbacks/RT-Site-UMN-Duluth-QueueListTweaks/Elements/QueueSummaryByLifecycle/LinkBuilders
<%INIT>
my $umd_link_all = sub {
my ($queue, $all_statuses) = @_;
my @escaped = @{$all_statuses};
# People want to see resolved tickets in the calendar view
# of their QueueList - that is, for the Computer Management (CM) queue.
# Aside from this "if" statement, this sub routine was lifted from
# upstream's version.
if ($queue->{Name} eq 'CM') {
push @escaped, 'resolved';
}
s{(['\\])}{\\$1}g for @escaped; #'# help out the syntax highlighting
my $search = ${$build_search_link}->(
$queue->{Name},
"(".join(" OR ", map "Status = '$_'", @escaped).")",
);
if ($queue->{Name} eq 'CM') {
my @fields = map
{ "'<small>__${_}__</small>'" }
(
'Created',
'Due',
'Resolved',
'Started',
'Starts',
'LastUpdated',
)
;
my $format = $m->interp->apply_escapes(
join(',', @fields),
'u',
);
$search .= '&Format='.$format;
}
return $search;
};
${$link_all} = $umd_link_all;
</%INIT>
<%ARGS>
$build_search_link
$link_all
$link_status
</%ARGS>
Enjoy,
-m
More information about the rt-users
mailing list