%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
my $item = 0;
foreach my $col ( @Format ) {
+ my $attr = $col->{'attribute'} || $col->{'last_attribute'};
+
my $title = $col->{'title'} || '';
if ( $title eq 'NEWLINE' ) {
while ( $item < $maxitems ) {
$m->out('<th class="collection-as-table"');
$m->out(' colspan="' . $m->interp->apply_escapes($span => 'h') . '"')
if $span;
+
+ my $align = $col->{'align'} || do {
+ my $tmp_columnmap = $m->comp( '/Elements/ColumnMap',
+ Class => $Class,
+ Name => $attr,
+ Attr => 'align',
+ );
+ ProcessColumnMapValue( $tmp_columnmap, Arguments => [ $attr ] );
+ };
+ $m->out(qq{ style="text-align: $align"}) if $align;
$m->out('>');
+ my $loc_title;
# if title is not defined then use defined attribute or last
# one we saw in the format
unless ( defined $col->{'title'} ) {
- my $attr = $col->{'attribute'} || $col->{'last_attribute'};
my $tmp = $m->comp( '/Elements/ColumnMap',
Class => $Class,
Name => $attr,
# in case title is not defined in ColumnMap
# the following regex changes $attr like from "ReferredToBy" to "Referred To By"
$title = join ' ', split /(?<=[a-z])(?=[A-Z])/, $attr unless defined $title;
+ $loc_title = $attr =~ /^(?:CustomField|CF)\./ ? $title : loc($title);
} else {
- $title = $m->comp('/Elements/ScrubHTML', Content => $title);
+ $loc_title = loc($m->comp('/Elements/ScrubHTML', Content => $title));
}
if ( $AllowSorting and $col->{'attribute'}
%$generic_query_args,
OrderBy => $attr, Order => $new_order
), 'h')
- . '">'. loc($title) .'</a>'
+ . '">'. $loc_title .'</a>'
);
}
else {
- $m->out( loc($title) );
+ $m->out( $loc_title );
}
$m->out('</th>');
}