X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FColumnMap;h=878950bff28aff4a60b98016b9a3f664729d62a1;hb=1d1caa0fb6e82c033e50f8fd6544775961b827d6;hp=f268a5d1cbeb4f896272899c5d6fe953662ebc76;hpb=81e56a1e8baf5e0f1522031736bfb392f1f0f5b9;p=freeside.git diff --git a/rt/share/html/Elements/ColumnMap b/rt/share/html/Elements/ColumnMap index f268a5d1c..878950bff 100644 --- a/rt/share/html/Elements/ColumnMap +++ b/rt/share/html/Elements/ColumnMap @@ -64,8 +64,7 @@ my $COLUMN_MAP = { Created => { attribute => 'Created', title => 'Created', # loc - date => sub { return $_[0]->CreatedObj }, - value => sub { return $_[0]->CreatedObj->AsString } + value => sub { return $_[0]->CreatedObj }, }, CreatedRelative => { attribute => 'Created', @@ -80,8 +79,7 @@ my $COLUMN_MAP = { LastUpdated => { attribute => 'LastUpdated', title => 'Last Updated', # loc - date => sub { return $_[0]->LastUpdatedObj }, - value => sub { return $_[0]->LastUpdatedObj->AsString } + value => sub { return $_[0]->LastUpdatedObj }, }, LastUpdatedRelative => { attribute => 'LastUpdated', @@ -101,15 +99,31 @@ my $COLUMN_MAP = { # Display custom field contents, separated by newlines. # For Image custom fields we also show a thumbnail here. - my $values = $_[0]->CustomFieldValues( $_[-1] ); - my @values = map { - ( - ($_->CustomFieldObj->Type eq 'Image') - ? \($m->scomp( '/Elements/ShowCustomFieldImage', Object => $_ )) - : $_->Content - ), - \'
', - } @{ $values->ItemsArrayRef }; + my $object = shift; + my $cfname = pop; + my $values = $object->CustomFieldValues( $cfname ); + return if $values->Count == 0; + my @values; + # it is guaranteed to be the same type for all fields, right? + my $v = $values->First; + my $cftype = $v->CustomFieldObj->Type; + + do { + if ($cftype eq 'Image') { + push @values, + \($m->scomp( '/Elements/ShowCustomFieldImage', + Object => $v )); + } elsif ( $cftype eq 'Date' or $cftype eq 'DateTime' ) { + # then actually return the date object; + # ProcessColumnMapValue will stringify it + my $DateObj = RT::Date->new( $session{'CurrentUser'} ); + $DateObj->Set(Format => 'unknown', Value => $v->Content); + push @values, $DateObj; + } else { + push @values, $v->Content; + } + push @values, \'
'; # this is deeply silly + } while ($v = $values->Next); pop @values; # Remove that last
return @values; },