diff options
author | mark <mark> | 2010-12-01 07:19:28 +0000 |
---|---|---|
committer | mark <mark> | 2010-12-01 07:19:28 +0000 |
commit | 7b2693e9ee5809ccbf5356cb8b54cec7dc8cff4f (patch) | |
tree | 404bd08b3076c1f0d9a3e1b209e0c3b189560dea /lib |
Diffstat (limited to 'lib')
-rw-r--r-- | lib/RT/CustomField_Local.pm | 13 | ||||
-rw-r--r-- | lib/RTx/MandatoryCustomFields.pm | 53 |
2 files changed, 66 insertions, 0 deletions
diff --git a/lib/RT/CustomField_Local.pm b/lib/RT/CustomField_Local.pm new file mode 100644 index 0000000..2deb3b8 --- /dev/null +++ b/lib/RT/CustomField_Local.pm @@ -0,0 +1,13 @@ +package RT::CustomField; + +use strict; +no warnings 'redefine'; + +sub _LocalAccessible { + { + Required => + {read => 1, write => 1, sql_type => 5, length => 6, is_blob => 0, is_numeric => 1, type => 'smallint(6)', default => '0'}, + } +} + +1; diff --git a/lib/RTx/MandatoryCustomFields.pm b/lib/RTx/MandatoryCustomFields.pm new file mode 100644 index 0000000..f908be3 --- /dev/null +++ b/lib/RTx/MandatoryCustomFields.pm @@ -0,0 +1,53 @@ +package RTx::MandatoryCustomFields; + +our $VERSION = "0.01"; + +1; + +=head1 NAME + +RTx::MandatoryCustomFields - RT Extension to require custom fields to be set before resolving a ticket + +=head1 DESCRIPTION + +This RT extension adds a field to custom field definitions, allowing +the field to be designated as "Required". If this is enabled, tickets +with no value in that custom field will refuse to resolve. Note that +unlike the Mandatory Subject extension, the field does not have to be +set to create the ticket. + +Required fields are enforced in the web interface, not the RT API, so +they can be bypassed fairly easily by command-line, email, or other +mechanisms for changing a ticket's status. This extension is for +encouraging good habits, not for security. + +=head1 INSTALLATION + + perl Makefile.PL + make + make initdb # if you have never installed this extension before + make install + +If your RT is not in the default path (/opt/rt3), you must set RTHOME +first. + +=head1 CONFIGURATION + +Add this line to your RT_SiteConfig.pm: + +Set(@Plugins, ( 'RTx::MandatoryCustomFields' )); + +If you already have a Set(@Plugins ...) line, add 'RTx::MandatoryCustomFields' +to the list of values. + +Then edit your custom field and check the 'Required' box. Any number of +custom fields may be flagged as required. + +If the user tries to resolve a ticket when one or more required fields +are empty, + +=head1 AUTHOR + +Mark Wells <mark@freeside.biz> + +=cut |