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/lib/RT | |
| 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/lib/RT')
| -rw-r--r-- | rt/lib/RT/Interface/Web_Vendor.pm | 27 | 
1 files changed, 27 insertions, 0 deletions
| diff --git a/rt/lib/RT/Interface/Web_Vendor.pm b/rt/lib/RT/Interface/Web_Vendor.pm index ee8c34b55..6218641a7 100644 --- a/rt/lib/RT/Interface/Web_Vendor.pm +++ b/rt/lib/RT/Interface/Web_Vendor.pm @@ -533,5 +533,32 @@ sub ProcessUpdateMessage {      return @results;  } +sub default_FormatDate { $_[0]->AsString } + +sub ProcessColumnMapValue { +    my $value = shift; +    my %args = ( Arguments => [], +                 Escape => 1, +                 FormatDate => \&default_FormatDate, +                 @_ ); + +    if ( ref $value ) { +        if ( ref $value eq 'RT::Date' ) { +            return $args{FormatDate}->($value); +        } elsif ( UNIVERSAL::isa( $value, 'CODE' ) ) { +            my @tmp = $value->( @{ $args{'Arguments'} } ); +            return ProcessColumnMapValue( ( @tmp > 1 ? \@tmp : $tmp[0] ), %args ); +        } elsif ( UNIVERSAL::isa( $value, 'ARRAY' ) ) { +            return join '', map ProcessColumnMapValue( $_, %args ), @$value; +        } elsif ( UNIVERSAL::isa( $value, 'SCALAR' ) ) { +            return $$value; +        } +    } + +    return $m->interp->apply_escapes( $value, 'h' ) if $args{'Escape'}; +    return $value; +} + +  1; | 
