Kernel::System::StdAttachment - standard attachment lib
All standard attachment functions.
Don't use the constructor directly, use the ObjectManager instead:
my $StdAttachmentObject = $Kernel::OM->Get('Kernel::System::StdAttachment');
create a new standard attachment
my $ID = $StdAttachmentObject->StdAttachmentAdd( Name => 'Some Name', ValidID => 1, Content => $Content, ContentType => 'text/xml', Filename => 'SomeFile.xml', UserID => 123, );
get a standard attachment
my %Data = $StdAttachmentObject->StdAttachmentGet( ID => $ID, );
update a new standard attachment
my $ID = $StdAttachmentObject->StdAttachmentUpdate( ID => $ID, Name => 'Some Name', ValidID => 1, Content => $Content, ContentType => 'text/xml', Filename => 'SomeFile.xml', UserID => 123, );
delete a standard attachment
$StdAttachmentObject->StdAttachmentDelete( ID => $ID, );
lookup for a standard attachment
my $ID = $StdAttachmentObject->StdAttachmentLookup( StdAttachment => 'Some Name', ); my $Name = $StdAttachmentObject->StdAttachmentLookup( StdAttachmentID => $ID, );
get list of standard attachments - return a hash (ID => Name (Filename))
my %List = $StdAttachmentObject->StdAttachmentList( Valid => 0, # optional, defaults to 1 );
returns:
%List = ( '1' => 'Some Name' ( Filname ), '2' => 'Some Name' ( Filname ), '3' => 'Some Name' ( Filname ), );
to add an attachment to a template
my $Success = $StdAttachmentObject->StdAttachmentStandardTemplateMemberAdd( AttachmentID => 123, StandardTemplateID => 123, Active => 1, # optional UserID => 123, );
returns a list of Standard Attachment / Standard Template members
my %List = $StdAttachmentObject->StdAttachmentStandardTemplateMemberList( AttachmentID => 123, ); or my %List = $StdAttachmentObject->StdAttachmentStandardTemplateMemberList( StandardTemplateID => 123, );
Returns: %List = ( 1 => 'Some Name', 2 => 'Some Name', );
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.