The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

RT-Extension-FormTools - Help write multi-page ticket creation wizards

DESCRIPTION

This extension provides scaffolding to make it simpler to create guided multi-page ticket creation wizards. It merely provides useful Mason components to accomplish this task; it does not provide any UI. Administrators may use this extension as a base upon which to write their own forms in Mason.

RT VERSION

Works with RT 4.0 and 4.2

INSTALLATION

perl Makefile.PL
make
make install

May need root permissions

Edit your /opt/rt4/etc/RT_SiteConfig.pm

If you are using RT 4.2 or greater, add this line:

    Plugin('RT::Extension::FormTools');

For RT 4.0, add this line:

    Set(@Plugins, qw(RT::Extension::FormTools));

or add RT::Extension::FormTools to your existing @Plugins line.

Clear your mason cache
    rm -rf /opt/rt4/var/mason_data/obj
Restart your webserver

COMPONENTS

See ex/RT-Example-FormTools/ for an example extension written using this module.

/FormTools/Form

The top-level component that most elements will call, as a wrapper:

    <&|/FormTools/Form, next => "/URI/of/next/page" &>
    (form elements)
    </&>

It requires that the next page in the wizard be passed as the next parameter; this may be empty at the end of the wizard. It renders page decoration (using /Elements/Header). It assumes that the queue will be stored in $m-notes('queue')>.

/FormTools/Field

Renders a field in the form. It takes the name of a core field, or CF name:

    <& /FormTools/Field, name => 'Requestors' &>

Valid core fields include:

Requestors
Cc
AdminCc
Subject
Content
Attach
Due

Any other argument to name is assumed to be the name of a custom field.

/FormTools/Next

Renders the "Next page" button.

/FormTools/ShowChoices

Shows the values that have already been submitted.

FUNCTIONS

In addition to the Mason components, this module provides a number of functions which may be useful to call from Mason templates.

is_core_field field_name

Checks if the given field_name is is a field that we consider 'core' to RT (subject, AdminCc, etc) rather than something which should be treated as a Custom Field.

Naming a Custom Field Subject would cause serious pain with FormTools.

validate_cf CF, ARGSRef

Takes a given RT::CustomField object and a hashref of query parameters, and returns a list of a boolean of if the custom field validates, followed by a list of errors.

email_is_privileged email_address

Returns true if the given email address belongs to a privileged user.

has_value value

Returns true if the value is defined and non-empty.

AUTHOR

Best Practical Solutions, LLC <modules@bestpractical.com>

BUGS

All bugs should be reported via email to

    L<bug-RT-Extension-FormTools@rt.cpan.org|mailto:bug-RT-Extension-FormTools@rt.cpan.org>

or via the web at

    L<rt.cpan.org|http://rt.cpan.org/Public/Dist/Display.html?Name=RT-Extension-FormTools>.

LICENSE AND COPYRIGHT

This software is Copyright (c) 2014 by Best Practical Solutions

This is free software, licensed under:

  The GNU General Public License, Version 2, June 1991