Takes a paramhash with the fields FIELD, OPERATOR, VALUE and DESCRIPTION Generally best called from LimitFoo methods
These routines are the targets of a dispatch table depending on the type of field. They all share the same signature:
my ($self,$field,$op,$value,@rest) = @_;
The values in @rest should be suitable for passing directly to DBIx::SearchBuilder::Limit.
Essentially they are an expanded/broken out (and much simplified) version of what ProcessRestrictions used to do. They're also much more clearly delineated by the TYPE of field being processed.
Handle ID field.
Handle Fields which are limited to certain values, and potentially need to be looked up from another class.
This subroutine actually handles two different kinds of fields. For some the user is responsible for limiting the values. (i.e. Status, Type).
For others, the value specified by the user will be looked by via specified class.
Meta Data: name of class to lookup in (Optional)
Handle fields where the values are limited to integers. (For example, Priority, TimeWorked.)
Meta Data: None
Handle fields which deal with links between assets. (MemberOf, DependsOn)
Meta Data: 1: Direction (From, To) 2: Link Type (MemberOf, DependsOn, RefersTo)
Handle date fields. (Created, LastTold..)
Meta Data: 1: type of link. (Probably not necessary.)
Handle simple fields which are just strings. (Subject,Type)
Handle watcher limits. (Requestor, CC, etc..)
Meta Data: 1: Field to query on
Handle watcher membership limits, i.e. whether the watcher belongs to a specific group or not.
Meta Data: 1: Role to query on
Try and turn a CF descriptor into (cfid, cfname) object pair.
Takes an optional second parameter of the CF LookupType, defaults to Asset CFs.
Limit based on CustomFields
Meta Data: none
You don't want to serialize a big assets object, as the {items} hash will be instantly invalid _and_ eat lots of space
Convert a RT-SQL string into a set of SearchBuilder restrictions.
Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
Returns the last string passed to "FromSQL".
Removes all restrictions irretrievably
To install RT::Extension::AssetSQL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RT::Extension::AssetSQL
CPAN shell
perl -MCPAN -e shell install RT::Extension::AssetSQL
For more information on module installation, please visit the detailed CPAN module installation guide.