X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FShowCustomFields;h=f632e68fe7310cb61b7eda129184e7b1b33ca4dc;hb=5a61f2f2e84350b0592fcf81feca02e82b73cc7f;hp=6059f4ee766548165e4b4caf3fcb3f956991c013;hpb=f3c4966ed1f6ec3db7accd6dcdd3a5a3821d72a7;p=freeside.git diff --git a/rt/share/html/Elements/ShowCustomFields b/rt/share/html/Elements/ShowCustomFields index 6059f4ee7..f632e68fe 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) @@ -49,27 +49,31 @@ % if ($Table) { % } -% while ( my $CustomField = $CustomFields->Next ) { -% my $Values = $Object->CustomFieldValues( $CustomField->Id ); -% my $count = $Values->Count; +% foreach my $set ($CustomFields, $HiddenCustomFields) { +% $set->GotoFirstItem; +% while ( my $CustomField = $set->Next ) { +% my $Values = $Object->CustomFieldValues( $CustomField->Id ); +% my $count = $Values->Count; +% next if $count == 0 and $CustomField->Disabled; +% } % } % if ($Table) {
<% $CustomField->Name %>: -% unless ( $count ) { +% if ( $count == 0 ) { <&|/l&>(no value) -% } elsif ( $count == 1 ) { -% $print_value->( $CustomField, $Values->First ); -% } else { +% } elsif ( $count == 1 ) { +% $print_value->( $CustomField, $Values->First ); +% } else {
    -% while ( my $Value = $Values->Next ) { +% while ( my $Value = $Values->Next ) {
  • -% $print_value->( $CustomField, $Value ); +% $print_value->( $CustomField, $Value );
  • -% } +% }
-% } +% }
@@ -83,9 +87,15 @@ $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->LimitToDeleted; + # don't print anything if there is no custom fields -return unless $CustomFields->First; -$CustomFields->GotoFirstItem; +return unless $CustomFields->Count > 0 or $HiddenCustomFields->Count > 0; my $print_value = sub { my ($cf, $value) = @_; @@ -127,5 +137,6 @@ my $print_value = sub { <%ARGS> $Object => undef $CustomFields => $Object->CustomFields + $Table => 1