Customizing Create Ticket Forms

I need to be able to create custom ticket forms: forms with fields that are
not available in the default ticket entry form. For example, a drop down
that has several departments to select from, or a field for whether a ticket
solution needs to be reviewed before it’s implemented. How is this done? I
couldn’t find any information in previous discussion on this list or in the
docs.

Thanks!

Dora Raymaker
Sr. Technical Writer
XO Communications
Interactive Division
503.972.6808

Raymaker, Dora wrote:

I need to be able to create custom ticket forms: forms with fields that are
not available in the default ticket entry form. For example, a drop down
that has several departments to select from, or a field for whether a ticket
solution needs to be reviewed before it’s implemented. How is this done? I
couldn’t find any information in previous discussion on this list or in the
docs.

You want to read up on keywords.

http://fsck.com/rtfm/article.html?id=2#50 is probably a good place to start.

Any way to do text fields and radio buttons in addition to selects?

-D.From: Phil Homewood [mailto:pdh@snapgear.com]
Sent: Monday, February 11, 2002 6:07 PM
To: Raymaker, Dora
Cc: rt-users@lists.fsck.com
Subject: Re: [rt-users] Customizing Create Ticket Forms

Raymaker, Dora wrote:

I need to be able to create custom ticket forms: forms with fields that
are
not available in the default ticket entry form. For example, a drop down
that has several departments to select from, or a field for whether a
ticket
solution needs to be reviewed before it’s implemented. How is this done?
I
couldn’t find any information in previous discussion on this list or in
the
docs.

You want to read up on keywords.

http://fsck.com/rtfm/article.html?id=2#50 is probably a good place to start.

I need to be able to create custom ticket forms: forms with fields that are
not available in the default ticket entry form. For example, a drop down
that has several departments to select from, or a field for whether a ticket
solution needs to be reviewed before it’s implemented. How is this done? I
couldn’t find any information in previous discussion on this list or in the
docs.

How does one make *any* custom forms with RT?  I've gotten used to

most of its basic web interface features, but I’ve not gotten used to all
of RT. I would like to make “worker logs” web pages and “work requests”
forms, but I don’t even know where to start looking. RTFM is a good idea,
but I can’t find an M to R. :slight_smile:

							TIA,
							Jaime

Network Administrator
Cairo-Durham Central School District

I need to be able to create custom ticket forms: forms with fields that are
not available in the default ticket entry form. For example, a drop down

How does one make any custom forms with RT? I’ve gotten used to
most of its basic web interface features, but I’ve not gotten used to all

Quite simply, by writing your own pages and copying to the appropriate
place in the WebRT/html tree. For some curious reason, a lot of working
example pages are already provided for you, including authentication to
the RT system :wink:

Firstly, think about what you want to do, and the RT variables that you
need to do it. Have a close look through the examples, and especially
read through the HTML::Mason perldoc. Any custom pages that you create
will be Mason’s bastardised mixture of HTML and perl code, which works out
extremely well.

Regards,

                         Bruce Campbell                            RIPE
               Systems/Network Engineer                             NCC
             www.ripe.net - PGP562C8B1B                      Operations

Quite simply, by writing your own pages and copying to the appropriate
place in the WebRT/html tree. For some curious reason, a lot of working
example pages are already provided for you, including authentication to
the RT system :wink:

OK, OK, you got me there.  I just don't have enough time to do the

tasks that the boss(es) put on me, let alone my actual job description.
So I was hoping for something more than just “read the code and figure it
out.” :slight_smile:

Are there any special cases that I should know about?  For

example, I’m assuming that /NoAuth/* is for the pages that don’t require a
login process. Is that correct?

What about any special variables or techniques?  For example, if

someone asked me how to add a module to TWIG, I’d tell them to make a
directory in features/ named after thier module, to put the main menu
entry into config/mainmenu.inc.php3, etc.

Thanks in advance for any pointers.

						Off to read code,
						Jaime

Network Administrator
Cairo-Durham Central School District

Jaime Kikpole wrote:

Quite simply, by writing your own pages and copying to the appropriate
place in the WebRT/html tree. For some curious reason, a lot of working
example pages are already provided for you, including authentication to
the RT system :wink:

    OK, OK, you got me there.  I just don't have enough time to do the

tasks that the boss(es) put on me, let alone my actual job description.
So I was hoping for something more than just “read the code and figure it
out.” :slight_smile:

    Are there any special cases that I should know about?  For

example, I’m assuming that /NoAuth/* is for the pages that don’t require a
login process. Is that correct?

Yes. Actually, there is a directory local/html in Your /path/to/rt2/,
where You can put Your adapted pages. These will be used instead of the
Mason Elements and Pages in /path/to/rt2/html/ and it’s sub directories
if they do have the same name and path from there on. So If You have
/path/to/rt2/html/WebRT/index.html and want to change it, You put Your
adapted version into /path/to/rt2/local/html/WebRT/index.html . Same for
Elements and stuff. Now, these aren’t Your typical web pages, but they
are ‘enriched’ with Mason stuff, which You’ll recognize by either being
included in tags starting with an ampersand <& … &>. These are Elements
which will be included, and possibly some attributes will be set as
well.
i.e.,
<& /Elements/TitleBoxStart, title => ‘Example’, color => ‘#000000’ &>

will draw the beginning of a Box with the text ‘Example’ on a black bar.

Then there might be blocks encased in <%INIT> statements. In these, some
perl code can be specified. I didn’t do much about this. But You could
try to modify /Elements/Tabs (respective to
/path/to/rt2/local/html/WebRT that is) to only show the Configuration
link only when Admin users are logged in. It would be like this:

<%INIT>
my ($tab, $action);
my $toptabs = { A => { title => ‘Mein RT’,
path => ‘’,
},
B => { title => ‘Suche’,
path => ‘Search/Listing.html’
},

                D => { title => 'Konfiguration',
                       path => 'Admin/'
                     }
             };

my $topactions = {
A => { html => $m->scomp(‘/Elements/CreateTicket’)
},
B => { html => $m->scomp(‘/Elements/GotoTicket’)
}
};

unless ($session{‘CurrentUser’}->HasSystemRight(‘AdminUsers’)) {

$toptabs = { A => { title => ‘Startseite’,
path => ‘’,
}
};
};

</%INIT>

(this is just an example of an evil hack, a cleaner version is easy to
be found)

Then there is <%ARGS></%ARGS>, in which default values for the arguments
which You intend to manipulate on that page/within that Element are
initialised with reasonable values like undef or “none”.

Variables can be inserted into the HTML code if You enclode them in
percent tags like this:

<% $toptabs->{$tab}->{‘title’}%>

Perl code can be embedded by preceding a given line with a percent sign:

% if ($subtabs_scalar) { #this is perl
<% $subtabs_scalar |n%>
% } //this is perl
Some Text

Better, correct, and more readable examples is all of the stuff found in
/path/to/rt2/html/WebRT/. There are also some man pages on rt stuff.
Just add /path/to/rt2/man to Your $MANPATH and You’re set to read stuff
about RT, RT::CurrentUser and a slew of other things. Beware: These man
pages may be outdated, so You know.

If You need to know more, just google for stuff about Mason, and have a
close look at RT - it should be all You need. A german computer magazine
(iX) had an article about Mason in it’s february issue, so if You know
enough german, You can have a look at their web site (they publish some
of their articles online, without any registration - the article can be
found at http://www.heise.de/ix/artikel/2002/02/128/).

Regards,
Harald

    What about any special variables or techniques?  For example, if

someone asked me how to add a module to TWIG, I’d tell them to make a
directory in features/ named after thier module, to put the main menu
entry into config/mainmenu.inc.php3, etc.

    Thanks in advance for any pointers.

                                                    Off to read code,
                                                    Jaime

Harald Wagener | Systemadministrator
FCB/Wilkens GmbH | Tel.:+49-40-2881-1252
An der Alster 42 | Fax.:+49-40-2881-1263
20099 Hamburg | http://www.fcb-wilkens.com

Jaime Kikpole wrote:

So I was hoping for something more than just “read the code and figure it
out.” :slight_smile:

    Are there any special cases that I should know about? 

Yes. Actually, there is a directory local/html in Your /path/to/rt2/,
where You can put Your adapted pages.

[omitted: the content found at
http://lists.fsck.com/pipermail/rt-users/2002-February/006694.html]

Oh wow. That was incredibly informative. Many bits in there I wish I’d
known before I got started but never tripped over in my R’g all TFM’s I
could find.

Thanks!

–j
Jim Meyer, Geek At Large purp@wildbrain.com