[rt-users] Custom Field size

Kenneth Crocker KFCrocker at lbl.gov
Thu Feb 7 16:24:51 EST 2008


Todd,


	That's pretty cool. Any answer as to why the first instruction I got 
doesn't work? I more curious than anything else. I'm still REAL new to 
the UNIX world and perl and more of n Administer at this point. I've 
written some simple scrips but no code that involves callbacks, 
subroutines, etc. My hero once said "a good man always knows his 
limitations". So I'm learning this stuff painfully slow. For example:

	I assume $ cat means you want me to put the code that starts with the 
line return .... into ".../Elements/EditCustomField/EditComponentName". 
Do I include the <%init> line? Also, how will RT know that I want just 
the one CF to be bigger and what size? What is "<%ARGS>"? Does all of 
that code go in "/EditCustomField/"? Is that a directory? Is 
"/EditComponentName" a file and does it hold the "</%ARGS>" part of the 
code?
	As you can see, I know very little about any perl code that is the 
least bit complicated. If I understood your code better, I'd more than 
likely use it as my 35 years of coding in 20 other languages taught me 
that hard-coding and redundant coding is BAD, BAD, BAD. Thanks.


Kenn
LBNL

On 2/7/2008 12:57 PM, Todd Chapman wrote:
> 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 
> <mailto: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
>     <mailto:sales at bestpractical.com>
> 
> 
>     Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
>     Buy a copy at http://rtbook.bestpractical.com
> 
> 




More information about the rt-users mailing list