X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FShowCustomFields;h=387497e29061c932b5ded00cd1e479f7a69e9ffa;hb=2302507c0ecd6761f4a27923b50295cfe3f35a14;hp=6059f4ee766548165e4b4caf3fcb3f956991c013;hpb=a6fe07e49e3fc12169e801b1ed6874c3a5bd8500;p=freeside.git diff --git a/rt/share/html/Elements/ShowCustomFields b/rt/share/html/Elements/ShowCustomFields index 6059f4ee7..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; @@ -127,5 +139,6 @@ my $print_value = sub { <%ARGS> $Object => undef $CustomFields => $Object->CustomFields + $Table => 1