RT-Extension-FormTools - Help write multi-page ticket creation wizards
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.
Works with RT 4.0 and 4.2
perl Makefile.PL
make
make install
May need root permissions
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.
RT::Extension::FormTools
@Plugins
rm -rf /opt/rt4/var/mason_data/obj
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')>.
next
/Elements/Header
$m-
/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:
Any other argument to name is assumed to be the name of a custom field.
name
/FormTools/Next
Renders the "Next page" button.
/FormTools/ShowChoices
Shows the values that have already been submitted.
In addition to the Mason components, this module provides a number of functions which may be useful to call from Mason templates.
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.
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_address
Returns true if the given email address belongs to a privileged user.
value
Returns true if the value is defined and non-empty.
Best Practical Solutions, LLC <modules@bestpractical.com>
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>.
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
To install RT::Extension::FormTools, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RT::Extension::FormTools
CPAN shell
perl -MCPAN -e shell install RT::Extension::FormTools
For more information on module installation, please visit the detailed CPAN module installation guide.