Mailing List Archive

rt branch 5.0/add-callback-editcustomfieldselect-beforevalues created. rt-5.0.5-163-g7c21ffa8c1
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-editcustomfieldselect-beforevalues has been created
at 7c21ffa8c105a0e688a80dca8558bbff49eeb8fa (commit)

- Log -----------------------------------------------------------------
commit 7c21ffa8c105a0e688a80dca8558bbff49eeb8fa
Author: Ronaldo Richieri <ronaldo@bestpractical.com>
Date: Tue Mar 5 11:21:02 2024 -0300

Add callback to EditCustomFieldSelect before rendering values

In some cases, we might want to modify or restrict the values that are
displayed in the custom field select box. This callback allows us to do
that.

diff --git a/share/html/Elements/EditCustomFieldSelect b/share/html/Elements/EditCustomFieldSelect
index 005c5c6819..8cf77664e8 100644
--- a/share/html/Elements/EditCustomFieldSelect
+++ b/share/html/Elements/EditCustomFieldSelect
@@ -212,6 +212,8 @@ $MaxValues => 1
% $_ = lc $_ foreach @Default;
% my $selected;
% my $CFVs = CachedCustomFieldValues($CustomField);
+% $m->callback( CallbackPage => '/Elements/EditCustomFieldSelect', CallbackName => 'BeforeValues',
+% CustomField => $CustomField, Values => $CFVs, ARGSRef => \%ARGS );
% my @levels;
% while ( my $value = $CFVs->Next ) {
% my $name = $value->Name;

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


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