From 3a99b69a276caae379b7e2d7a3ab0005800cf048 Mon Sep 17 00:00:00 2001 From: mark Date: Thu, 18 Nov 2010 22:20:54 +0000 Subject: [PATCH] time to resolve in ticket search, RT#9327 --- .../TimeToResolve/Elements/RT__Ticket/ColumnMap/Once | 13 +++++++++++++ .../Search/Elements/BuildFormatString/SetFieldsOnce | 8 ++++++++ 2 files changed, 21 insertions(+) create mode 100644 rt/share/html/Callbacks/TimeToResolve/Elements/RT__Ticket/ColumnMap/Once create mode 100644 rt/share/html/Callbacks/TimeToResolve/Search/Elements/BuildFormatString/SetFieldsOnce diff --git a/rt/share/html/Callbacks/TimeToResolve/Elements/RT__Ticket/ColumnMap/Once b/rt/share/html/Callbacks/TimeToResolve/Elements/RT__Ticket/ColumnMap/Once new file mode 100644 index 000000000..df5d29e14 --- /dev/null +++ b/rt/share/html/Callbacks/TimeToResolve/Elements/RT__Ticket/ColumnMap/Once @@ -0,0 +1,13 @@ +<%init> +$COLUMN_MAP->{'TimeToResolve'} = { + title => 'Time to Resolve', + attribute => 'Resolved', + value => sub { + my $r = $_[0]->ResolvedObj or return ''; + return $r->DiffAsString($_[0]->CreatedObj); + } +}; + +<%ARGS> +$COLUMN_MAP => {} + diff --git a/rt/share/html/Callbacks/TimeToResolve/Search/Elements/BuildFormatString/SetFieldsOnce b/rt/share/html/Callbacks/TimeToResolve/Search/Elements/BuildFormatString/SetFieldsOnce new file mode 100644 index 000000000..54dcae04c --- /dev/null +++ b/rt/share/html/Callbacks/TimeToResolve/Search/Elements/BuildFormatString/SetFieldsOnce @@ -0,0 +1,8 @@ +<%init> +my $i = 1; +$i++ until ($i == scalar(@$Fields) or $Fields->[$i-1] =~ /^Resolved/); +splice @$Fields, $i, 0, 'TimeToResolve'; + +<%ARGS> +$Fields => [] + -- 2.11.0