Mailing List Archive

rt branch 5.0/add-callback-after-values-show-custom-fields created. rt-5.0.5-163-ga143c2da66
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/add-callback-after-values-show-custom-fields has been created
at a143c2da6661caf8d1db78a18bae54208825e562 (commit)

- Log -----------------------------------------------------------------
commit a143c2da6661caf8d1db78a18bae54208825e562
Author: Ronaldo Richieri <ronaldo@bestpractical.com>
Date: Mon Apr 8 14:55:40 2024 -0300

Add callback to filter custom field values on ShowCustomFields

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.

diff --git a/share/html/Elements/ShowCustomFields b/share/html/Elements/ShowCustomFields
index 620f550972..48d54dc322 100644
--- a/share/html/Elements/ShowCustomFields
+++ b/share/html/Elements/ShowCustomFields
@@ -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;

-----------------------------------------------------------------------


hooks/post-receive
--
rt
_______________________________________________
rt-commit mailing list
rt-commit@lists.bestpractical.com
https://lists.bestpractical.com/mailman/listinfo/rt-commit