X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FShowCustomFields;h=387497e29061c932b5ded00cd1e479f7a69e9ffa;hb=2302507c0ecd6761f4a27923b50295cfe3f35a14;hp=fcd530e9561240757ba228f802dad60246a7230f;hpb=43a06151e47d2c59b833cbd8c26d97865ee850b6;p=freeside.git diff --git a/rt/share/html/Elements/ShowCustomFields b/rt/share/html/Elements/ShowCustomFields index fcd530e95..387497e29 100644 --- a/rt/share/html/Elements/ShowCustomFields +++ b/rt/share/html/Elements/ShowCustomFields @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -52,6 +52,7 @@ % while ( my $CustomField = $CustomFields->Next ) { % my $Values = $Object->CustomFieldValues( $CustomField->Id ); % my $count = $Values->Count; +% next if $count == 0 and $CustomField->Disabled; <% $CustomField->Name %>: @@ -70,6 +71,10 @@ % } +% if ( $CustomFields->IsLast ) { +% # switch to the other result set +% $CustomFields = $HiddenCustomFields; +% } % } % if ($Table) { @@ -83,6 +88,13 @@ $m->callback( CustomFields => $CustomFields, ); +# kludge to allow "Support time" to be displayed even though it's been +# removed +my $HiddenCustomFields = RT::CustomFields->new($session{'CurrentUser'}); +$HiddenCustomFields->LimitToChildType(ref $Object); +$HiddenCustomFields->Limit( FIELD => 'Type', VALUE => 'TimeValue' ); +$HiddenCustomFields->Limit( FIELD => 'Disabled', VALUE => 1 ); + # don't print anything if there is no custom fields return unless $CustomFields->First; $CustomFields->GotoFirstItem; @@ -114,12 +126,12 @@ my $print_value = sub { my $vid = $value->id; $m->out( '
' ); $m->out( loc("See also:") ); - $m->out( '' ); - $m->out( $value->IncludeContentForValue ); + $m->out( '' ); + $m->out( $m->interp->apply_escapes($value->IncludeContentForValue, 'h') ); $m->out( qq{
\n} ); - $m->out( qq{\n} ); + $m->out( qq{\n} ); } }; @@ -127,5 +139,6 @@ my $print_value = sub { <%ARGS> $Object => undef $CustomFields => $Object->CustomFields + $Table => 1