RT - Request Tracker
A fully featured request tracker package.
This documentation describes the point-of-entry for RT's Perl API. To learn more about what RT is and what it can do for you, visit https://bestpractical.com/rt.
If you're using RT's Perl libraries, you need to initialize RT before using any of the modules.
You have the option of handling the timing of config loading and the actual init sequence yourself with:
use RT;
BEGIN {
RT->LoadConfig;
RT->Init;
}
or you can let RT do it all:
use RT -init;
This second method is particular useful when writing one-liners to interact with RT:
perl -MRT=-init -e '...'
The first method is necessary if you need to delay or conditionalize initialization or if you want to fiddle with RT->Config
between loading the config files and initializing the RT environment.
Load RT's config file. First, the site configuration file (RT_SiteConfig.pm) is loaded, in order to establish overall site settings like hostname and name of RT instance. Then, the core configuration file (RT_Config.pm) is loaded to set fallback values for all settings; it bases some values on settings from the site configuration file.
In order for the core configuration to not override the site's settings, the function Set
is used; it only sets values if they have not been set already.
Connects to the database, initilizes system objects, preloads classes, sets up logging, and loads plugins.
Get a database connection. See also "Handle".
Create the Logger object and set up signal handlers.
Load all modules that define base classes.
Initializes system objects: $RT::System
, RT->SystemUser
and RT->Nobody
.
Returns the current config object, but note that you must load config first otherwise this method returns undef.
Method can be called as class method.
Returns the current database handle object.
See also "ConnectToDatabase".
Returns the logger. See also "InitLogging".
Returns the current system object. See also "InitSystemObjects".
Returns the system user's object, it's object of RT::CurrentUser class that represents the system. See also "InitSystemObjects".
Returns object of Nobody. It's object of RT::CurrentUser class that represents a user who can own ticket and nothing else. See also "InitSystemObjects".
Returns a listref of all Plugins currently configured for this RT instance. You can define plugins by adding them to the @Plugins list in your RT_SiteConfig
Takes an optional subdir (e.g. po, lib, etc.) and returns a list of directories from plugins where that subdirectory exists.
This code does not check plugin names, plugin validitity, or load plugins (see "InitPlugins") in any way, and requires that RT's configuration have been already loaded.
Push plugins' lib paths into @INC right after local/lib. In case local/lib isn't in @INC, append them to @INC
Initialize all Plugins found in the RT configuration file, setting up their lib and HTML::Mason component roots.
helper method to add js files to JSFiles
config. to add extra js files, you can add the following line in the plugin's main file:
RT->AddJavaScript( 'foo.js', 'bar.js' );
helper method to add css files to CSSFiles
config
to add extra css files, you can add the following line in the plugin's main file:
RT->AddStyleSheets( 'foo.css', 'bar.css' );
helper method of RT->Config->Get('JSFiles')
helper method of RT->Config->Get('CSSFiles')
Please report them to rt-bugs@bestpractical.com, if you know what's broken and have at least some idea of what needs to be fixed.
If you're not sure what's going on, report them rt-devel@lists.bestpractical.com.