X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FRT__Template%2FColumnMap;h=c4bffb7f83511d12ed9fdb7fefc9d8d100ad6e78;hp=da712c2816ec2b4d72a4c8ee67a9f78045fdaaee;hb=7322f2afedcc2f427e997d1535a503613a83f088;hpb=919e930aa9279b3c5cd12b593889cd6de79d67bf diff --git a/rt/share/html/Elements/RT__Template/ColumnMap b/rt/share/html/Elements/RT__Template/ColumnMap index da712c281..c4bffb7f8 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-2015 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2016 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 );