Developer
User Docs ↗

NAME

RT::Report - Base class of RT search charts

DESCRIPTION

This class defines fundamental bits of code that all report classes like RT::Report::Tickets can make use of.

Subclasses are supposed to have the following things defined:

@GROUPINGS

Group By options are defined here.

@STATISTICS

Calculation options are defined here.

Check RT::Report::Tickets for real examples.

METHODS

_FieldToFunction FIELD

Returns a tuple of the field or a database function to allow grouping on that field.

FormatTable Groups => ARRAYREF, Functions => ARRAYREF, Format => 'html'

Returns the report as thead, tbody and tfoot lists of rows of cells. Format is what the cells are built for, html by default, where labels and values are escaped as they can contain names and custom field values entered by other users. Pass text to get them as they are stored.

DefaultGroupBy

By default, it's the first item in @GROUPINGS.

_DoSearchInPerl

For complicated reports that can't be calculated in SQL, do them in Perl.

GetReferencedObjects Query => QUERY

This is generally an abstraction of GetReferenced... methods in RT::Interface::Web::QueryBuilder::Tree, based on what current report is for.

Returns a tuple of the class and referenced objects.

GetCustomFields Query => QUERY

Returns an RT::CustomFields object that contains all possible custom fields the given query can refer to.

GetCustomRoles Query => QUERY

Returns an RT::CustomRoles object that contains all possible custom roles the given query can refer to.

← Back to index