X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FRT__Template%2FColumnMap;h=732bdeba42ecfd5b22b385fddbc56cf8d1d6199b;hb=44dd00a3ff974a17999e86e64488e996edc71e3c;hp=d9d55cf906d48fd8c4e2310d47309a992ad6671b;hpb=fc6209f398899f0211cfcedeb81a3cd65e04a941;p=freeside.git diff --git a/rt/share/html/Elements/RT__Template/ColumnMap b/rt/share/html/Elements/RT__Template/ColumnMap index d9d55cf90..732bdeba4 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-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2019 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 );