X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FRT__Template%2FColumnMap;h=d3909ae9b9bc67c5208d7e88576b9df97bb8980a;hb=de9d037528895f7151a9aead6724ce2df95f9586;hp=61da591d66e5c4f8739edd679fb7406302a682dc;hpb=e9e0cf0989259b94d9758eceff448666a2e5a5cc;p=freeside.git diff --git a/rt/share/html/Elements/RT__Template/ColumnMap b/rt/share/html/Elements/RT__Template/ColumnMap index 61da591d6..d3909ae9b 100644 --- a/rt/share/html/Elements/RT__Template/ColumnMap +++ b/rt/share/html/Elements/RT__Template/ColumnMap @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -48,24 +48,19 @@ <%ARGS> $Name $Attr => undef +$GenericMap => {} <%ONCE> my $COLUMN_MAP = { - id => { - title => '#', # loc - attribute => 'id', - align => 'right', - value => sub { return $_[0]->id }, - }, Name => { title => 'Name', # loc - attribute => 'Name', - value => sub { return $_[0]->Name() }, + attribute => 'Name', + value => sub { return $_[0]->Name() }, }, Description => { title => 'Description', # loc - attribute => 'Description', - value => sub { return $_[0]->Description() }, + attribute => 'Description', + value => sub { return $_[0]->Description() }, }, Queue => { title => 'Queue', # loc @@ -78,10 +73,28 @@ my $COLUMN_MAP = { title => 'Queue', # loc value => sub { $_[0]->Queue }, }, + IsEmpty => { + title => 'Empty', # loc + value => sub { $_[0]->IsEmpty? $_[0]->loc('Yes') : $_[0]->loc('No') }, + }, + UsedBy => { + title => 'Used by scrips', # loc + value => sub { + my @res; + my $scrips = $_[0]->UsedBy; + while ( my $scrip = $scrips->Next ) { + push @res, ', ' if @res; + push @res, \'', $scrip->id, \''; + } + return @res; + }, + }, }; <%INIT> -$m->callback( COLUMN_MAP => $COLUMN_MAP, CallbackName => 'ColumnMap', CallbackOnce => 1 ); +$m->callback( GenericMap => $GenericMap, COLUMN_MAP => $COLUMN_MAP, CallbackName => 'ColumnMap', CallbackOnce => 1 ); return GetColumnMapEntry( Map => $COLUMN_MAP, Name => $Name, Attribute => $Attr );