Skip to content

Commit

Permalink
Add callback to filter custom field values on ShowCustomFields
Browse files Browse the repository at this point in the history
In some scenarios, it's required to restrict custom field values to be
shown on the ticket display page, even if the value was set within
the ticket.

This commit introduces a callback for post-processing these values,
enhancing the flexibility to tailor displayed data.
  • Loading branch information
richieri-bps committed Apr 8, 2024
1 parent cf34cad commit a143c2d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions share/html/Elements/ShowCustomFields
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
% while ( my $CustomField = $CustomFields->Next ) {
<%perl>
my $Values = $Object->CustomFieldValues( $CustomField->Id );

$m->callback( CallbackName => 'MassageCustomFieldValues',
CustomField => $CustomField,
Object => $Object, Grouping => $Grouping, Table => $Table,
CustomFieldValues => $Values, ARGSRef => \%ARGS);

my $count = $Values->Count;
next if $HideEmpty and not $count;
my $CustomFieldName = $CustomField->Name;
Expand Down

0 comments on commit a143c2d

Please sign in to comment.