Kernel::Output::HTML::Layout::Article - Helper functions for article rendering.
Get article fields as returned by specific article backend.
my %ArticleFields = $LayoutObject->ArticleFields( TicketID => 123, # (required) ArticleID => 123, # (required) );
Returns article fields hash:
%ArticleFields = ( Sender => { # mandatory Label => 'Sender', Value => 'John Smith', Prio => 100, }, Subject => { # mandatory Label => 'Subject', Value => 'Message', Prio => 200, }, ... );
Get article content preview as returned by specific article backend.
my $ArticlePreview = $LayoutObject->ArticlePreview( TicketID => 123, # (required) ArticleID => 123, # (required) ResultType => 'plain', # (optional) plain|HTML, default: HTML MaxLength => 50, # (optional) performs trimming (for plain result only) );
Returns article preview in scalar form:
$ArticlePreview = 'Hello, world!';
Get available article actions as returned by specific article backend.
my @Actions = $LayoutObject->ArticleActions( TicketID => 123, # (required) ArticleID => 123, # (required) );
Returns article action array:
@Actions = ( { ItemType => 'Dropdown', DropdownType => 'Reply', StandardResponsesStrg => $StandardResponsesStrg, Name => 'Reply', Class => 'AsPopup PopupType_TicketAction', Action => 'AgentTicketCompose', FormID => 'Reply' . $Article{ArticleID}, ResponseElementID => 'ResponseID', Type => $Param{Type}, }, { ItemType => 'Link', Description => 'Forward article via mail', Name => 'Forward', Class => 'AsPopup PopupType_TicketAction', Link => "Action=AgentTicketForward;TicketID=$Ticket{TicketID};ArticleID=$Article{ArticleID}" }, ... );
Get customer users from an article to use as recipients.
my @CustomerUserIDs = $LayoutObject->ArticleCustomerRecipientsGet( TicketID => 123, # (required) ArticleID => 123, # (required) );
Returns array of customer user IDs who should receive a message:
@CustomerUserIDs = ( 'customer-1', 'customer-2', ... );
get body and attach e. g. inline documents and/or attach all attachments to upload cache
for forward or split, get body and attach all attachments
my $HTMLBody = $LayoutObject->ArticleQuote( TicketID => 123, ArticleID => 123, FormID => $Self->{FormID}, UploadCacheObject => $Self->{UploadCacheObject}, AttachmentsInclude => 1, );
or just for including inline documents to upload cache
my $HTMLBody = $LayoutObject->ArticleQuote( TicketID => 123, ArticleID => 123, FormID => $Self->{FormID}, UploadCacheObject => $Self->{UploadCacheObject}, AttachmentsInclude => 0, );
Both will also work without rich text (if $ConfigObject->Get('Frontend::RichText') is false), return param will be text/plain instead.
This software is part of the OTRS project (https://otrs.org/).
This software comes with ABSOLUTELY NO WARRANTY. For details, see the enclosed file COPYING for license information (GPL). If you did not receive this file, see https://www.gnu.org/licenses/gpl-3.0.txt.