X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FElements%2FShowCustomFields;h=0423e1b24f50d1437c3e246ba0001172c9933d43;hb=de9d037528895f7151a9aead6724ce2df95f9586;hp=75e302bd34e9e90bae40d0fea3566d23b40d77f9;hpb=73a6a80a9ca5edbd43d139b7cb25bfee4abfd35e;p=freeside.git diff --git a/rt/share/html/Elements/ShowCustomFields b/rt/share/html/Elements/ShowCustomFields index 75e302bd3..0423e1b24 100644 --- a/rt/share/html/Elements/ShowCustomFields +++ b/rt/share/html/Elements/ShowCustomFields @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -45,7 +45,8 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -% $m->callback( CallbackName => 'BeforeCustomFields' ); +% $m->callback( CallbackName => 'BeforeCustomFields', Object => $Object, +% Grouping => $Grouping, ARGSRef => \%ARGS, CustomFields => $CustomFields, Table => $Table ); % if ($Table) { % } @@ -54,6 +55,7 @@ % while ( my $CustomField = $set->Next ) { % my $Values = $Object->CustomFieldValues( $CustomField->Id ); % my $count = $Values->Count; +% next if $HideEmpty and not $count; % next if $count == 0 and $CustomField->Disabled; @@ -72,19 +74,23 @@ % } +% $m->callback( CallbackName => 'AfterCustomFieldValue', CustomField => $CustomField, +% Object => $Object, Grouping => $Grouping, Table => $Table ); % } % } % if ($Table) {
<% $CustomField->Name %>:
% } -% $m->callback( CallbackName => 'AfterCustomFields', Object => $Object ); +% $m->callback( CallbackName => 'AfterCustomFields', Object => $Object, +% Grouping => $Grouping, ARGSRef => \%ARGS, Table => $Table ); <%INIT> $m->callback( %ARGS, CallbackName => 'MassageCustomFields', - Object => $Object, + Object => $Object, CustomFields => $CustomFields, + Table => $Table, ); # kludge to allow "Support time" to be displayed even though it's been @@ -94,6 +100,8 @@ $HiddenCustomFields->LimitToChildType(ref $Object); $HiddenCustomFields->Limit( FIELD => 'Type', VALUE => 'TimeValue' ); $HiddenCustomFields->LimitToDeleted; +$CustomFields->LimitToGrouping( $Object => $Grouping ) if defined $Grouping; + # don't print anything if there is no custom fields return unless $CustomFields->Count > 0 or $HiddenCustomFields->Count > 0; @@ -102,7 +110,7 @@ my $print_value = sub { my $linked = $value->LinkValueTo; if ( defined $linked && length $linked ) { my $linked = $m->interp->apply_escapes( $linked, 'h' ); - $m->out(''); + $m->out(''); } my $comp = "ShowCustomField". $cf->Type; $m->callback( @@ -110,6 +118,7 @@ my $print_value = sub { Name => \$comp, CustomField => $cf, Object => $Object, + Table => $Table, ); if ( $m->comp_exists( $comp ) ) { $m->comp( $comp, Object => $value ); @@ -137,6 +146,7 @@ my $print_value = sub { <%ARGS> $Object => undef $CustomFields => $Object->CustomFields - +$Grouping => undef $Table => 1 +$HideEmpty => 0