[rt-users] Custom Fields question?

Todd Chapman todd at chaka.net
Fri Jun 30 02:14:56 EDT 2006


On Thu, Jun 29, 2006 at 10:45:39PM -0700, Zhiming Liu wrote:
> Hi Todd,
> 
> Thanks for your email. Can you tell me a little more
> the component? Is there any contribution code that I
> can find on wiki website?

Do you know how to create callbacks? /Elements/ShowCustomFields
and /Elements/EditCustomField have callbacks that let
you set the name of the component for Show/Edit of a
given CF. So you create a callback that sets the name,
and then you create the component that handles
display/edit. I have a callback that you can use as an
example:

local/html/Callbacks/todd/Elements/EditCustomField/EditComponentName:

===
<%INIT>
return unless $CustomField;

my
$Comp = $CustomField->Name;
$Comp =~ s/\W/_/g;
$Comp = $m->callers(1)->dir_path . "/CustomFields/EditCF_$Comp";

$$Name = $m->comp_exists($Comp.$CustomField->id) ? $Comp.$CustomField->id 
       : $m->comp_exists($Comp)                  ? $Comp
       :                                           $$Name
       ;
</%INIT>
<%ARGS>
$Name
$CustomField => undef
$Object => undef<
/%ARGS>
===

> 
> I have posted another question about how to Show
> Tickets in the group only, not cross groups. Do you
> have any ideas about this? Thanks again, Zhiming.
> 



More information about the rt-users mailing list