RT::KeywordSelect(3)

NAME
 RT::KeywordSelect - Manipulate an RT::KeywordSelect record

SYNOPSIS
  use RT::KeywordSelect;

  my $keyword_select = RT::KeywordSelect->new($CurrentUser);
  $keyword_select->Create(
    Keyword     => 20,
    ObjectType => 'Ticket',
    Name       => 'Choices'
  );

  my $keyword_select = RT::KeywordSelect->new($CurrentUser);
  $keyword_select->Create(
    Name        => 'Choices',
    Keyword     => 20,
    ObjectType  => 'Ticket',
    ObjectField => 'Queue',
    ObjectValue => 1,
    Single      => 1,
    Depth => 4,
  );

DESCRIPTION
An RT::KeywordSelect object is a link between a Keyword and a object type (one of: Ticket), titled by the Name field of the RT::Keyword such that:

Object display will contain a field, titled with the Name field and showing any descendent keywords which are related to this object via the RT::ObjectKeywords table.
Object creation for this object will contain a field titled with the Name field and containing the descendents of the RT::Keyword as choices.  If the Single field of this RT::KeywordSelect is true, each object must be associated (via an RT::ObjectKeywords record) to a single descendent.  If the Single field is false, each object may be connect to zero, one, or many descendents.
Searches for this object type will contain a selection field titled with the Name field and containing the descendents of the RT::Keyword as choices.
If ObjectField is defined (one of: Queue), all of the above apply only when the value of ObjectField (Queue) in ObjectType (Ticket) matches ObjectValue.

METHODS

new CURRENT_USER
    Takes a single argument, an RT::CurrentUser object. Instantiates a new (uncreated) RT::KeywordSelect object.

  LoadByName( Name => [NAME], Queue => [QUEUE_ID]) . Takes a queue id and a keyword select name. tries to load the keyword select for that queue. if that fails, it tries to load it without a queue specified.

Create KEY => VALUE, ...
    Takes a list of key/value pairs and creates a the object. Returns the id of the newly created record, or false if there was an error.

    Keys are:

    Keyword - link to Keywords. Can be specified by id. Name - A name for this KeywordSelect Single - bool (described above) Depth - If non-zero, limits the descendents to this number of levels deep. ObjectType - currently only "Ticket" ObjectField - optional, currently only "Queue" ObjectValue - constrains KeywordSelect function to when ObjectType.ObjectField equals ObjectValue

  Sub SetDisabled
Toggles the KeywordSelect's disabled flag.

KeywordObj
    Returns the RT::Keyword referenced by the Keyword field.

Object
    Returns the object (currently only RT::Queue) specified by ObjectField and ObjectValue.

  CurrentUserHasQueueRight ( Queue => QUEUEID, Right => RIGHTNANAME )
Check to see whether the current user has the specified right for the specified queue.

  CurrentUserHasSystemRight RIGHTNAME
Check to see whether the current user has the specified right for the 'system' scope.

CurrentUserHasRight RIGHT  [QUEUEID]
    Takes a rightname as a string. Can take a queue id as a second optional parameter, which can be useful to a routine like create. Helper menthod for HasRight. Presets Principal to CurrentUser then calls HasRight.

HasRight
    Takes a param-hash consisting of "Right" and "Principal" Principal is an RT::User object or an RT::CurrentUser object. "Right" is a textual Right string that applies to KeywordSelects

AUTHORS
Ivan Kohler <ivan-rt@420.am>, Jesse Vincent <jesse@fsck.com>

BUGS
The ACL system for this object is more byzantine than it should be. reworking it eventually would be a good thing.

SEE ALSO
RT::KeywordSelects, RT::Keyword, RT::Keywords, RT::ObjectKeyword, RT::ObjectKeywords, RT::Record

POD ERRORS
Hey! The above document had some coding errors, which are explained below:

Around line 122:
    You forgot a '=back' before '=head2'

Around line 158:
    '=item' outside of any '=over'

Around line 254:
    You forgot a '=back' before '=head2'

Around line 275:
    '=item' outside of any '=over'

Around line 331:
    You forgot a '=back' before '=head2'

Around line 371:
    '=item' outside of any '=over'