diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2013-06-01 02:24:02 -0700 | 
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2013-06-01 02:24:02 -0700 | 
| commit | 049f013e7e6409edcc3997f2496784573be3de3e (patch) | |
| tree | 76309081e401fbcac74730c18486591dd5404649 /rt/share/html/Elements | |
| parent | 1cf322d28999561d08c02a7273425dd9dab08476 (diff) | |
| parent | 74c9281d11d7f92e6da3dc00b795e50493c11258 (diff) | |
Merge branch 'FREESIDE_2_3_BRANCH' of git.freeside.biz:/home/git/freeside into FREESIDE_2_3_BRANCH
Diffstat (limited to 'rt/share/html/Elements')
| -rw-r--r-- | rt/share/html/Elements/ColumnMap | 40 | ||||
| -rw-r--r-- | rt/share/html/Elements/RT__Ticket/ColumnMap | 15 | 
2 files changed, 32 insertions, 23 deletions
| diff --git a/rt/share/html/Elements/ColumnMap b/rt/share/html/Elements/ColumnMap index 2d226dafc..c81dbb8a5 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 -                ), -                \'<br />', -            } @{ $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, \'<br />'; # this is deeply silly +            } while ($v = $values->Next);              pop @values; # Remove that last <br />              return @values;          }, diff --git a/rt/share/html/Elements/RT__Ticket/ColumnMap b/rt/share/html/Elements/RT__Ticket/ColumnMap index 9e6466cdd..9cceaf6ca 100644 --- a/rt/share/html/Elements/RT__Ticket/ColumnMap +++ b/rt/share/html/Elements/RT__Ticket/ColumnMap @@ -220,32 +220,27 @@ $COLUMN_MAP = {      Starts => {          title     => 'Starts', # loc          attribute => 'Starts', -        date      => sub { return $_[0]->StartsObj }, -        value     => sub { return $_[0]->StartsObj->AsString } +        value     => sub { return $_[0]->StartsObj }      },      Started => {          title     => 'Started', # loc          attribute => 'Started', -        date      => sub { return $_[0]->StartedObj }, -        value     => sub { return $_[0]->StartedObj->AsString } +        value     => sub { return $_[0]->StartedObj },      },      Told => {          title     => 'Told', # loc          attribute => 'Told', -        date      => sub { return $_[0]->ToldObj }, -        value     => sub { return $_[0]->ToldObj->AsString } +        value     => sub { return $_[0]->ToldObj },      },      Due => {          title     => 'Due', # loc          attribute => 'Due', -        date      => sub { return $_[0]->DueObj }, -        value     => sub { return $_[0]->DueObj->AsString } +        value     => sub { return $_[0]->DueObj },      },      Resolved => {          title     => 'Resolved', # loc          attribute => 'Resolved', -        date      => sub { return $_[0]->ResolvedObj }, -        value     => sub { return $_[0]->ResolvedObj->AsString } +        value     => sub { return $_[0]->ResolvedObj }      },      UpdateStatus => {          title => 'New messages', # loc | 
