
#############
StdAttachment
#############


****
NAME
****


Kernel::System::StdAttachment - standard attachment lib


***********
DESCRIPTION
***********


All standard attachment functions.


****************
PUBLIC INTERFACE
****************


new()
=====


Don't use the constructor directly, use the ObjectManager instead:


.. code-block:: perl

     my $StdAttachmentObject = $Kernel::OM->Get('Kernel::System::StdAttachment');



StdAttachmentAdd()
==================


create a new standard attachment


.. code-block:: perl

     my $ID = $StdAttachmentObject->StdAttachmentAdd(
         Name        => 'Some Name',
         ValidID     => 1,
         Content     => $Content,
         ContentType => 'text/xml',
         Filename    => 'SomeFile.xml',
         UserID      => 123,
     );



StdAttachmentGet()
==================


get a standard attachment


.. code-block:: perl

     my %Data = $StdAttachmentObject->StdAttachmentGet(
         ID => $ID,
     );



StdAttachmentUpdate()
=====================


update a new standard attachment


.. code-block:: perl

     my $ID = $StdAttachmentObject->StdAttachmentUpdate(
         ID          => $ID,
         Name        => 'Some Name',
         ValidID     => 1,
         Content     => $Content,
         ContentType => 'text/xml',
         Filename    => 'SomeFile.xml',
         UserID      => 123,
     );



StdAttachmentDelete()
=====================


delete a standard attachment


.. code-block:: perl

     $StdAttachmentObject->StdAttachmentDelete(
         ID => $ID,
     );



StdAttachmentLookup()
=====================


lookup for a standard attachment


.. code-block:: perl

     my $ID = $StdAttachmentObject->StdAttachmentLookup(
         StdAttachment => 'Some Name',
     );
 
     my $Name = $StdAttachmentObject->StdAttachmentLookup(
         StdAttachmentID => $ID,
     );



StdAttachmentList()
===================


get list of standard attachments - return a hash (ID => Name (Filename))


.. code-block:: perl

     my %List = $StdAttachmentObject->StdAttachmentList(
         Valid => 0,     # optional, defaults to 1
     );


returns:


.. code-block:: perl

     %List = (
         '1' => 'Some Name',
         '2' => 'Some Name',
         '3' => 'Some Name',
     );



StdAttachmentStandardTemplateMemberAdd()
========================================


to add an attachment to a template


.. code-block:: perl

     my $Success = $StdAttachmentObject->StdAttachmentStandardTemplateMemberAdd(
         AttachmentID       => 123,
         StandardTemplateID => 123,
         Active             => 1,        # optional
         UserID             => 123,
     );



StdAttachmentStandardTemplateMemberList()
=========================================


returns a list of Standard Attachment / Standard Template members


.. code-block:: perl

     my %List = $StdAttachmentObject->StdAttachmentStandardTemplateMemberList(
         AttachmentID => 123,
     );
 
     or
     my %List = $StdAttachmentObject->StdAttachmentStandardTemplateMemberList(
         StandardTemplateID => 123,
     );


Returns:


.. code-block:: perl

     %List = (
         1 => 'Some Name',
         2 => 'Some Name',
     );





