[rt-users] Custom Field size
Todd Chapman
todd at chaka.net
Thu Feb 7 15:57:44 EST 2008
RT has a callback to change what component is used to edit/display a CF. I
wrote a callback that made it easy to override the component to be used for
a specific CF.
Here is the callback:
$ cat
/opt/rt3/local/html/Callbacks/my_company/Elements/EditCustomField/EditComponentName
<%INIT>
return unless $CustomField;
if ( $CustomField->FriendlyPattern =~ /\WTime\W/ ) {
$$Name = $m->callers(1)->dir_path . "/CustomFields/TimePicker";
return;
}
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>
With that in place I can just drop a new component in the right place to get
the desired behavior. Here is one what does what you want:
$ cat /opt/rt3/local/html/Elements/CustomFields/EditCF_Change_Description
<& /Elements/EditCustomFieldText, %ARGS, Rows => 10, Cols => 40 &>
This is handy for all sorts of things.
-Todd
On 2/7/08, Kenneth Crocker <KFCrocker at lbl.gov> wrote:
>
> To all,
>
>
> My turn!!! Awhile back, I asked about how to increase the size of
> a
> custom Field I defined as "Fill in one text area". It all works fine,
> but the size is like really, really, really small. I wanted to make the
> box (where the user would type his stuff) much bigger. I was told to
> change the size of "RT::MessageBoxWidth. I did. I made it
> "Set($MessageBoxWidth , 180);" and when I bounced RT, the box doesn't
> look any different. I created a ticket and when I typed info in the
> field, same small box and look. Sooooooo, does anyone have a solution to
> that one? I would greatly appreciate it. Thanks.
>
>
> Kenn
> LBNL
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20080207/2da5405b/attachment.htm>
More information about the rt-users
mailing list