RT::Transaction - RT's transaction object
use RT::Transaction;
Each RT::Transaction describes an atomic change to a ticket object or an update to an RT::Ticket object. It can have arbitrary MIME attachments.
Create a new transaction.
This routine should _never_ be called by anything other than RT::Ticket. It should not be called from client code. Ever. Not ever. If you do this, we will hunt you down and break your kneecaps. Then the unpleasant stuff will start.
TODO: Document what gets passed to this
Returns the Scrips object for this transaction. This routine is only useful on a freshly created transaction object. Scrips do not get persisted to the database with transactions.
Returns the array of Rule objects for this transaction. This routine is only useful on a freshly created transaction object. Rules do not get persisted to the database with transactions.
Delete this transaction. Currently DOES NOT CHECK ACLS
Returns the RT::Attachments object which contains the "top-level" object attachment for this transaction.
Returns whether this transaction has attached mime objects.
If this transaction has attached mime objects, returns the body of the first textual part (as defined in RT::I18N::IsTextualContentType). Otherwise, returns the message "This transaction appears to have no content".
Takes a paramhash. If the $args{'Quote'} parameter is set, wraps this message at $args{'Wrap'}. $args{'Wrap'} defaults to 70.
If $args{'Type'} is set to text/html
, this will return an HTML part of the message, if available. Otherwise it looks for a text/plain part. If $args{'Type'} is missing, it defaults to the value of $RT::Transaction::PreferredContentType
, if that's missing too, defaults to textual.
Returns text prepended to content when transaction is quoted (see Quote
argument in "Content"). By default returns localized "On <date> <user name> wrote:\n".
Wrapper to calculate wrap criteria and apply quote wrapping if needed.
Wrap the contents of transactions based on Wrap settings, maintaining the quote character from the original.
Returns a hashref of addresses related to this transaction. See "Addresses" in RT::Attachment for details.
Returns the RT::Attachment object which contains the content for this Transaction
We may need to pull this out to another module later, but for now, this is better than RT::I18N::IsTextualContentType because that believes that a message/rfc822 email is displayable, despite it having no content
If this transaction has attached mime objects, returns the first one's subject Otherwise, returns null
Returns all the RT::Attachment objects which are attached to this transaction. Takes an optional parameter, which is a ContentType that Attachments should be restricted to.
A private method used to attach a mime object to this transaction.
Returns a text string which describes this transaction
Returns a text string which briefly describes this transaction
Returns an HTML string which briefly describes this transaction.
Returns true if the creator of the transaction is a requestor of the ticket. Returns false otherwise
Takes the name of a table column. Returns its value as a string, if the user passes an ACL check
Returns true if current user has rights to see this particular transaction.
This fact depends on type of the transaction, type of an object the transaction is attached to and may be other conditions, so this method is prefered over custom implementations.
It always returns true if current user is system user.
Returns an object of the class specified by the column ReferenceType
and loaded with the id specified by the column NewReference
or OldReference
. ReferenceType
is assumed to be an RT::Record subclass.
The object may be unloaded (check $object->id
) if the reference is corrupt (such as if the referenced record was improperly deleted).
Returns undef if either ReferenceType
or NewReference
/OldReference
is false.
Takes a hash of:
CustomField-C<Id> => Value
or:
Object-RT::Transaction-CustomField-C<Id> => Value
parameters to update this transaction's custom fields.
Finds and returns the custom field of the given name for the transaction, overriding "LoadCustomFieldByIdentifier" in RT::Record to look for queue-specific CFs before global ones.
Returns the RT::Transaction lookup type, which can be passed to RT::CustomField->Create() via the 'LookupType' hash key.
Similar to Ticket class SquelchMailTo method - returns a list of transaction's squelched addresses. As transactions are immutable, the list of squelched recipients cannot be modified after creation.
Returns the list of email addresses (as Email::Address objects) that this transaction would send mail to. There may be duplicates.
Takes the following arguments:
a string to indicate the frequency of digest delivery. Valid values are "daily", "weekly", or "susp".
an optional argument which, if true, will return addresses even if this notification has been marked as 'sent' for this transaction.
Returns an array of users who should now receive the notification that was recorded in this transaction. Returns an empty array if there were no deferred users, or if $include_sent was not specified and the deferred notifications have been sent.
This method returns a list of objects for which a user's rights also apply to this Transaction.
This currently only applies to Transaction Custom Fields on Tickets, so we return the Ticket's Queue and the Ticket.
This method is called from "HasRight" in RT::Principal.
Returns the current value of id. (In the database, id is stored as int(11).)
Returns the current value of ObjectType. (In the database, ObjectType is stored as varchar(64).)
Set ObjectType to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, ObjectType will be stored as a varchar(64).)
Returns the current value of ObjectId. (In the database, ObjectId is stored as int(11).)
Set ObjectId to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, ObjectId will be stored as a int(11).)
Returns the current value of TimeTaken. (In the database, TimeTaken is stored as int(11).)
Set TimeTaken to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, TimeTaken will be stored as a int(11).)
Returns the current value of Type. (In the database, Type is stored as varchar(20).)
Set Type to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Type will be stored as a varchar(20).)
Returns the current value of Field. (In the database, Field is stored as varchar(40).)
Set Field to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Field will be stored as a varchar(40).)
Returns the current value of OldValue. (In the database, OldValue is stored as varchar(255).)
Set OldValue to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, OldValue will be stored as a varchar(255).)
Returns the current value of NewValue. (In the database, NewValue is stored as varchar(255).)
Set NewValue to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, NewValue will be stored as a varchar(255).)
Returns the current value of ReferenceType. (In the database, ReferenceType is stored as varchar(255).)
Set ReferenceType to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, ReferenceType will be stored as a varchar(255).)
Returns the current value of OldReference. (In the database, OldReference is stored as int(11).)
Set OldReference to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, OldReference will be stored as a int(11).)
Returns the current value of NewReference. (In the database, NewReference is stored as int(11).)
Set NewReference to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, NewReference will be stored as a int(11).)
Returns the current value of Data. (In the database, Data is stored as varchar(255).)
Set Data to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Data will be stored as a varchar(255).)
Returns the current value of Creator. (In the database, Creator is stored as int(11).)
Returns the current value of Created. (In the database, Created is stored as datetime.)
← Back to index