diff options
Diffstat (limited to 'rt/share/html/Elements/RT__Ticket/ColumnMap')
| -rw-r--r-- | rt/share/html/Elements/RT__Ticket/ColumnMap | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/rt/share/html/Elements/RT__Ticket/ColumnMap b/rt/share/html/Elements/RT__Ticket/ColumnMap index e347032ff..cd38dcb7b 100644 --- a/rt/share/html/Elements/RT__Ticket/ColumnMap +++ b/rt/share/html/Elements/RT__Ticket/ColumnMap @@ -220,26 +220,31 @@ $COLUMN_MAP = { Starts => { title => 'Starts', # loc attribute => 'Starts', + date => sub { return $_[0]->StartsObj }, value => sub { return $_[0]->StartsObj->AsString } }, Started => { title => 'Started', # loc attribute => 'Started', + date => sub { return $_[0]->StartedObj }, value => sub { return $_[0]->StartedObj->AsString } }, Told => { title => 'Told', # loc attribute => 'Told', + date => sub { return $_[0]->ToldObj }, value => sub { return $_[0]->ToldObj->AsString } }, Due => { title => 'Due', # loc attribute => 'Due', + date => sub { return $_[0]->DueObj }, value => sub { return $_[0]->DueObj->AsString } }, Resolved => { title => 'Resolved', # loc attribute => 'Resolved', + date => sub { return $_[0]->ResolvedObj }, value => sub { return $_[0]->ResolvedObj->AsString } }, UpdateStatus => { @@ -313,8 +318,87 @@ $COLUMN_MAP = { return \$bookmark; }, }, + + Customer => { + title => 'Customer', #loc + attribute => 'Customer.Number', #title/attribute/name... what does it all mean? + value => sub { + my $Ticket = shift; + my @return = (); + foreach my $c (ticket_cust_resolvers($Ticket)) { + push @return, \'<A HREF="', $c->HREF, \'">', + $c->AsString, + \'</A>', + \'<BR>'; + } + pop @return; + @return; + }, + }, + # For future reference: + # hash key = name of the column in the format string + # (see /Search/Elements/BuildFormatString) + # title = displayed name in the table header + # attribute = the field to ORDER BY when sorting on this column + Agent => { + title => 'Agent', + attribute => 'Customer.Agent', + value => sub { + my $Ticket = shift; + my @return = (); + foreach my $c (ticket_cust_resolvers($Ticket)) { + push @return, $c->AgentName, \'<BR>'; + } + pop @return; + @return; + }, + }, + CustomerClass => { + title => 'Class', + attribute => 'Customer.Class', + value => sub { + my $Ticket = shift; + my @return = (); + foreach my $c (ticket_cust_resolvers($Ticket)) { + push @return, $c->CustomerClass, \'<BR>'; + } + pop @return; + @return; + }, + }, + CustomerTags => { + title => '', + attribute => '', + value => sub { + my $Ticket = shift; + my @return = (); + foreach my $c (ticket_cust_resolvers($Ticket)) { + my @tags = sort { $a->{'name'} cmp $b->{'name'} } + $c->CustomerTags; + foreach my $t (@tags) { + push @return, \'<SPAN style="background-color:#', + $t->{'color'}, + \';"> ', + $t->{'name'}, + \' </SPAN>', + \' ' + ; + } + pop @return; + push @return, \'<BR>'; + } + pop @return; + @return; + }, + }, }; +sub ticket_cust_resolvers { + my $Ticket = shift; + my @Customers = @{ $Ticket->Customers->ItemsArrayRef }; + return map $_->TargetURI->Resolver, @Customers; +} + # if no GPG support, then KeyOwnerName and KeyRequestors fall back to the regular # versions if (RT->Config->Get('GnuPG')->{'Enable'}) { |
