X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FRT__Ticket%2FColumnMap;h=411b3e56b7c988b39311d227a02657b5ccb7465b;hb=09aa4ca78df448f73e440a25a024e44eaf00c827;hp=e347032ffe50f886dc566202595aea7e61d5fd8b;hpb=fc6209f398899f0211cfcedeb81a3cd65e04a941;p=freeside.git diff --git a/rt/share/html/Elements/RT__Ticket/ColumnMap b/rt/share/html/Elements/RT__Ticket/ColumnMap index e347032ff..411b3e56b 100644 --- a/rt/share/html/Elements/RT__Ticket/ColumnMap +++ b/rt/share/html/Elements/RT__Ticket/ColumnMap @@ -313,8 +313,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, \'', + $c->AsString, + \'', + \'
'; + } + 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, \'
'; + } + 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, \'
'; + } + 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, \' ', + $t->{'name'}, + \' ', + \' ' + ; + } + pop @return; + push @return, \'
'; + } + 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'}) {